An open API service indexing awesome lists of open source software.

https://github.com/areebahmeddd/payzee

๐Ÿ’ต Pay Easy, Payzee!
https://github.com/areebahmeddd/payzee

devops digital-rupee digital-wallet e-governance fastapi redis social-welfare

Last synced: 7 months ago
JSON representation

๐Ÿ’ต Pay Easy, Payzee!

Awesome Lists containing this project

README

          

# 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 ]](https://youtube.com/shorts/qatWtapzcAU)

- ๐Ÿ’ป T3-stack Website: [Live](https://payzee.1mindlabs.org) | [Source Code](https://github.com/alfiyafatima09/payzee-website)
- ๐Ÿ“ฑ Flutter App: [Live](#) | [Source Code](https://github.com/1MindLabs/payzee-app)

## ๐Ÿ“ 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](https://python-poetry.org) for dependency management

### โšก Quick Start

Run the setup script:

```bash
# 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:

```bash
docker compose -f docker-compose.local.yaml up -d
```

Or with Make:

```bash
make up
```

To view logs from all services:

```bash
docker compose logs -f
```

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

```bash
docker compose logs -f api
```

### 2. Run the app manually with Docker

```bash
# 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**:

```bash
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
```

- **Linux/macOS**:

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

### 2. Start Redis using Docker

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

### 3. Install project dependencies

```bash
poetry install
```

### 4. Start the development server

```bash
poetry run uvicorn app:app --reload
```

## ๐Ÿงช Development Tools

### ๐ŸŒฑ Seeding Data

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

```bash
./scripts/seed_data.sh
```

Or with Make:

```bash
make seed
```

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

### โœ… Testing

Run tests with `pytest`:

```bash
# 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:

```bash
poetry run pre-commit run --all-files
```

Or use Make:

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

## ๐Ÿ”Œ Redis Management

RedisInsight is available via Docker at:
๐Ÿ‘‰ [http://localhost:5540](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](http://localhost:8000/docs)