CareSync is a high-performance RESTful backend for healthcare orchestration, real-time doctor-patient consultation, tele-vitals tracking, and secure payment processing.
graph TD
Client["Angular Frontend SPA"] -->|HTTPS REST API| Gateway["Spring Security & JWT Filter"]
Client -->|WSS SockJS/STOMP| WSBroker["Spring WebSocket Broker"]
Gateway --> Controllers["REST Controllers"]
Controllers --> AppService["Appointment Service"]
Controllers --> PayService["Payment Service"]
Controllers --> ChatController["Chat Controller"]
Controllers --> AIService["AI Assistance Service"]
AppService <-->|Spring Cache| Redis[("Redis Cache")]
PayService <--> Redis
AppService -->|Pessimistic Locking| DB[("PostgreSQL DB")]
PayService -->|Semaphore Rate Limiter| Razorpay["Razorpay Gateway"]
PayService -->|Pessimistic Locking| DB
AppService -->|AfterCommit Task Dispatcher| AsyncExecutor["Task Executor Thread Pool"]
WSBroker -->|Broadcast to Topic| Client
ChatController -->|Save Messages| ChatRepo["Chat Repository"]
ChatRepo --> DB
- ⚡ High Concurrency & Locking:
PESSIMISTIC_WRITElocks &Semaphorerate-limiting prevent double-booking & race conditions. - 💬 Real-Time Doctor-Patient Chat: STOMP over SockJS (
/ws) with auto-cleanup upon appointment completion. - 💳 Secure Payment Processing: Razorpay gateway integration with idempotent webhook callbacks & duplicate payment guards.
- 🧠 AI-Powered Diagnostics: Google Gemini & OpenAI integration for automated medical history summarization and symptom analysis.
- 🚀 Multi-Tier Caching: Redis caching with automated fallback to PostgreSQL if Redis is unavailable.
- 🔐 Field-Level Encryption: AES encryption (
EncryptionConverter) for sensitive medical notes and records.
| Category | Technology |
|---|---|
| Core Framework | Spring Boot 3.5, Java 21 |
| Database | PostgreSQL 16 (JPA / Hibernate) |
| Caching | Redis (Lettuce Client) |
| Real-Time Communication | Spring WebSocket, STOMP, SockJS |
| Security | Spring Security 6, JWT, AES Encryption |
| Integrations | Razorpay SDK, Google Gemini / OpenAI |
| Documentation | OpenAPI / Swagger UI |
- 📐 System Architecture Deep-Dive
- 🧪 Java Concurrency Learning Lab
- 🗄️ Database ERD Diagram
- 🌐 Live Swagger API UI
# Clone the repository
git clone https://github.com/vikrant48/careSync.git
cd careSync
# Run backend locally
./mvnw spring-boot:run