This is a .NET 9 Web API for managing a clinic's appointments and users, built with RESTful endpoints and JWT authentication.
-
GET /Slots/doctors/{docId}/slots
Get available appointment slots for a specific doctor. -
POST /Slots/book
Book an appointment slot. -
DELETE /Slots/{id}
Delete an appointment slot by ID. -
GET /Slots/{id}/slotinfo
Get detailed information about a specific slot.
-
GET /user
Retrieve a list of all users. -
GET /user/doctors/{id}
Get information about a specific doctor. -
POST /users/register
Register a new user (patient or doctor). -
POST /users/login
Authenticate and obtain a JWT token for secure access.
- The API uses JWT (JSON Web Token) for secure user authentication.
- After login, use the token in the
Authorizationheader asBearer {token}.
- .NET 9
- ASP.NET Core Web API
- Entity Framework Core (with SQLite or any relational DB)
- JWT Authentication
- Docker-ready (for deployment)
- A
Dockerfileis included to containerize the API. - To build and run:
docker build -t clinic-api . docker run -p 5000:5000 clinic-api
- Update your connection strings if using SQLite with Docker volume.
ClinicAPI/
├── Controllers/
│ ├── SlotsController.cs
│ └── UsersController.cs
├── Authorization/
├── Dtos/
| ├── Users
| └── FilterParams
├── Entities
├── Services
├── Helpers
├── Program.cs
├── Startup.cs
├── appsettings.json
├── Dockerfile
└── README.md
| Module | Endpoint | Method |
|---|---|---|
| Slots | /Slots/doctors/{docId}/slots | GET |
| /Slots/book | POST | |
| /Slots/{id} | DELETE | |
| /Slots/{id}/slotinfo | GET | |
| Users | /user | GET |
| /user/doctors/{id} | GET | |
| /users/register | POST | |
| /users/login | POST |
-
Clone the repo
git clone https://github.com/yourusername/clinic-api.git cd clinic-api -
Restore dependencies
dotnet restore
-
Run the app
dotnet run
-
Use Postman or Swagger to test the API endpoints.
- This project is a work in progress; feel free to contribute!
- Supports Docker for easy deployment and SQLite for lightweight DB.
This project is licensed under the MIT License.
Enjoy managing your clinic with this lightweight API! 😊