Giter VIP home page Giter VIP logo

apptension / saas-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.9K 15.0 206.0 19.16 MB

SaaS Boilerplate - Open Source and free SaaS stack that lets you build SaaS products faster in React, Django and AWS. Focus on essential business logic instead of coding repeatable features!

Home Page: https://apptension.com/saas-boilerplate

License: MIT License

Dockerfile 0.14% Python 20.78% Shell 0.31% JavaScript 2.73% TypeScript 62.61% HTML 0.17% Handlebars 2.11% CSS 0.33% MDX 10.82% Batchfile 0.01%
cdk stack boilerplate frontend backend workers pipeline django docker saas

saas-boilerplate's Introduction

SaaS Boilerplate

Build SaaS products faster in React, Django and AWS.

A complete SaaS starter kit based on a battle-tested stack with out-of-the-box features every SaaS should have

Version License Follow Us on Twitter Chat with us on Discord


πŸ“– SaaS Boilerplate Documentation

🌟 SaaS Boilerplate Page

πŸš€ SaaS Boilerplate Demo


Supercharge your SaaS development with our comprehensive starter kit, designed to accelerate your project and save you valuable time and resources. Our battle-tested boilerplate eliminates the need for extensive configuration and development work, allowing you to focus on innovation from day one.

SaaS Boilerplate includes essential features that every SaaS application requires, such as frontend, backend API, admin panel, and workers. With a scalable AWS-based architecture and continuous deployment, you can easily deploy multiple environments representing different stages in your pipeline.

Say goodbye to weeks of setup and coding. Our proven stack and ready-to-use features empower you to jumpstart your project and prioritize building your product's intellectual property. Unlock your SaaS potential faster than ever before and seamlessly transition from setup to innovation.

Features

This boilerplate includes plenty of ready to use features that you can adjust to you needs:

... and more

The full list with the descriptions can be found in the features documentation.

Getting started

Requirements

  • Install Docker
  • Install Node.js version 18 or above (which can be checked by running node -v). You can use nvm or n for managing multiple Node versions installed on a single machine.
  • Install pnpm version 9 or above (which can be checked by running pnpm --version)
  • (Windows only) Install WSL 2

Optional

  • Install Python version 3.11 (which can be checked by running python3 --version) and PDM version 2.3 or above (which can be checked by running pdm --version)
    • You need this one if you want to run pdm install command in packages/backend or packages/workers outside docker container
    • You can use pyenv for managing multiple Python versions installed on a single machine.

Fresh installation

Setup using CLI starter kit

You can use a special CLI tool to run a new local instance of the SaaS Boilerplate as soon as possible. It will clone the repository and take care of setting up the environment. Run the following command in the directory where you would like to create a new project:

Using npm:

npm init saas-boilerplate PATH

Using pnpm:

pnpm create saas-boilerplate PATH

Using yarn:

yarn create saas-boilerplate PATH

ℹ️ Where PATH is a directory name where to initialize project.

⚠️ The init directory needs to be empty!

Manual setup

For the manual setup clone this repository and follow the steps in Getting started guide.

Run existing project

⚠️ If you are using a Windows machine, it's mandatory to have WSL 2 (Windows Subsystem for Linux) installed on your system to run the commands for installing dependencies and running the application.

Install dependencies

The project is configured to use pnpm workspaces, which means that you can install node_modules of all packages in repository, with single command:

pnpm install

Start the app

Start both: backend and webapp

pnpm saas up

Start backend

pnpm saas backend up

Start webapp

pnpm saas webapp up

Local documentation

In order to run your local documentation server execute following command:

pnpm saas docs up

Tech stack

Front-end stack:

Back-end stack:

Infrastructure:

  • NX
  • AWS infrastructure written in AWS CDK
  • Github or Bitbucket

3rd party services:

  • Stripe
  • Contentful
  • Sentry
  • SonarCloud
  • OpenAI

The detailed stack description is available in the documentation.

