This is the main repository for the OTP Bud application, which consists of a backend server and a frontend client. The backend is built with NestJS and Prisma, while the frontend is built with React and Vite.
backend/: Contains the NestJS backend server code.frontend/: Contains the React frontend client code.
- Backend Setup: backend/README.md
- Frontend Setup: frontend/README.md
To run the application in development with Docker, follow these steps:
- Configure Environment Variables: Create a
.envfile in the root of the project based on the provided.env.examplefile. Make sure to set the correct values for your database and JWT secret. - Start Services with Docker Compose: Use the following command to start the database and Redis services:
This will start PostgreSQL and Redis services. You'll need to run the backend and frontend locally.
docker-compose -f dev.docker-compose.yml up -d
- Stop the Services: To stop the running services, use:
docker-compose -f dev.docker-compose.yml down
To build and run the application for production:
- Configure Environment Variables: Create a
.envfile with production values. - Build and Run with Docker Compose: Use the following command to build and start the application:
This will build and start both the backend and frontend services, along with a PostgreSQL database.
docker-compose -f prod.docker-compose.yml up --build
- Access the Application: Once the services are up and running, access the frontend at
http://localhost:3000and the backend API athttp://localhost:4000. - Stop the Services: To stop the running services, use:
docker-compose -f prod.docker-compose.yml down
- Ensure that you have Docker and Docker Compose installed on your machine.
- The
.envfile should not be committed to version control as it contains sensitive information. - You can find a
.env.examplefile in the root of the project to use as a template for your environment variables.