This guide provides step-by-step instructions to run the Food Delivery Modular Monolith application.
Ensure you have the following installed on your machine:
- Docker Desktop: Required to run the infrastructure services (Postgres, MongoDB, RabbitMQ).
- .NET 8.0 SDK: Required to build and run the API application.
The application relies on several external services. We use Docker Compose to spin them up.
-
Open a terminal (PowerShell, Command Prompt, or Git Bash).
-
Navigate to the
deployments/docker-composedirectory:cd deployments/docker-compose -
Start the containers in detached mode:
First, copy the sample environment file:
cp .env.sample .env
Then start the services:
docker-compose -f docker-compose.infrastructure.yaml up -d
Wait for a few moments for all containers (Postgres, RabbitMQ, MongoDB, etc.) to start and become ready.
-
Open a new terminal window or navigate back to the root of the repository:
cd ../.. -
Run the API project using the .NET CLI:
dotnet run --project src/Api/FoodDelivery.Api/FoodDelivery.Api.csproj
Alternatively, if you are using Visual Studio:
- Open
food-delivery-modular-monolith.sln. - Set
FoodDelivery.Apias the Startup Project. - Press
F5or click "Start Debugging".
- Open
Once the application is running, you can access it at:
- API Root: http://localhost:5000 (Returns a welcome message)
- Swagger UI: http://localhost:5000/swagger (Interactive API documentation)
- Port Conflicts: Ensure ports
5432(Postgres),27017(Mongo),5672(RabbitMQ), and5000(API) are not being used by other applications. - Database Connection Issues: If the application fails to connect to the database, verify that the Docker containers are running using
docker ps.