ASP.NET Core REST API powering the eLab medical laboratory management platform — handling authentication, lab test bookings, results, payments, AI analysis, and multi-branch management.
- JWT Authentication — Secure login for patients, staff, and admins with role-based access control
- Patient Management — Full patient profiles with medical history, emergency contacts, and insurance info
- Test Catalog — Manage laboratory tests by category, sample type, and turnaround time
- Appointment Booking — Multi-branch booking system with time slot management
- Results Management — Upload, approve, and deliver lab results to patients
- Stripe Payments — Online payment integration with multi-currency support (USD / ILS)
- AI Analysis — AI-powered result interpretation chat sessions per patient
- Offers & Pricing — Discount management across branches and test categories
- Report Templates — Customizable result report templates
- Reference Ranges — Define normal value ranges per test for automated flagging
- Multi-Branch Support — Manage multiple lab branches with independent staff and scheduling
- Real-time Notifications — Alert patients on booking and result updates
- Staff & Admin Portals — Dedicated role-specific endpoints
| Technology | Purpose |
|---|---|
| ASP.NET Core 9 | Web API framework |
| C# | Language |
| Entity Framework Core | ORM / Database access |
| SQL Server | Database |
| JWT Bearer | Authentication |
| Stripe.NET | Payment processing |
| Clean Architecture | Project structure pattern |
eLab/
├── eLab.PL/ # Presentation Layer — Controllers, API endpoints
├── eLab.BLL/ # Business Logic Layer — Services, DTOs
├── eLab.DAL/ # Data Access Layer — Entities, Repositories, DbContext
└── eLab.sln # Solution file
- .NET 9 SDK
- SQL Server (local or remote)
- Visual Studio 2022+ or VS Code
# Clone the repo
git clone https://github.com/mohz7/elab-backend.git
cd elab-backendOpen eLab.sln in Visual Studio, then:
- Update
appsettings.jsonwith your database connection string and API keys - Run migrations to set up the database:
cd eLab.DAL
dotnet ef database update- Run the project:
cd eLab.PL
dotnet runThe API will be available at https://localhost:7000 (or as configured).
{
"ConnectionStrings": {
"DefaultConnection": "Server=.;Database=eLabDB;Trusted_Connection=True;"
},
"JWT": {
"Key": "your_jwt_secret_key",
"Issuer": "eLab",
"Audience": "eLab"
},
"Stripe": {
"SecretKey": "your_stripe_secret_key"
}
}
⚠️ Never commit real API keys to GitHub. Use environment variables or user secrets in production.
| Group | Endpoints |
|---|---|
| Auth | Register, Login, Forgot Password |
| Patients | Profile, Medical History, Bookings, Results |
| Tests | Catalog, Categories, Prices, Offers |
| Bookings | Create, View, Update Status |
| Results | Upload, Approve, View by Patient |
| Payments | Stripe Checkout, Payment Status |
| AI | Create Session, Send Message, Get History |
| Admin | Users, Staff, Branches, Templates, Ranges |
| Notifications | Send, Mark as Read |
| Role | Description |
|---|---|
| Patient | Book tests, view results, use AI analysis, pay online |
| Staff | Manage bookings, upload results, access patient profiles |
| Admin | Full system control — all of the above plus catalog, pricing, staff, and branch management |
- eLab Frontend — React web application