This API project manages offers & brokers on a list of parcels (Parcel of Land). It includes functionality to create, read, update, and delete offers associated with parcels. Additionally, it features a background job that monitors the count of parcels in each combination of block number and subdivision number, triggering notifications when all parcels in a combination have active offers. Unit tests and authentication mechanisms are also implemented for security and quality assurance.
- Python
- Django
- Postgresql
- Celery
- RabbitMQ
- Docker
The application is built using a modular monolith architecture approach. While it is a monolithic application, it is structured in a modular way, allowing for better organization and separation of concerns within the codebase. Each module encapsulates related functionality, promoting code reusability and maintainability while still benefiting from the simplicity of a monolithic deployment.
modular-monolith
├── backend # primary backend service
│ ├── land_broker_hub # land_broker_hub root namespace
│ │ ├── broker # broker application/module
│ │ ├── data # fixtures container
│ │ ├── offer # offer application/module
│ │ ├── parcel # parcel application/module
│ │ ├── settings # application settings
│ │ └── tests # application tests
│ ├── scripts # application scripts
└── webserver # application webserver
The application is available in a Dockerized flavor, allowing for easy deployment and management in containerized environments.
- Clone the repository:
foo@bar:~$ git clone https://github.com/asifpy/ParcelGate.git
- Navigate to the project directory:
foo@bar:~$ cd ParcelGate/modular-monolith
- Run the Docker Compose command to build and start the services:
foo@bar:~$ docker compose up --build
- Application boostraping to setup the DB and load the initial fixtures
foo@bar:~$ docker compose exec backend ./scripts/bootstrap.sh
- You can also run the tests via:
foo@bar:~$ docker compose exec backend python manage.py tests
API resources are protected with JWT (JSON Web Token) authentication scheme, ensuring secure access to the endpoints.
The application includes Swagger UI for API documentation, providing an interactive interface to explore and test the API endpoints.
- You can access the Swagger UI by navigating to
http://localhost:8060/api/schema/swagger-ui/
for desired API documentation - Use the interactive interface to explore and test the API endpoints
- Complete Open API specification is available at
modular-monolith/backend/api_spec.yaml
After setting up the application, you can access the all the endpoints using Swagger UI OR any API client. Below is the API response for the Offers endpoint which supports the filters and pagination options:
API Target: http://localhost:8060/offers/?expand=broker,parcels