Skip to content

Repository files navigation

CareSync - Healthcare Management Platform Backend

Java Spring Boot PostgreSQL Redis Docker

CareSync is a high-performance RESTful backend for healthcare orchestration, real-time doctor-patient consultation, tele-vitals tracking, and secure payment processing.


🏛️ System Architecture

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
Loading

✨ Key Highlights

  • High Concurrency & Locking: PESSIMISTIC_WRITE locks & Semaphore rate-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.

🛠️ Tech Stack

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

📖 Documentation & Links


⚡ Quick Start

# Clone the repository
git clone https://github.com/vikrant48/careSync.git
cd careSync

# Run backend locally
./mvnw spring-boot:run

About

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages