A robust REST API implementation that handles structured JSON data with advanced features including Elasticsearch integration, message queuing, and security mechanisms.
- CRUD Operations: Full support for Create, Read, Update, and Delete operations
- JSON Schema Validation: Incoming payloads are validated against defined JSON schemas
- Conditional Operations:
- Conditional read support using ETags
- Optimistic concurrency control
- PATCH Support: Partial updates with merge capabilities
- Structured Data Handling: Flexible handling of any structured JSON data
- Elasticsearch Integration:
- Parent-Child relationship indexing
- Advanced search capabilities
- Document mapping and indexing
- Message Queuing:
- Asynchronous processing with RabbitMQ
- Event-driven architecture
- Producer-Consumer pattern implementation
- Security:
- Bearer token authentication
- Request validation
- Key-Value Store: Redis-based storage for high-performance data access
- Elasticsearch: Advanced search and indexing capabilities
- Backend Framework: Django with Django REST Framework
- Primary Database: Redis for high-performance key-value storage
- Search Engine: Elasticsearch
- Message Queue: RabbitMQ
- Authentication: Bearer token authentication
- Containerization: Docker & Docker Compose
- API Documentation: OpenAPI/Swagger
- Python 3.x
- Docker and Docker Compose
- Redis
- Elasticsearch
- RabbitMQ
- Clone the repository:
git clone <repository-url>
cd <repository-name>- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Install dependencies:
pipenv install- Start the services using Docker Compose:
docker-compose up -dGET /api/plans/- List all plansPOST /api/plans/- Create a new planGET /api/plans/{id}/- Retrieve a specific planPATCH /api/plans/{id}/- Update a planDELETE /api/plans/{id}/- Delete a plan
GET /api/services/- List all servicesPOST /api/services/- Create a new serviceGET /api/services/{id}/- Retrieve a specific servicePATCH /api/services/{id}/- Update a serviceDELETE /api/services/{id}/- Delete a service
The API uses Bearer token authentication. To authenticate:
- Obtain a valid token
- Include the token in the Authorization header:
Authorization: Bearer <your-token>
The application implements parent-child relationships in Elasticsearch for efficient querying and searching. The document structure includes:
- Plans
- Services
- Member Cost Shares
- Plan Services
The application implements a producer-consumer pattern for asynchronous processing using RabbitMQ:
- Producer: Handles event generation and queue submission
- Consumer: Processes queued events asynchronously, particularly for Elasticsearch indexing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Django REST Framework
- Elasticsearch
- Redis
- RabbitMQ