How was the SaaS Boilerplate created?

In our experience in Apptension, we have built hundreds of web and mobile applications over the years and saw a bunch of standard features. For example, all applications (or at least 99% of them) need a login, email templating, payments and subscriptions, CMS integration, and more.

A broader list of elements that can be implemented in projects in this way was created after building dozens of different types of SaaS products. We analyzed them and noticed many common parts appeared virtually unchanged. So we created SaaS Boilerplate that is the base, and while it requires design or functional customization for a specific SaaS product, it dramatically reduces development time.

That's why you don't have to start by writing the code for that login or payment function. Instead, you can use off-the-shelf elements in those places and focus on creating the rest of the features unique to the project.

The development process is ongoing as we continually add new features and improve existing ones. We started with AWS Boilerplate, which evolved into the current SaaS Boilerplate. It originally contained only infrastructure (a configured AWS account) and was a template for the project, which had blanks for the back-end and front-end.

We saw that it was already a handy and very well-received tool, so the next natural step was to add more elements to it – front-end, back-end, and pack the relevant features that were most often repeated in different projects, including logging, CRUD, payments, integration with content pool, etc.

Our idea was that it shouldn't be just the code itself because SaaS Boilerplate also contains our know-how – because we gathered everything needed for development and around development in one package. So you don't have to think about choosing code formatting, matching different tools and their subsequent configuration, etc. Moreover, such a package is proven and battle-tested – you can just upload it to the cloud and start so-called heavy development.

Who are we?

We're Apptension, a team that turns ideas into world-class software using expertise in technology, design, and product management. We work with founders, investors, and creative agencies to help them bring uncommon ideas to the market.

Our partners value our outside-the-box thinking, clear and honest communication, and reliability – even in the most dynamic and time-compressed projects. Among our clients – plenty of early-stage startups, as well as international tech behemoths like Netflix and Uber. We live and breathe tech – and we're darn good at it.

To bring even more value to our partners, we create bespoke tools (like SaaS Boilerplate), allowing us to shorten time-to-market while avoiding technical debt.

License

SaaS Boilerplate is licensed under the MIT License.

Contributing to SaaS Boilerplate

We welcome contributions from anyone interested in improving SaaS Boilerplate. Please keep in mind that this project follows a Code of Conduct to ensure a welcoming community for all.

For more detailed information on how to contribute to this project, please refer to our Contributing Guide.

If you have any questions about contributing, please join our Discord server - we are happy to help you!

Thank you for considering contributing to SaaS Boilerplate!

saas-boilerplate's People

Contributors

aniketkumar7 avatar bielsky0 avatar dependabot[bot] avatar dsowinski2 avatar emil-litwiniec avatar esenti avatar ingrqm-apptension avatar kacperadler avatar kagorski avatar kailip avatar khanek avatar kstronka avatar matiasanaya avatar michalsoczynski avatar mikeqcp avatar mkleszcz avatar pgrzeszczak avatar pmichalek-apptension avatar pmikutel avatar pziemkowski avatar sdrejkarz avatar szdrasiak-apptension avatar toreno96 avatar validraganescu avatar voytek98 avatar wilq3 avatar wojcikmat avatar wojlosapptension avatar worldsbestdeveloper avatar yelwo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

saas-boilerplate's Issues

Status Dashboard misses env variables from .env.tools

Describe the bug
Currently, the scripts inside status-dashboard are using the following commands to work with the StatusDashboardStack:

  "scripts": {
    "deploy": "env-cmd -f ../../../.env.tools cdk deploy *StatusDashboardStack",
    "diff": "env-cmd -f ../../../.env.tools cdk diff *StatusDashboardStack"
  },

However, the .env.tools file is missing, which should contain the environment variables necessary for the deployment.

To Reproduce
Steps to reproduce the behavior:

  1. Run nx run status-dashboard:diff
  2. See error
> nx run status-dashboard:diff

