This project is a Pnpm Workspace powered by Nx. The Workspace consists of:
- UI:
./el-marchi-uicontaining an Angular 19 Standalone App with SSG (Server Side Generation) support, Esbuild as a bundler, Cypress as a test suite, CSS and Tailwind for styles, and support for reactive programming using Rx.js. - API:
./el-marchi-apiNestjs 10 Server based on the Express Platform, TypeORM as ORM, and Passport as an Auth Middleware.
- Node.js (based on typescript version, recommend 18.x or higher)
- PNPM
- Docker
- Go to
.\el-marchi-ui, run this command:pnpm i: this will install all the necessary packages. - Go to
.\el-marchi-api, run this command:pnpm i: this will install all the necessary packages. - Add
.envfiles using the.env.dev/prod.examplefiles as a reference to the env file content. - Follow the How to use guides below to understand how to run each one.
-
To Run the UI:
- Run the API first.
- Once the API is up and running, run these commands:
-
Dev Mode:
cd el-marchi-ui pnpm start -
Prod Mode:
cd el-marchi-ui pnpm build:prod pnpm start:prod
-
-
To Run the UI Tests:
cd el-marchi-ui # for end to end testing pnpm e2e # for unit testing pnpm test
-
To Lint the UI:
cd el-marchi-ui pnpm lint -
To Format the UI:
cd el-marchi-ui pnpm format
-
To Run the API:
-
Open a separate terminal, go to the
./dockerdirectory, and then run the command:docker compose up
-
Once the Docker containers are up and running, run these commands:
-
Dev Mode:
pnpm start
-
Prod Mode:
pnpm build:prod && pnpm start:prod
-
-
-
To Run the API Tests:
pnpm e2e
-
To Lint the API:
pnpm lint
-
To Format the API:
pnpm format
This project includes a Docker Compose setup. Docker Compose is used to manage the database and pgAdmin services, ensuring the API has a ready-to-use PostgreSQL environment with a web-based admin interface.
The setup includes the following services:
-
Database Service:
- Image:
postgres:17.2-alpine3.21 - Exposes PostgreSQL on port
5432. - Configured with:
- Database:
ElMarchi - User:
admin - Password:
password
- Database:
- Uses a persistent volume (
postgres_data) to store data.
- Image:
-
pgAdmin Service:
- Image:
dpage/pgadmin4:8.14.0 - Exposes the pgAdmin web interface on port
5050. - Configured with default credentials:
- Email:
admin@admin.com - Password:
admin
- Email:
- Depends on the database service to ensure the database is running first.
- Image:
-
Volume:
postgres_data: Stores the PostgreSQL database data persistently.
-
Navigate to the
./dockerdirectory:cd ./docker -
Start the services:
docker compose up
To stop and remove the running containers:
docker compose downIf you want to remove the persistent volume data:
docker volume rm postgres_data-
Port Conflicts:
If you encounter a port conflict, update theportssection indocker-compose.yml.
Example: Change5050:80to6060:80. -
Database Connection Issues:
Ensure the database service is running by checking the containers with:docker ps
-
Reset pgAdmin Credentials:
If you forget the pgAdmin credentials, update them in thedocker-compose.ymlfile and restart the containers.