This comprehensive repository serves as a solid foundation for building powerful web applications using Express.js and Next.js frameworks. We have included a complete setup for end-to-end tests so you can get started with tests quickly. Additionally, the entire application is containerized with Docker for seamless deployment and scalability.
If you find this repository helpful, don't forget to star it!
If you want to contribute to this project or make changes, you can fork the repository. Follow the steps below to fork and contribute:
-
Click on the "Fork" button on the top-right corner of this repository page. This will create a copy of the repository under your GitHub account.
-
Clone the forked repository to your local machine:
git clone git@github.com:hironate/express-js-next-js-docker-monorepo.git
Make sure you have the following software installed on your machine:
- Docker
- Docker Compose
- Node.js
-
Navigate to the
devops
directory:cd express-js-next-js-docker-monorepo/devops
-
Make the
init-database.sh
script executable:chmod +x init-database.sh
-
Build and start the containers using Docker Compose:
docker compose up
This command will spin up the backend and frontend services along with the PostgreSQL database. The backend will be accessible at
http://localhost:3000
, and the frontend will be accessible athttp://localhost:3001
. The PostgreSQL database will be running onlocalhost
on port5432
.
To access the PostgreSQL database, you can use tools like pgAdmin. Follow the steps below:
- Open pgAdmin.
- Set the following credentials:
- Host:
localhost
- Database:
monorepodb
- User:
monorepo_user
- Password:
monorepo-password
- Port:
5432
- Host:
To run the backend tests in the "backend" directory, follow the steps below:
-
Open a terminal or command prompt.
-
Navigate to the "backend" directory of the monorepo:
cd express-js-next-js-docker-monorepo/backend
-
Run the following command to execute the backend tests:
npm run test:local
This command will run the tests and display the test results in the terminal or command prompt.
To contribute to this project, please follow these guidelines:
- Fork the repository and make your changes in a new branch.
- Ensure that your code is well-documented and follows the existing coding style.
- Write clear commit messages for your changes.
- Make sure all tests pass successfully.
- Open a pull request with a detailed description of your changes.
- Hiren Kavad
- This project is co-authored by Hiren Kavad. You can find more information about the author on their website: hirenkavad.com.
- Yatharth Andhariya
- Docker for containerization.
- Docker Compose for multi-container application orchestration.
This project is licensed under the MIT License.