> [email protected] diff /Users/przemyslawmichalek/PycharmProjects/saas-boilerplate/packages/internal/status-dashboard
> env-cmd -f ../../../.env.tools cdk diff *StatusDashboardStack
Error: Failed to find .env file at path: ../../../.env.tools
    at getEnvFile (/Users/przemyslawmichalek/PycharmProjects/saas-boilerplate/node_modules/.pnpm/[email protected]/node_modules/env-cmd/dist/get-env-vars.js:40:19)
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior
Those env variables should be stored in AWS SSM Parameter Store and retrieved via chamber.

Sync stripe models before initialising subscription plans

Describe the bug
On fresh db setup with stripe account already having subscription plans, duplicate ones are being created. That's because in run_local.sh script, init_subscriptions command runs without djstripe_sync_models. If djstripe models are synced, the duplicate plans are not created.

To Reproduce
Steps to reproduce the behavior:

  1. Make sure your stripe models are not synced
  2. Add STRIPE_TEST_SECRET_KEY inside packages/backend/.env which belongs to account with already created subscription plans
  3. Simply run make up which triggers backend's run_local.sh script
  4. See duplicated plans created in django admin/stripe dashboard

Expected behavior
Stripe's Product and Price models should be synced before running init_subscriptions command inside run_local.sh. Since there might already be plenty of data to sync, there's no point to sync all the data (the default behaviour of djstripe_sync_models command without any args). Running ./manage.py djstripe_sync_models Product Price should be sufficient to avoid creating duplicate subscription plans and to provide a quick backend startup time.

Update descriptions of the features on feature pages

Is your feature request related to a problem? Please describe.
Some of the descriptions on feature pages are not clear enough to users who would like to check the demo.

image

Describe the solution you'd like
Please go through each description and update it so it's more clear. Describe what each feature does and what functionality for developer if ships.

Add missing edit user profile link on mobile

When mobile sidebar is available the profile icon from the navbar is hidden. In this state in sidebar there is additional Logout option. I think we could add the Your profile option to the sidebar in this case and separate those two additional options with <Separator/>.

Related to #245

Update application screens in docs

Is your feature request related to a problem? Please describe.
Currently docs contains old look of the application.

Describe the solution you'd like
We need to take a new screenshots and update them in docs

HMR on is not working

Describe the bug
HMR throws an error in console on component update.

To Reproduce
Steps to reproduce the behavior:

  1. Run nx start:app
  2. Open application in browser
  3. Change component code
  4. See error in console

Expected behavior
The component should be update in browser without page refresh.

Additional context
It might be connected with some dependencies changes. On master branch it's working, on radix branch it's broken.

Backend's build script doesn't pull latest image

Describe the bug
In services/backend/scripts/build.sh the docker pulling statement is before docker login

docker pull "$BACKEND_REPO_URI:latest" || true

# ...

if DOCKER_LOGIN=$(aws ecr get-login-password --region "$AWS_DEFAULT_REGION" 2> /dev/null); then
 echo "$DOCKER_LOGIN" | docker login --username AWS --password-stdin "$AWS_ACCOUNT_ID".dkr.ecr."$AWS_DEFAULT_REGION".amazonaws.com
else
 echo "get-login-password not supported by the AWS CLI, trying get-login instead..."
 # shellcheck disable=SC2091
 $(aws ecr get-login --no-include-email --region "$AWS_DEFAULT_REGION")
fi

This means it will always fail

Expected behavior
Backend build scripts pulls latest image to reuse existing layers during build.

Save theme value in LocalStorage

Is your feature request related to a problem? Please describe.
Currently theme state is set based on the system preference on each page load. If user change it to the opposite it will remain until another refresh.

Describe the solution you'd like
State should be always saved in the LocalStorage after user changed it manually.

Additional context
Our current UI is quite simple but as an extension we might think about more advanced solution with the three possible states: light, dark and system which will be always based on the system state. It might be nice if someone have system theme changing during the day for example and would like the application to follow this behavior.

