Skip to content

areebahmeddd/Payzee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
├── k8s/               # Kubernetes 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), Grafana (visualization), and AlertManager (alerting)
├── 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 -f docker-compose.local.yaml 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/Dockerfile.dev .

# 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

 
 
 

Contributors