A monorepo setup using NestJS for the backend, Vite for the frontend, and Docker for containerization.
This repository uses workspaces. You can install a package to the workspace with the following command
npm install <package-name> -w <workspace-name>
example:
npm install <package-name> -w api
npm install <package-name> -w client
/project-root
├── apps
│ ├── api # NestJS backend application
│ │ ├── src
│ │ ├── test
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── ...
│ └── client # Vite frontend application
│ ├── src
│ ├── public
│ ├── Dockerfile
│ ├── README.md
│ └── ...
├── .gitignore
├── docker-compose.yml
├── Dockerfile
└── package.json
- Node.js: Ensure that Node.js is installed on your machine.
- Docker: Docker is required for building and running the application in containers.
- Clone the repository:
git clone https://github.com/chanoto89/fullstack-boilerplate.git cd fullstack-boilerplate
- Install Dependencies:
npm install
- Build Docker Images:
docker-compose build
- Run with Docker:
docker-compose up -d
- Connect from command line
To connect to the running postgres database from your local machine, you can use the following command
docker-compose exec postgres psql -U user -W db
- Enter Password When prompted, enter "password" as the password
-
Build Docker Image
To build the Docker image, run the following command in the root of your project:
docker build -t your-app-name .
This command will create a Docker image named your-app-name using the Dockerfile in the root of your project.
-
Running the Docker Container
To run the application inside a Docker container, use the following command:
docker run -p 3000:3000 your-app-name
This will start the application, exposing it on port 3000.
Contributions are welcome! To contribute to this monorepo, follow these steps:
- Fork the repository: Click the "Fork" button at the top right of the repository page.
- Clone your fork:
git clone https://github.com/chanoto89/fullstack-boilerplate.git
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes: Develop your feature or fix the bug.
- Commit your changes:
git add . git commit -m "Add a meaningful commit message"
- Push to your branch:
git push origin feature/your-feature-name
- Submit a pull request: Go to the original repository on GitHub and create a pull request from your forked repository.
This project is licensed under the MIT License. See the LICENSE file for more details.