The next-themes package is very good example of this. Actually would be good to use this package instead of custom code but it has unnecessary next dependency.

Related to #174

Install LocalStack fixture: Event bus already exists

Steps to reproduce

  1. Run local environment for the first time:

    make shell
    docker-compose up -d
  2. Restart backend container:

    make shell
    docker-compose restart backend

    Or by:

    make shell
    docker-compose stop backend
    docker-compose up -d --build backend

Encountered behavior

$ make shell
$ docker-compose logs backend
backend_1      | wait-for-it.sh: waiting 15 seconds for db:5432
backend_1      | wait-for-it.sh: db:5432 is available after 0 seconds
backend_1      | Install LocalStack fixture
backend_1      |
backend_1      | An error occurred (ResourceAlreadyExistsException) when calling the CreateEventBus operation: Event bus imx-local-workers already exists.

Expected behavior

backend container starts successfully.

Workaround fix

  1. Rebuilt all the containers by forcing recreate:

    make shell
    docker-compose up -d --build --force-recreate
  2. Disable event bus creation in services/backend/scripts/run_local.sh before the backend container restart:

    echo "Install LocalStack fixture"
    
    wait_for_s3
    # create_event_bus
    verify_email_in_ses

pnpm lockfile of radix-ui branch not up to date with package.json

Describe the bug

pnpm lockfile of radix-ui branch not up to date with package.json

