Skip to content

Transaction Management System A robust platform for managing financial transactions with FastAPI, Streamlit, PostgreSQL, and Docker. Includes secure API endpoints and automated CRON jobs. Access the frontend at http://localhost:8501 and API docs at http://localhost:8000/docs.

License

Notifications You must be signed in to change notification settings

Manoj-2702/TransactionAPIs

Repository files navigation

FlagrightTask

Transaction Management System

Overview

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.

Features

  • 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.

Project Structure

  • 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.

Getting Started

Prerequisites

  • Docker
  • Docker Compose
  • Python 3.8+
  • PostgreSQL

Some Screenshots

alt text

alt text

alt text

alt text

Installation

  1. Clone the repository:

    git clone https://github.com/Manoj-2702/TransactionAPIs
    cd TransactionAPIs
  2. 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
  3. Build and run the application using Docker Compose:

docker-compose up --build
  1. Access the Streamlit frontend:
  • Open your browser and go to http://localhost:8501.
  1. Access the FastAPI documentation:
  • Open your browser and go to http://localhost:8000/docs.

API ENDPOINTS

Transactions

  • 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.

CRON Job

REPORTS

Usage

Streamlit Frontend

- Transaction Dashboard: View and manage transactions. - Create a New Transaction: Fill out the form and submit to create a transaction. - Control CRON Job: Start or stop the automated transaction generation. - Generate Reports: Generate and download transaction reports.

FastAPI Backend

- The backend provides a comprehensive API for managing transactions, handling errors, and generating reports.

Database

- The PostgreSQL database is used to store all transaction data. It includes tables for transactions and keys for authentication.

About

Transaction Management System A robust platform for managing financial transactions with FastAPI, Streamlit, PostgreSQL, and Docker. Includes secure API endpoints and automated CRON jobs. Access the frontend at http://localhost:8501 and API docs at http://localhost:8000/docs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published