The Transaction Management System is a comprehensive platform designed to handle various financial transactions efficiently. It comprises a FastAPI backend for handling API requests, a Streamlit frontend for user interaction, and a PostgreSQL database for data storage. The system supports creating, retrieving, and searching transactions, as well as generating transaction reports.
- FastAPI Backend: Provides a robust API for transaction management.
- Streamlit Frontend: Offers a user-friendly interface for interacting with the system.
- PostgreSQL Database: Ensures reliable data storage and retrieval.
- CRON Job: Automated transaction generation for testing purposes.
- Authentication: Secure API endpoints with API keys.
- app.py: Main FastAPI application file.
- streamlit_app.py: Streamlit application for the frontend interface.
- transaction.py: Contains API routes for transaction-related operations.
- database.py: Handles database connections and operations.
- Dockerfile: Docker configuration for containerizing the application.
- docker-compose.yml: Docker Compose configuration for setting up the entire stack.
- Docker
- Docker Compose
- Python 3.8+
- PostgreSQL
-
Clone the repository:
git clone https://github.com/Manoj-2702/TransactionAPIs cd TransactionAPIs
-
Set up environment variables: Create a .env file in the root directory and add the following variables:
DATABASE_URL=your_database_url API_KEY=your_api_key
-
Build and run the application using Docker Compose:
docker-compose up --build
- Access the Streamlit frontend:
- Open your browser and go to
http://localhost:8501.
- Access the FastAPI documentation:
- Open your browser and go to
http://localhost:8000/docs.
- Create a Transaction
POST /create_transactions
Request Body:
{
"amount": 100.0,
"sender_id": "user_123",
"destination_id": "user_456",
"type": "TRANSFER",
"currency": "USD",
"country": "US"
}
- Retrieve a Transaction
GET /get_transactions/{transaction_id}
- Search Transactions by Amount
GET /search_transaction_by_amount
Query Parameters:
-
amount
: The amount to search for. -
Search Transactions by Date Range
GET /search_transaction_by_date_range
Query Parameters:
-
start_date
: The start date of the range. -
end_date
: The end date of the range. -
Search Transactions by Type
GET /search_transaction_by_type
Query Parameters:
type
: The type of transactions to search for.