Skip to content

Cipher-Text/open-care-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

491 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenCare Backend

OpenCare Backend is a Spring Boot-based healthcare management platform focused on the Bangladeshi healthcare sector. It provides a REST API foundation for search, authentication, and role-based access with room for future modules.


βœ… Current Status

Implemented modules:

  • Directory & Search
  • Authentication & Roles
  • Dynamic Advertisement

Planned scope and module checklist lives in docs/PROJECT_STATUS.md.


πŸ›  Tech Stack

  • Java 21 with Spring Boot 3.4.3
  • PostgreSQL for primary database
  • Keycloak for authentication & authorization
  • MinIO for S3-compatible object storage
  • Liquibase for database migrations
  • Caffeine for caching
  • Elasticsearch for hospital search
  • MapStruct & Lombok for clean code
  • SpringDoc OpenAPI for API documentation
  • Docker & Docker Compose for containerization

πŸ“š Documentation

  • Project status and roadmap: docs/PROJECT_STATUS.md
  • Architecture overview: docs/ARCHITECTURE.md
  • Testing guide: docs/TESTING.md
  • Database schema: docs/DATABASE.md
  • Permissions reference: docs/PERMISSIONS.md
  • Dashboard API guidelines: docs/DASHBOARD.md
  • AI policy and guidance: docs/ai/AI_POLICY.md, docs/ai/AI_CONTEXT.md, docs/ai/AI_BACKEND.md
  • Swagger UI: http://localhost:6700/swagger-ui.html

πŸ— Architecture & Directory Structure

src/
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ java/com/ciphertext/opencarebackend/
β”‚   β”‚   β”œβ”€β”€ controller/      # REST API controllers
β”‚   β”‚   β”œβ”€β”€ service/         # Business logic layer
β”‚   β”‚   β”œβ”€β”€ entity/          # JPA entities
β”‚   β”‚   β”œβ”€β”€ dto/             # Data transfer objects
β”‚   β”‚   β”œβ”€β”€ mapper/          # MapStruct mappers
β”‚   β”‚   β”œβ”€β”€ config/          # Configuration classes
β”‚   β”‚   β”œβ”€β”€ repository/      # Data access layer
β”‚   β”‚   └── exception/       # Custom exceptions
β”‚   └── resources/
β”‚       β”œβ”€β”€ application.yml  # Main configuration
β”‚       └── db/changelog/    # Liquibase migrations
└── test/                    # Test suites

πŸš€ Quick Start

Prerequisites

  • Java 21+
  • Maven 3.10.0+
  • Docker & Docker Compose (recommended)

Running with Docker Compose (Recommended)

Start the complete stack with one command:

docker-compose up --build

Services will be available at:

Running Locally (Development)

  1. Clone the repository:

    git clone https://github.com/Cipher-Text/open-care-backend.git
    cd open-care-backend
  2. Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
  3. Build and run:

    mvn clean package
    java -jar target/open-care-backend-0.0.1-SNAPSHOT.jar

βš™οΈ Configuration

Environment Variables

Key configuration options (see application.yml for full list):

# Database
DB_HOSTNAME=localhost
DB_PORT=5432
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=12345678

# Keycloak
KEYCLOAK_SERVER_URL=http://localhost:8080
KEYCLOAK_REALM=opencare
KEYCLOAK_CLIENT_ID=open-care-backend
KEYCLOAK_CLIENT_SECRET=your-secret

# MinIO
MINIO_ENDPOINT=http://localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin123
MINIO_BUCKET_NAME=opencare

# Elasticsearch
ELASTICSEARCH_URIS=http://localhost:9200
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=elastic

# Cache
CACHE_TTL=30m
CACHE_MAX_SIZE=500

# Application
SERVER_PORT=6700
RATE_LIMITING_ENABLED=true
RATE_LIMITING_LIMIT=100

πŸ—„ Database & Migrations

  • Liquibase automatically runs migrations on startup
  • Initial data is seeded for locations, medical specialties, and sample entities
  • Manual migration: mvn liquibase:update

πŸ”§ Development

Building the Project

mvn clean package

Running Tests

mvn test

Database Migration

mvn liquibase:update

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for full guidelines.

Development Guidelines

  • Follow Java coding conventions
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


πŸ†˜ Support


πŸ™ Acknowledgments

  • Spring Boot team for the excellent framework
  • Keycloak community for authentication solutions
  • MinIO team for object storage
  • All contributors and supporters of the OpenCare project

docker run --name open-care-backend-dev -p 6700:6700 --restart always
--env SPRING_PROFILES_ACTIVE=dev
--env-file /home/ubuntu/open-care-backend/.env.dev
imran110219/open-care-backend:dev-latest

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published