- Prerequisites
- Installation
- Setting Up Environment Variables
- Running the PostgreSQL Database
- Running the Backend
- Running the Frontend
- Contributing
- License
Make sure you have the following software installed on your machine:
Clone the repository to your local machine:
git clone https://github.com/ildefonso-nuno/boothbooker-app.git
cd boothbooker-app
Setting Up Environment Variables Create a .env file in the root of the backend directory (server/) and add the following environment variable:
DATABASE_URL="postgresql://<DB_USER>:<DB_PASSWORD>@localhost:5432/eventu-db"
Substitute the DB_USER and DB_PASSWORD by a user and password of your choice
Create a docker-compose.yml file in the root of your project directory and add the following content:
version: '3.8'
services:
db:
image: postgres:latest
container_name: boothbooker-pg
environment:
POSTGRES_DB: boothbooker-db
POSTGRES_USER: <DB_USER>
POSTGRES_PASSWORD: <DB_PASSWORD>
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
Don´t forget to substitute the user and pass of db.
Navigate to the root of your project where you created the docker-compose.yml file and run the following command to start the PostgreSQL database using Docker Compose:
docker-compose up -d
This will start the PostgreSQL database in a Docker container.
Navigate to the backend directory and install the dependencies:
cd server
npm install
Compile the TypeScript code:
npx tsc
Run prisma:
npx prisma migrate dev --name init
npx prisma db seed
Start the Express server:
node dist/src/index.js
The backend should now be running on http://localhost:3000.
Navigate to the frontend directory and install the dependencies:
cd client
npm install
Start the Angular development server:
ng serve
The frontend should now be running on http://localhost:4200.