A modern, scalable, and extensible Bible microservice built with cutting-edge backend architecture principles.
This project demonstrates Domain-Driven Design (DDD) and Clean Architecture in PHP/Laravel, leveraging MongoDB for persistence and Elasticsearch for powerful text search capabilities — all containerized with Docker.
This project is more than just a Bible API. Its core purpose is to provide historical and theological insights for every Book, Chapter, and Verse of the Bible.
It aims to serve as a foundation for theological study tools, digital commentaries, or educational apps by combining structured Biblical data with historical context and interpretive layers.
- 📚 Historical Context — Offer information about the period, culture, and background for each passage.
- ✝️ Theological Insights — Highlight doctrinal significance, theological themes, and interpretations.
- 🌍 Search & Study — Enable powerful verse-level searches using Elasticsearch, including theological keywords and historical terms.
- 🧠 Structured + Extensible — Build using Domain-Driven Design and Clean Architecture so new features (like commentaries, cross-references, maps, timelines) can be added without breaking the core.
Whether you're a theologian, developer, or researcher, this application provides a modern backend infrastructure for Bible study — with data stored in MongoDB and indexed in Elasticsearch for blazing-fast retrieval.
- ✅ Laravel 11 + PHP 8.4 — Modern backend framework with latest PHP features
- 🧠 DDD + Clean Architecture — Separation of concerns, testability, and scalability
- 🧰 MongoDB — Primary data store for structured Bible content
- 🔍 Elasticsearch — Full-text search (fast lookup of verses and theological references)
- 🐳 Dockerized Environment — Ready-to-run development setup
- 🧪 Seed Data + Indexing — Populate Bible data and sync to Elasticsearch
- 🔌 Extensible Architecture — Add new use cases, domains, or search strategies with ease
The project follows a layered hexagonal architecture:
┌───────────────────────────┐
│ Interface Layer │ ← Controllers, HTTP routes, CLI
├───────────────────────────┤
│ Application Layer │ ← Use Cases (Business rules orchestration)
├───────────────────────────┤
│ Domain Layer │ ← Entities, Value Objects, Repositories (interfaces)
├───────────────────────────┤
│ Infrastructure Layer │ ← MongoDB, Elasticsearch, external services
└───────────────────────────┘
- MongoDB → Source of truth for all structured data
- Elasticsearch → Indexed for blazing-fast verse & text search
- Use Cases mediate between interface and domain layers — no controllers touch the database directly.
git clone https://github.com/your-username/bible-project.git
cd bible-projectcp .env.example .envUpdate .env with MongoDB and Elasticsearch credentials (Docker defaults are provided).
docker-compose up -dThis will start:
- App (Laravel)
- MongoDB
- Elasticsearch
docker exec -it app composer install
docker exec -it app php artisan key:generatedocker exec -it app php artisan db:seed(Optional) Sync seed data to Elasticsearch:
docker exec -it app php artisan search:reindex| Method | Endpoint | Description |
|---|---|---|
| GET | /api/verse/{book}/{chapter}/{verse} |
Get a specific verse from MongoDB |
| GET | /api/search?query=grace |
Full-text search via Elasticsearch |
Example:
curl http://localhost:8000/api/verse/John/3/16app/
├── Domain/
│ └── Bible/
│ ├── Entities/
│ ├── Repositories/
│ └── ValueObjects/
├── Application/
│ └── Bible/
│ └── UseCases/
├── Infrastructure/
│ ├── Persistence/Mongo/
│ └── Search/Elasticsearch/
└── Interfaces/
└── Http/Controllers/
- Entities: Core domain models (e.g., Verse)
- Repositories: Contracts/interfaces for data access
- UseCases: Business logic orchestration
- Infrastructure: Implementation of Repositories, search indexing, etc.
- Interfaces: Controllers, routes, presentation layer
| Layer | Technology |
|---|---|
| Language | PHP 8.4 |
| Framework | Laravel 11 |
| Database | MongoDB |
| Search Engine | Elasticsearch |
| Containerization | Docker + Docker Compose |
| Architecture | DDD + Clean Architecture |
docker exec -it app php artisan testYou can also write domain-level unit tests and use case tests without touching the infrastructure.
- ✅ Add authentication & user-specific study notes
- ✅ Implement advanced search strategies (e.g., fuzzy matching, verse context search)
- ✅ Caching layer for high-traffic endpoints
- ✅ Multilingual Bible versions support
- Fork the repository
- Create a new branch (
feature/add-commentaries) - Commit your changes
- Push to the branch
- Create a Pull Request 🎉
This project is licensed under the MIT License.