This project is a Full Stack .NET & Angular application for managing products and categories, designed to run in a Dockerized environment with PostgreSQL, Redis, and PgAdmin.
Ensure you have the following installed on your machine:
- Docker Desktop
- Node.js (for local Angular development, optional)
- Dotnet SDK (for local .NET development, optional)
Follow these steps to set up and run the application using Docker:
git clone https://github.com/mou7866/ProductManagement.git
cd ProductManage
Use Docker Compose to build and start all required services:
docker-compose up --build
This will start the following services:
- API: A .NET 8 Web API for managing products and categories.
- UI: An Angular-based frontend for interacting with the API.
- PostgreSQL: A relational database for storing products and categories.
- Redis: A caching layer (optional).
- PgAdmin: A PostgreSQL administration tool accessible via a web interface.
Once all containers are up and running, you can access the different services at the following URLs:
- Angular UI: http://localhost:4200
- Swagger API Documentation: http://localhost:5000/swagger
- PgAdmin: http://localhost:8080
- Default Email:
[email protected]
- Default Password:
admin
- Default Email:
The application uses the following environment variables, defined in docker-compose.yml
:
Variable | Description |
---|---|
ASPNETCORE_ENVIRONMENT |
Sets the environment (Development/Production). |
ConnectionStrings__DefaultConnection |
Connection string for PostgreSQL. |
Variable | Description |
---|---|
PGADMIN_DEFAULT_EMAIL |
Default login email for PgAdmin. |
PGADMIN_DEFAULT_PASSWORD |
Default login password for PgAdmin. |
The PostgreSQL container automatically creates the database ProductManagementDB
. If you need to modify or manually set up the database schema, you can use the included Liquibase migrations.
To manually apply database migrations using Liquibase:
docker-compose run liquibase update
To stop all running containers:
docker-compose down
This will stop and remove all containers.
-
Port Already in Use
If you encounter port conflicts, make sure no other applications are using ports 5000, 5001, 4200, 5435, or 8080. -
Database Connection Issues
Ensure the PostgreSQL container is running and that the connection string indocker-compose.yml
is correct. -
Swagger Not Accessible
Check the API container logs using:docker-compose logs api
- Add role-based access control (RBAC) for user management.
- Implement product import/export functionality.
- Add unit and integration tests for better code coverage.
- Mohammed Yusuf Essa – GitHub Profile