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.
Implemented modules:
- Directory & Search
- Authentication & Roles
- Dynamic Advertisement
Planned scope and module checklist lives in docs/PROJECT_STATUS.md.
- 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
- 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
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
- Java 21+
- Maven 3.10.0+
- Docker & Docker Compose (recommended)
Start the complete stack with one command:
docker-compose up --buildServices will be available at:
- Backend API: http://localhost:6700
- API Documentation: http://localhost:6700/swagger-ui.html
- Keycloak Admin: http://localhost:8080 (admin/admin)
- MinIO Console: http://localhost:9001 (minioadmin/minioadmin123)
-
Clone the repository:
git clone https://github.com/Cipher-Text/open-care-backend.git cd open-care-backend -
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Build and run:
mvn clean package java -jar target/open-care-backend-0.0.1-SNAPSHOT.jar
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- Liquibase automatically runs migrations on startup
- Initial data is seeded for locations, medical specialties, and sample entities
- Manual migration:
mvn liquibase:update
mvn clean packagemvn testmvn liquibase:updateWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for full guidelines.
- Follow Java coding conventions
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License. See the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: API Docs
- Email: imran110219@gmail.com
- 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