SaaS platform for checking if number is even
SaaS platform for checking if a number is even.
Check out Live version and API Documentation.
I've decided to terminate the Backend application due to costs. AWS Infrastructure costs approximately $1.52 per day. The most significant share of these costs is generated by ALB (~40%), then RDS, and then EC2 instance. The frontend application works normally.
This project is an example of a real-world production application. This project aims to show how one can implement a working system from start to end, deploy it and monitor it. Furthermore, it gathers some of the best practices of project development and maintenance. This project contains:
Next.js
Nest.js
AWS CDK
The project is maintained as a monorepo. Each application or library is kept as a separate package. Monorepo introduces the ability to reuse code and detect cross-stack bugs early.
This whole project is a SaaS boilerplate, ready to copy and use accordingly to your start-up idea! Feel free to fork it and adjust to your needs.
The first step is to install node
and npm
globally on your machine.
You need to have docker
and docker-compose
installed on your computer to run the local environment. This project uses Rush.js
as a monorepo manager. Check out the official Rush docs to set it up.
The backend application also uses AWS Cognito
. Creating your user pool is unnecessary, but you will miss the core features like signup, login, or placing the orders.
Orders fulfillment depends on Stripe
webhooks. For local development, you can use Stripe CLI
to verify webhook calls. More on that on official stripe docs.
To start the application locally, please follow the instruction specified below:
rush update
docker
dir.env
filerushx up
for spinning up the docker environmentFrontend service will start on port 3000
, and API service will start on port 4000
.
Behind the scenes, rushx up
command will spin up the docker containers. Hot reloading is enabled because those containers have their volumes linked to the source files inside packages.
If you want to rebuild your docker images and containers, use rushx build
to remove your environment and build it from the start.
The API documentation is autogenerated with Swagger
. When running locally, it is available at http://localhost:4000/docs
.
Please check out the live version of the documentation: API documentation
Here are specified technologies that are used for this project, along with a short description of the production environment.
Frontend:
Backend:
Infrastructure:
Other also important, but stack agnostic tools are:
Frontend application is deployed on Vercel
, which is one of the first choices for deploying the Next.js
application. Backend application is deployed on AWS ElasticBeanstalk
. API depends on some other services like:
The DNS configurations are done via AWS Route 53
, but they are not part of the infrastructure package.
Here is the list of missing features or possible improvements. This is not a closed list. Feel free to add some other requirements.
GraphCMS
with FrontendContributions make the open source community such a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion to improve this, please fork the repo and create a pull request. You can also open an issue with the tag enhancement
.
Each commit must follow convention specified in conventional commit guidelines.
The shape of commit must be like:
<type>(<scope>): <subject>
// example
chore: update packages
Where scope
is optional, but when used, it should match the package name e.g. backend
or frontend
.
While working on a feature, sometimes a situation may occur when it is more convenient to commit temporary changes for future rebase. To omit auto checking, command git commit
must be called with -n
or --no-verify
flag.
git commit -nm 'WIP'
This application uses Github Actions
workflow for releases and generating changelog.
Each commit pushed to main
branch triggers the workflow in which latest
tag is generated.
When tags are pushed to the main
branch, another workflow is triggered, and as a result, a release
is created. Release contains auto-generated changelog from commit history. Version bump to each package must be done manually when creating the specific tag.
The frontend application is deployed via Vercel
on every release. Backend releases or Infrastructure updates are done manually from the CLI for now.
In case of a problem with the local environment or application itself, please visit the issues to see possible solutions or open a new issue.
This project is licensed under the MIT License - see the LICENSE.md file for details. Feel free to use this project as the base for your next application.
Here are specifies some useful links for administrating or monitoring the application.
Inspiration, code snippets, or useful articles: