This is the backend for the TechScribe project. The application is built using Node.js, Express, and PostgreSQL. Below are the steps to set up the project using Docker.
npm i --force
npm run start
set env to
DATABASE_URL
: Your PostgreSQL connection string.ACCESS_TOKEN_SECRET
: A secret key for session management.
Docker installed on your system.
PostgreSQL database URL.
Before running the application, ensure that the following environment variables are set up:
DATABASE_URL
: Your PostgreSQL connection string.ACCESS_TOKEN_SECRET
: A secret key for session management.Clone the Repository
git clone https://github.com/your-username/backend.git
- Replace `your-username` with your GitHub username.
cd backend
.env
FileIn the project root directory, create a .env
file with the following content:
DATABASE_URL=postgresql://<username>:<password>@<host>/<database>?sslmode=require
ACCESS_TOKEN_SECRET=<your-session-secret>
Replace <username>
, <password>
, <host>
, <database>
, and <your-session-secret>
with your actual PostgreSQL credentials and a secure session secret.
Run the following command to build the Docker image:
docker build -t techscribe-backend .
Use the following command to start the container and pass the environment variables:
docker run -p 8000:8000 --env-file .env techscribe-backend
This will map port 8000
from the container to your local machine, making the application accessible at http://localhost:8000
.
If you need to run Prisma migrations manually, use the following steps:
Find your container ID:
docker ps
Run the migration command:
docker exec -it <container-id> npx prisma migrate deploy
Replace <container-id>
with the ID of your running container.
To make changes to the project:
docker build -t techscribe-backend .
docker run -p 8000:8000 --env-file .env techscribe-backend
If you encounter any issues, please check the following:
.env
file are set correctly.docker logs <container-id>
Welcome to HACKTOBERFEST 2024 Go through CONTRIBUTING && CODE OF CONDUCT Happy Coding!!