This is a Restful API for a cash management system that allows users to manage their cash flow by creating and updating transactions, tracking balances, and generating reports.
-
Clone the repository:
git clone https://github.com/your-username/cash-management-system.git cd cash-management-system
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # For Windows, use: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
Run the following command to start the development server:
python manage.py runserver
The API will be available at http://localhost:8000/
.
POST /users/api/register/
: Register a new user with a username and password.POST /users/api/login/
: Authenticate and get an access token.
POST /api/transaction/
: Create a new transaction.GET /api/transaction/
: List all transactions with filtering and sorting options.GET /api/transaction/{id}/
: Retrieve details of a specific transaction.PATCH /api/transaction/{id}/
: Update a specific transaction.DELETE /api/transaction/{id}/
: Delete a specific transaction.
POST /api/reports/monthly-summary/
: Generate a monthly summary report.POST /api/reports/category-wise-expense/
: Generate a category-wise expense report.
Run the unit tests and integration tests with the following command:
python manage.py test
To dockerize the application, you can use Docker and Docker Compose. The configuration files for Docker are provided in the repository.
To build and run the Docker containers, use the following command:
docker-compose up --build
The API will be available at http://localhost:8000/
.
The API endpoints are documented using Postman. The Postman documentation is available in the docs
folder of the project. To view the documentation, follow these steps:
-
Open Postman application.
-
Import the Postman collection and environment files from the
docs
folder. -
Once imported, you will have access to the detailed documentation of each API endpoint, including request parameters, response examples, and allowed methods.
-
Explore and test the API endpoints directly from the Postman documentation.