The backend of this project is built using .NET Core with Entity Framework Core for database management and ASP.NET Identity for authentication. It provides APIs to handle user authentication, patient health issue submissions, assignment to health professionals, and recommendation management.
- .NET Core
- Entity Framework Core (EF Core)
- ASP.NET Identity
- SQL Server
- Swagger for API documentation
- JWT Authentication
Ensure you have the following installed:
- .NET SDK (latest stable version) - Download here
- SQL Server (Express or any edition) - Download here
- Visual Studio or VS Code (with C# extensions)
- Postman (for API testing, optional)
-
Clone the repository:
git clone <repository_url> cd <backend-folder>
-
Set up environment variables:
- Copy
appsettings.example.json
and rename it toappsettings.json
. - Configure your database connection string under
ConnectionStrings
.
- Copy
-
Restore dependencies:
dotnet restore
-
Apply database migrations:
dotnet ef database update
-
Run the application:
dotnet run
-
Access Swagger API documentation:
- Open your browser and navigate to
https://localhost:<port>/swagger/index.html
- Open your browser and navigate to
- POST
/api/auth/register
→ Register a new user - POST
/api/auth/login
→ Login and receive JWT token
- POST
/api/patient/submit-issue
→ Submit a health issue - GET
/api/patient/issues
→ Get list of submitted issues
- GET
/api/admin/issues
→ Get all patient health issues - POST
/api/admin/assign
→ Assign health issue to a professional
- GET
/api/professional/issues
→ View assigned issues - POST
/api/professional/recommend
→ Submit recommendations
- A patient submits a health issue.
- The admin sees the issue on their dashboard and assigns it to a health professional.
- The health professional reviews the issue and provides a recommendation.
- The recommendation is sent back to the patient for review.
During implementation, there was an issue where submitted data was not appearing in the respective dashboards. Possible reasons:
- Missing proper entity relationships in the database.
- Issues with Eager vs Lazy loading in EF Core.
- Queries not properly filtering assigned issues.
- Debugging might require adding explicit
Include()
statements for related entities in queries.
A suggested fix is to review queries used in controllers to ensure they correctly retrieve related data and update the API endpoints accordingly.
- Build the application:
dotnet publish -c Release -o out
This documentation provides a guide to setting up and running the backend, explains the API workflow, and highlights the data issue encountered. Further improvements can be made by debugging queries and ensuring proper data retrieval for dashboards.