A scalable backend service for managing calendar events. This application supports CRUD operations, filtering, and notifications, designed to showcase a production-ready solution using Django and Python.
- CRUD Operations: Create, Read, Update, and Delete events.
- Filtering: Filter events by attributes such as date and location.
- Notifications: Email or logging notifications for newly created events.
- Scalability: Designed for future scalability with caching and task queues.
- API Documentation: Simple RESTful endpoints for event management.
- Backend: Django, Django REST Framework
- Database: PostgreSQL (or SQLite for local development)
- Caching: Redis
- Task Queue: Celery with Redis
- Deployment: Docker, AWS Elastic Beanstalk
-
Clone the repository:
git clone https://github.com/omitent/calendar-test-app.git cd calendar-test-app
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Access the app at
http://127.0.0.1:8000/api/events/
.
- Build and run the app with Docker:
docker-compose up --build
- Access the app at
http://localhost:8000/api/events/
.
- Install the EB CLI:
pip install awsebcli
- Initialize the Elastic Beanstalk environment:
eb init -p python-3.8 django-calendar-app eb create django-calendar-env
- Deploy:
eb deploy
- GET
/api/events/
: List all events. - POST
/api/events/
: Create a new event. - GET
/api/events/<id>/
: Retrieve an event by ID. - PUT/PATCH
/api/events/<id>/
: Update an event. - DELETE
/api/events/<id>/
: Delete an event.
-
Run tests with
pytest
:pytest
-
View test coverage (if using
coverage.py
):coverage run -m pytest coverage report
- Database Optimization: Indexed frequently queried fields.
- Caching: Implemented Redis for caching.
- Background Tasks: Used Celery with Redis for email notifications.
- Load Balancing: Configured for scalability with AWS Elastic Beanstalk.
- Add JWT authentication for secure API access.
- Enhance filtering options with complex queries.
- Use CI/CD pipelines for automated testing and deployment.
- Implement additional monitoring tools (e.g., Sentry, AWS CloudWatch).