pnpm install --include-workspace-root --frozen-lockfile --filter=docs... --filter=backend...
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
Scope: 15 of 2[3](https://github.com/apptension/saas-boilerplate/actions/runs/5174312422/jobs/9320486808?pr=183#step:4:3) workspace projects
Lockfile is up to date, resolution step is skipped
 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with packages/webapp-libs/webapp-core/package.json

Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Error: Process completed with exit code 1.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout to branch feature/radix-ui
  2. Use "pnpm install" in root folder

Update `dj-stripe` library in packages/backend to 2.7.x and stripe-mock docker image

Is your feature request related to a problem? Please describe.
There's a newer version of dj-stripe which has support for more payment methods.

There's also a newer version of stripe-mock docker image hosted in a different organisation. We should migrate.
I'm putting this information in the same ticket as probably new dj-stripe would need new API mock.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
I tried updating myself but seems that a number of tests fail and it's not a quick drop-in change.

Storybooks are very slow

Is your feature request related to a problem? Please describe.
Currently running storybooks are very very slow on initial startup as well as on component update

Describe the solution you'd like
First thing is to update storybook package to latest version. If this won't help then we need to dig deeper why this is so slow.

Can't run tests locally when using zsh

Steps to reproduce

zsh
make shell
cd /services/workers
make test

Encountered behavior

imx_501_db_1 is up-to-date
bash ./scripts/run_tests.sh
All done! ✨ 🍰 ✨
25 files would be left unchanged.
./scripts/wait-for-it.sh: line 146: realpath: command not found
./scripts/wait-for-it.sh: line 58: timeout: command not found
wait-for-it.sh: timeout occurred after waiting 15 seconds for localhost:5432
make[1]: *** [test] Error 127

Expected behavior

make test run without error

Workaround fix

  • Change shell to bash
make shell USER_SHELL=bash

or:

  • Install coreutils before running tests
brew install coreutils

Invalid user profile on fresh SB installation without Stripe

Describe the bug
On fresh SB installation when there is no Stripe configured the user register / login won't work because user profile is not created.

To Reproduce
Steps to reproduce the behavior:

  1. Create new SB instance locally without Stripe env configuration1
  2. Try to register and login

Expected behavior
The user should be able to register and login even if the app doesn't have Stripe integration enabled

ssh-bastion image is common to all deployed environments

Describe the bug
ssh-bastion image is common to all deployed environments. Since there's only one ECR repository (defined in global stack), and tagging docker image with ssh-bastion tag is part of building backend in Pipeline, this image always contains latest deployed code. It can cause problems, when entering with ssh-bastion to environment that wasn't deployed lately, and there were new migrations in meantime deployed to another environment. Trying to enter shell_plus results in exception caused by mismatch between the code and database (like new fields existing in models but not in the database).

Expected behavior
Have one ssh-bastion image per environment. Possible solutions may be having separate ECR repositories for each environment instead of one defined in global stack, or using different tag when tagging ssh-bastion image for each environment.

Replace flake8 with ruff inside workers

Is your feature request related to a problem? Please describe.
Ruff is already used inside the backend package so it should also be used inside workers.

Describe the solution you'd like
Replace flake8 with ruff inside workers package.

Additional context
Ruff github page

Update README to use a more specific version of pnpm

Describe the bug
I tried to setup a fresh clone with pnpm version 8.2.0 and pnpm install command failed with the error log pasted below. README.md states that pnpm version 8 or above should be sufficient, but it doesn't work with 8.2.0 . It worked for me with the latest version 8.6.1 .

 ~/PycharmProjects/saas-boilerplate git:(master) pnpm install
Scope: all 23 workspace projects
 WARN  Your pnpm-lock.yaml was generated by a newer version of pnpm. It is a compatible version but it might get downgraded to version 6.0
 ERROR  /[email protected] is an invalid relative dependency path

pnpm: /[email protected] is an invalid relative dependency path
    at Object.parse2 [as parse] (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:113619:15)
    at nameVerFromPkgSnapshot (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:113728:28)
    at addPreferredVersionsFromLockfile (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:186437:89)
    at getPreferredVersionsFromLockfileAndManifests (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:186431:7)
    at _installInContext (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:187332:142)
    at async installInContext (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:187663:16)
    at async _install (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:187202:25)
    at async mutateModules (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:186936:23)
    at async recursive (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:188424:29)
    at async installDeps (/usr/local/Cellar/pnpm/8.2.0/libexec/dist/pnpm.cjs:188720:11)

To Reproduce
Steps to reproduce the behavior:

  1. Use pnpm version 8.2.0
  2. Use a fresh clone of the repo
  3. Run pnpm install
  4. See error

Expected behavior
README.md should be more specific on pnpm version.

Fresh deployment of WebAppStack fails

Describe the bug
Fresh deployment of WebAppStack fails because of the new S3 default policy.

To Reproduce
Steps to reproduce the behavior:

  1. Install all global infra and push the code so new env should be deployed.
  2. There will ba an error in WebAppStack deployment: API: s3:PutBucketPolicy Access Denied

Expected behavior
Initial stack deployment should be successful.

Use event-based mechanism instead of polling for change detection in CodePipeline

Is your feature request related to a problem? Please describe.

On top of the CodePipeline screen a message box with following copy is shown:

This pipeline has a source (saas-qa-source) that is configured for polling. Migrate (update) your pipeline to the recommended event-based mechanism for change detection. For details, see the migration guide.

This wasn't available at the time when we worked on this integration.

Describe the solution you'd like

Reaserch and modify CDK code to use event-based mechanism instead of polling.

Migrate polling pipelines (Amazon S3 source) (AWS CloudFormation template)

Password reset email is not sent

Describe the bug
The user does not receive a reset password email.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the log in page
  2. Click on the "Forgot password" button
  3. Povide previously registered mail address
  4. Click on the "Send the link" button
  5. Check the inbox of this mail address - no mail comes

Expected behavior
A password reset mail should be sent to the e-mail address provided earlier.

Screenshots
image

`node: not found` error in BB Pipelines

Steps to reproduce

  1. Run Bitbucket Pipeline test async workers.

Encountered behavior

There is unhandled node: not found error during steps install-test and test-bb-ci. The steps continues and finishes successfully.

+ make -C services/workers install-test PROJECT_NAME=test ENV_STAGE=test
make: Entering directory '/opt/atlassian/pipelines/agent/build/services/workers'
pipenv install --dev
/bin/sh: 1: node: not found
Creating a virtualenv for this project…
Pipfile: /opt/atlassian/pipelines/agent/build/services/workers/Pipfile
Using /usr/local/bin/python3.8 (3.8.5) to create virtualenv…
+ make -C services/workers test-bb-ci PROJECT_NAME=test ENV_STAGE=test
make: Entering directory '/opt/atlassian/pipelines/agent/build/services/workers'
bash ./scripts/run_tests.sh
/bin/sh: 1: node: not found
All done! ✨ 🍰 ✨
26 files would be left unchanged.
wait-for-it.sh: waiting 15 seconds for localhost:5432
wait-for-it.sh: localhost:5432 is available after 0 seconds
running test

There is no such behavior in GitHub Actions defined for the project.

Expected behavior

Both steps (and the whole Pipeline in general) runs without any, especially unhandled, errors.

Unhandled errors that does not have actual influence on run of the Pipeline, unnecessary confuses the users.

Cause of the issue

Bitbucket Pipeline for test async workers uses image python:3.8, which does not have Node.js installed by default, while running the tests directly in this image:

$ docker run -it python:3.8 bash
root@420d6268cc7b:/# node
bash: node: command not found

GitHub Actions uses ubuntu-latest with all the dependencies pre-configured.

Also, the place where node is used is probably the base.mk:

define GetFromCfg
$(shell node -p "require('$(CONFIG_FILE)').$(1)")
endef

That would explain why the error does not influence the run of the Pipeline.

Possible solutions

Use image with all the dependencies installed

Similar to GitHub Actions.

For example, the python:3.8 with node.js installed, e.g. https://hub.docker.com/r/dstasczak/pythonwithnodejs.

Run tests of worker in docker

Similar to test backend.

It would probably require a lot of work (definition of docker-compose, Dockerfile, and adjustments in Makefile).

However, it could allow to also make this step more consistent between GH Actions, BB Pipelines and local environment.

Remove the reason of error

If node is not actually required during the test async workers then there should not be any error if it is not installed there.

Rename menu items

Describe the solution you'd like
Please rename items in the menu to more descriptive names:

- Dashboard
- Payments
- Subscriptions
- OpenAI integration
- Content items
- CRUD
- Documents
- Static pages (subheader)
- Privacy policy
- Terms and conditions

Update UI of the app using well known components

Is your feature request related to a problem? Please describe.
Current frontend app UI code is not based on any well known library or design system. It's not very easy to remove currently used stylings and component primitives could be done better.

Describe the solution you'd like
We would like to use:

Describe alternatives you've considered
We have researched other solutions like chakra or MUI but the proposed solution looks most elastic

Screens to cover

  • Login screen
  • Register screen
  • Forgot password screen
  • OTP screens
  • Dashboard
  • Profile form screen
  • Demo items screen
  • Subscription screens
  • Payment screens
  • Documents screen
  • SaaS ideas screen
  • Admin screen
  • Privacy policy and T&C screens
  • #243
  • #230
  • #244
  • #246
  • #245

Decide if remove or clean styled-components theme

Is your feature request related to a problem? Please describe.
After migrate styles to Radix and Tailwind there will be unused code with the old theme based on styled-components. We should decide either remove it entirely or clean it and prepare for future usage in case of if someone in the future would like to use styled-components instead of tailwind styles.

Additional context
Related to #174

Docker registry throws 429 Too Many Requests

Is your feature request related to a problem? Please describe.
CodePipeline PostDeploy step fails with:

#4 ERROR: failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/cypress/included/manifests/sha256:86e3bff9634b85a5239a65974ac3c98f51277a8e1519fbd57b5e528f55ab8bf7: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

Describe the solution you'd like
With no rate limit on ECR public it'd be possible to pull Docker official images as many times preferred. It should be combined with ECR Pull through cache mechanism.

Additional context
AWS docs on using pull through cache rules

`make up` throws "Couldn't find env file: packages/e2e-tests/.env"

Describe the bug
Running make up on a fresh repository throws an error because packages/e2e-tests/.env is not created automatically.

To Reproduce

  1. run make up in repo root
  2. See error

Expected behavior
docker-compose does not return any errors.

Additional context
Shell log

>  NX   Successfully ran target docker-login for project core
Couldn't find env file: /Users/<redacted>/Documents/repositories/saas-boilerplate/packages/e2e-tests/.env
 >  NX   ERROR: Something went wrong in run-commands - Command failed: docker-compose build workers
   Pass --verbose to see the stacktrace.
> nx run backend:compose-build-image
> nx run core:docker-login
 
 >  NX   Successfully ran target docker-login for project core
Couldn't find env file: /Users/<redacted>/Documents/repositories/saas-boilerplate/packages/e2e-tests/.env
 >  NX   ERROR: Something went wrong in run-commands - Command failed: docker-compose build backend
   Pass --verbose to see the stacktrace.
 
 >  NX   Running target compose-build-image for 2 projects and 2 tasks they depend on failed
   Failed tasks:
   
   - workers:compose-build-image
   - backend:compose-build-image
 >  NX   ERROR: Something went wrong in run-commands - Command failed: nx run-many --target=compose-build-image --projects=backend,workers
   Pass --verbose to see the stacktrace.

 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

 >  NX   Ran target docker-compose:up for project core and 2 task(s) they depend on (2s)
 
    βœ–    1/3 failed
    βœ”    2/3 succeeded [1 read from cache]

`TS2742` error reported in multiple places of the project in Jetbrains IDE

Describe the bug

I'm not 100% sure why but whenever you open a file that created TypedDocumentNode in one of webapp-libs you get TS2742 error:

TS2742: The inferred type of 'stripeCreatePaymentIntentMutation' cannot be named without a reference to 'packages/webapp-libs/webapp-api-client/node_modules/@graphql-typed-document-node/core/dist'. This is likely not portable. A type annotation is necessary.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any .graphql.ts file in Jetbrains IDE
  2. See the error

Expected behavior
No error present.

Screenshots
Screenshot 2023-06-12 at 16 50 44

Upgrade nx.js to v16

Is your feature request related to a problem? Please describe.
Nx.js v16 has been released a month ago and we're still using v15.

Describe the solution you'd like
Upgrade the library to v16.

Setup using CLI starter kit is broken by Github SSH key issue

Describe the bug
Attempted to use the Starter kit CLI command "npm init saas-boilerplate" to start a new clone of the project, but it failed with the error message from my terminal log:

npm init saas-boilerplate
Performing system check:
√ Checking if docker is installed... it is!
√ Checking if pnpm is installed... it is!
√ Checking if nx is installed... it is!
Project will be initialized in directory: C:\saas-demo
Fetching latest release... done
Latest release: 2.0.0-alpha.1
Start cloning repository... !
Error: Cloning into 'C:\saas-demo'...
Host key verification failed.
fatal: Could not read from remote repository.

I believe this is because Github changed their public SSH key - see here
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

To Reproduce
run the start kit CLI command "npm init saas-boilerplate"

Expected behavior
we get a configured and working clone of the repo

Remove or hide E2E tests

Is your feature request related to a problem? Please describe.
E2E tests are outdated after all changes in the 2.0. We should update them but for now until it's not done they should be removed from the codebase.

Describe the solution you'd like
Just remove the code of E2E tests and we'll revert changes in the next release when they should be updated.

Upgrade build images of CodeBuild to 7.0

Is your feature request related to a problem? Please describe.
There's a new, 7.0 version, of CodeBuild image and we're currently using 6.0

Describe the solution you'd like
Change all build image of all CodeBuild projects to v7

Fill contentful items with the right content

Is your feature request related to a problem? Please describe.
Currently there are some random, Lorem ipsum items (one even with the car image...) which are not looking good.

Describe the solution you'd like
Please add some appropriate content to the items. Use images that we know that we can use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.