A secure, high-performance web-based medical scheduling platform built in C++ using the Crow framework. The system allows patients to browse doctors by specialty, check real-time availability, and book or cancel appointments efficiently while ensuring strong security and database integrity.
Author: Ahtesham Latif
GitHub: https://github.com/Ahtesham-Latif
Browse doctors categorized by medical specialties such as: - Cardiologist - Dentist - Dermatologist - General Physician
Each doctor profile displays scheduling information and available appointment slots.
Patients can: - View available appointment slots - Book appointments instantly - Cancel existing bookings
The system includes automatic double-booking protection.
Database IDs are never exposed in URLs.
Instead the system uses: - Session storage - Server-side context validation
This prevents IDOR (Insecure Direct Object Reference) attacks where users manipulate IDs in URLs.
The system integrates with n8n automation workflows.
After a successful booking or cancellation: 1. The backend triggers a webhook 2. n8n sends the confirmation email 3. The request runs in a background thread
This ensures the user sees the confirmation page immediately.
The database schema uses a composite unique constraint:
(doctor_id, slot_id, appointment_date)
This ensures: - No double booking - Same slot can exist on different days - Database-level scheduling validation
Frontend improvements include: - Skeleton loaders while data loads - Elimination of empty white screens - Improved perceived performance
- Backend Framework: Crow (C++17)
- Database: SQLite3
- Security: OpenSSL (TLS/SSL)
- Templates: Mustache HTML
- Automation: n8n Webhooks
- Build System: CMake
- Platform: Cross-platform (Windows, Linux, macOS)
The system follows an MVC (Model-View-Controller) architecture.
Represent core entities: - Doctor - Patient - Appointment - Schedule - Category
Handle business logic such as: - Doctor lookup - Slot availability - Appointment booking - Appointment cancellation
Frontend HTML pages served by the Crow server.
Examples: - category.html - doctor.html - appointment.html - confirmation.html - cancellation.html
Utility modules for: - Helper functions - HTTP requests - Notification triggers
crow_backend/ βββ config/ # Configuration files βββ controllers/ # MVC controllers βββ models/ # Data structures βββ services/ # Utility services βββ routes/ # API route definitions βββ public/ # Frontend HTML/CSS βββ db/ # SQLite database βββ Crow/ # Crow framework source βββ httplib/ # HTTP client library βββ CMakeLists.txt # Build configuration βββ main.cpp # Application entry point
All traffic is encrypted using OpenSSL.
Sensitive database IDs are never exposed in URLs.
Composite unique constraint prevents duplicate bookings.
All endpoints validate user input to prevent invalid requests.
- C++17 compiler (GCC 7+, Clang 5+, MSVC 2017+)
- CMake 3.15+
- SQLite3
- OpenSSL
Windows additional libraries: - ws2_32 - mswsock
git clone https://github.com/Ahtesham-Latif/crow_server.git cd crow_server
Place the following files in the project directory:
cert.pem key.pem
mkdir build cd build cmake .. make
./server
Server runs at:
Endpoint Description
/categories List medical specialties /doctors View doctors by category /schedule View doctor availability /appointments Book appointment /cancel Cancel appointment /patients Manage patient records
The backend triggers webhooks to n8n for: - Appointment confirmations - Cancellation notifications - Reminder emails
Webhook URLs are stored as environment variables.
MIT License
Ahtesham Latif
GitHub: https://github.com/Ahtesham-Latif
Last Updated: March 2026