This project contains the minimum needed for starting a project with Nest.js (fastify, Typescript), MongoDB, GraphQL and React.js (Typescript) as frontend. All part of this project is dockerized.
First of all you have to clone the project
git clone https://github.com/M4n0x/nestjs-mongodb-graphql-react.git
To start the backend go the backend folder and start the following commands :
For dev environment
cd backend
docker-compose up dev
for prod environment:
cd backend
docker-compose up prod
add option -d to docker-compose to detach process from terminal
In case the package*.json have change, you have to rebuild the image
docker-compose up [dev|prod] --build -V
To start the frontend same commands as backend applies :
For dev environment
cd frontend
docker-compose up dev
for prod environment:
cd frontend
docker-compose up prod
In case the package*.json have change, you have to rebuild the image
docker-compose up [dev|prod] --build -V
You can access the back through
http://localhost:5000
And the GraphQL configuration through
http://localhost:5000/graphql
For the frontend you can access through
http://localhost:3000
To stop the servers, you only have to use docker-compose down
Configuration can be found in the .env file in root directory for both back and front end