This project contains the backend for the SmartLocate application and uses the microservice architecture.
It is built primarily using ASP.NET Core 8, MongoDB and Dapr.
- .NET 8.0 SDK
- Docker
- Dapr CLI
- MongoDB
aspire
Workload
- Clone this repository.
- Ensure that you have Dapr initialized in your machine and if not, run the following command in your terminal:
dapr init
- Ensure that you have MongoDB running in your machine and if not, run the following command in your terminal:
By default, the application uses the same database (
docker run -d -p 27017:27017 mongo
mongodb://localhost:27017/SmartLocate
) for all the microservices. If you want to use different databases for each microservice, you can change the connection string in theappsettings.json
file of each microservice. - To run the microservices, you need to run the
aspire
workload. To do so, run the following command in your terminal:dotnet workload install aspire
- Open the
SmartLocate.sln
solution file in Visual Studio or JetBrains Rider to open the solution. - Build and run the SmartLocate.Aspire/SmartLocate.AppHost project to run all the microservices. For more information, refer to the README.md file of the project.
The microservices, API Gateway and the Dapr sidecars are orchestrated using the SmartLocate.Aspire/SmartLocate.AppHost project using .NET Aspire.
For more information, refer to the README.md file of the project.
The API Gateway is built using the Ocelot library and runs at http://localhost:7000
.
For more information, refer to the README.md file of the project.
The backend is built using the microservice architecture. The following are the microservices that are used in the application:
- SmartLocate.Buses -
http://localhost:7001
- SmartLocate.BusRoutes -
http://localhost:7002
- SmartLocate.Students -
http://localhost:7003
- SmartLocate.Identity -
http://localhost:7004
- SmartLocate.BusDrivers -
http://localhost:7005
- SmartLocate.Admin -
http://localhost:7006
- SmartLocate.Infrastructure -
http://localhost:7050