express apis backend
DoctorCare API is a secure, layered RESTful backend API for the Doctor Appointment Booking System. It is built with Node.js, Express, TypeScript, Drizzle ORM, and MySQL, and provides the core services required by both Doctor and Patient applications.
The API follows a modular architecture with separate routes, controllers, services, database/repository layers, validation, authentication, and shared utilities, providing a maintainable foundation for the frontend application.
Key API Capabilities
Authentication & Authorization
User authentication
JWT access-token authentication
Refresh-token based session renewal
Role-based Doctor and Patient access
User & Profile Management
Current-user profile retrieval
Profile updates
Account status and role information
Doctor Management
Doctor profiles
Specializations
Doctor availability
Effective-date-based availability management
Doctor leave management
Appointment Management
Appointment booking
Doctor and patient appointment views
Appointment status management
Appointment history and logs
Prescription Management
Prescription creation
Doctor prescription management
Patient prescription history
Database & Data Integrity
MySQL relational database
Drizzle ORM
Transaction-based operations
Structured validation and error handling
API Documentation
Interactive Swagger/OpenAPI documentation
Request and response examples
Authentication-aware API testing
Endpoint-level schemas and parameters
Architecture
Client / React Application
↓
REST API
↓
Express
↓
Authentication
↓
Routes
↓
Controllers
↓
Services
↓
Database Layer
↓
Drizzle ORM
↓
MySQL
The API is designed so that the frontend remains independent of the database implementation and communicates through well-defined REST endpoints.