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

https://github.com/spacetesla/payzee

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

Last synced: about 1 year 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โ‚น)**.

## ๐Ÿ“ Project Structure

```
โ”œโ”€โ”€ app.py # Main FastAPI application entry point
โ”œโ”€โ”€ db/ # Redis database configuration and operations
โ”œโ”€โ”€ models/ # Data models for transactions, users, and payment entities
โ”œโ”€โ”€ routes/ # API endpoints for payments and authentication
โ”œโ”€โ”€ middleware/ # Request/response middleware components
โ”œโ”€โ”€ utils/ # Helper utilities and common functions
โ”œโ”€โ”€ tests/ # Unit and integration tests
โ””โ”€โ”€ scripts/ # Development and setup scripts
```

## ๐Ÿš€ Setup for Development

### Prerequisites

* Python 3.11+
* Redis server
* [Poetry](https://python-poetry.org/) for dependency management

### โšก Quick Start

Run the setup script to prepare your development environment:

```bash
./scripts/run.sh
```

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 up -d
```

Or with Make:

```bash
make up
```

### 2. Run the app manually with Docker

```bash
# Build the API container
docker build -t payzee-api -f docker/prod.Dockerfile .

# 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

### โœ… 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.

Hooks handle:

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

Pre-commit is installed with project dependencies.

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://redis: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)