This project is fully containerized with Docker, allowing for consistent development and deployment environments. The Docker setup includes services for both the frontend (Next.js) and backend (Nest.js), as well as MongoDB and PostgreSQL databases.
Next.js (Frontend) : A React-based frontend framework configured to run in a dedicated Docker container
Nest.js (Backend) : A progressive Node.js framework for building server-side applications, running in its own container
MongoDB : A NoSQL database used for storing non-relational data, running in a separate Docker container
PostgreSQL : A powerful, open-source relational database system, running in another Docker container
To start all services simultaneously, simply use Docker Compose from the root of the project:
docker-compose up -d
This command will build (if necessary) and start all the containers defined in the
docker-compose.yml file. The "-d"
flag runs the containers in detached mode, leaving the terminal free for other commands.
The Next.js frontend is accessible at http://localhost:3001 (or the port mapped in your docker-compose.yml)
The Nest.js backend can be accessed at http://localhost:4001 (or the mapped port)
MongoDB is available on the default port 27018 (as mapped in docker-compose.yml)
PostgreSQL database is accessible on port 5433 (or the port you have configured)
To stop all running services, use the following command:
docker-compose down
This command stops and removes the containers, networks, and volumes created by
docker-compose up"scripts": {
"dev": "concurrently \"npm run dev --prefix front\" \"npm run start:dev --prefix back\"",
"start": "concurrently \"npm run start --prefix front\" \"npm run start --prefix back\"",
"lint": "concurrently \"npm run lint --prefix front\" \"npm run lint --prefix back\"",
"test": "concurrently \"npm run test --prefix front\" \"npm run test --prefix back\"",
"build": "concurrently \"npm run build --prefix front\" \"npm run build --prefix back\""
},The front-end of this project is built using the following technologies:
- React
- TypeScript
- Nextjs
- Axios
- Jest and React Testing Library
The back-end of this project is built using the following technologies:
- Nestjs
- Jest
To run the front-end tests, navigate to the front-end folder and run the following command:
In packages.json :
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"..."
}npm testThis will run the tests using Jest and React Testing Library.
"scripts": {
"build": "next build",
"..."
},npm build"scripts": {
"dev": "next dev",
"..."
}npm run devTo run the backend tests, navigate to the backend folder and run the following command:
npm testThis will run the tests using Jest.
"scripts": {
"...",
"build": "tsc -p tsconfig.json"
},npm build"scripts": {
"start:dev": "nest start --watch",
"..."
}npm run start:dev