Skip to content

areebahmeddd/Payzee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Payzee: Pay Easy, Payzee!

Payzee is a modern payment processor powered by Central Bank Digital Currency (CBDC) β€” also known as the Digital Rupee or e-rupee (eβ‚Ή). [ YouTube Demo ]

πŸ“ Project Structure

β”œβ”€β”€ app.py             # Main FastAPI application entry point
β”œβ”€β”€ .devcontainer/     # Development container configuration
β”œβ”€β”€ .github/           # GitHub workflows and configuration
β”œβ”€β”€ data/              # External datasets and reference information
β”œβ”€β”€ db/                # Redis database configuration and operations
β”œβ”€β”€ docker/            # Docker configuration files
β”œβ”€β”€ docs/              # Documentation files
β”œβ”€β”€ middleware/        # Request/response middleware components
β”œβ”€β”€ models/            # Data models for transactions, users, and payment entities
β”œβ”€β”€ monitoring/        # Application Performance Monitoring with Prometheus (metrics collection) and Grafana (visualization)
β”œβ”€β”€ routes/            # API endpoints for payments and authentication
β”œβ”€β”€ scripts/           # Development and setup scripts
β”œβ”€β”€ templates/         # HTML templates for the application
β”œβ”€β”€ tests/             # Unit and integration tests
└── utils/             # Helper utilities and common functions

πŸš€ Setup for Development

Prerequisites

  • Python 3.11+
  • Redis server
  • Poetry for dependency management

⚑ Quick Start

Run the setup script:

# Option 1: Remote (no clone needed)
sudo bash -c "$(curl -fsSL https://areebahmeddd.github.io/payzee/install.sh)"

# Option 2: Local (after cloning)
./scripts/install.sh

Both install dependencies and start the dev server.

This script will:

  • Install Poetry (if not already installed)
  • Set up necessary PATH variables
  • Install project dependencies
  • Start the development server with hot-reload

🐳 Docker Setup (Recommended)

1. Start the full stack

Using Docker Compose:

docker compose up -d

Or with Make:

make up

To view logs from all services:

docker compose logs -f

To view logs for a specific service (e.g., api):

docker compose logs -f api

2. Run the app manually with Docker

# Build the API container
docker build -t payzee-api -f docker/dev.Dockerfile .

# Run the API container
docker run -p 8000:8000 --env-file .env payzee-api

🧰 Manual Setup

1. Install Poetry

  • Windows:

    (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
  • Linux/macOS:

    curl -sSL https://install.python-poetry.org | python3 -

2. Start Redis using Docker

docker run --name payzee-redis -p 6379:6379 -d redis:latest

3. Install project dependencies

poetry install

4. Start the development server

poetry run uvicorn app:app --reload

πŸ§ͺ Development Tools

🌱 Seeding Data

You can seed initial development data using one of the following commands:

./scripts/seed_data.sh

Or with Make:

make seed

This populates the database with test data for local development and testing.

βœ… Testing

Run tests with pytest:

# Using poetry
poetry run pytest

# Or with Make
make test

🧼 Pre-commit Hooks

We use pre-commit hooks with Ruff for linting and formatting. (Installed with project dependencies)

Hooks handle:

  • Removing trailing whitespace
  • Ensuring files end with a newline
  • Checking JSON/YAML syntax
  • Python linting & formatting with Ruff

To run all hooks manually:

poetry run pre-commit run --all-files

Or use Make:

make lint     # Run Ruff linting
make format   # Format code using Ruff

πŸ”Œ Redis Management

RedisInsight is available via Docker at: πŸ‘‰ http://localhost:5540

To connect:

  1. Click Add Redis database

  2. Use one of the following connection strings:

    • redis://localhost:6379
    • redis://host.docker.internal:6379

This allows inspection of Redis data and keyspaces.

πŸ“˜ API Documentation

Once the app is running, open Swagger UI at: πŸ‘‰ http://localhost:8000/docs

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •