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

https://github.com/internpulse/pos-padi-express-backend

Express Backend API for POS Padi, POS-Padi is a robust API to help POS agents and business owners efficiently manage their operations. The platform addresses issues such as fraud, transaction disputes, and cash shortages by offering real-time insights, financial tools, and smart alerts.
https://github.com/internpulse/pos-padi-express-backend

api express express-middleware expressjs fintech fintech-api jest mysql nodejs otp-verification pos prisma typescript

Last synced: 3 months ago
JSON representation

Express Backend API for POS Padi, POS-Padi is a robust API to help POS agents and business owners efficiently manage their operations. The platform addresses issues such as fraud, transaction disputes, and cash shortages by offering real-time insights, financial tools, and smart alerts.

Awesome Lists containing this project

README

          

# POS Padi Express Backend

A robust backend service for managing POS operations, built with Node.js, TypeScript, and Prisma.

## ๐Ÿš€ Project Overview

POS Padi Express provides a secure and scalable API for handling core features related to transactions, disputes, and notifications within a POS (Point of Sale) ecosystem.

### Key features include:
- Transaction creation, listing, and per-agent analytics
- Dispute management (create, view, update, delete, statistics)
- Notification system with read tracking

## ๐Ÿ› ๏ธ Tech Stack

- **Node.js**
- **TypeScript**
- **Express.js**
- **Prisma ORM**
- **MySQL**
- **Jest** (for testing)

## ๐Ÿ“ฆ Getting Started

### Prerequisites

- Node.js โ‰ฅ 16.x
- npm or yarn
- MySQL
- [Prisma CLI](https://www.prisma.io/docs/reference/api-reference/command-reference)

## Installation Instructions

1. Clone the repository:

```bash
git clone https://github.com/InternPulse/pos-padi-express-backend.git
```

2. Change into the parent directory:

```bash
cd pos-padi-express-backend
```

3. Set appropriate values for the following Compulsory Environment Variables:

```txt
# Postgres connection string
DATABASE_URL=""
# Secret key for signing JWTs
JWT_SECRET_KEY=
# API Port
PORT=5000
```

4. Install the App dependencies:

```bash
npm install
```

5. Generate Prisma client and apply migrations:

```bash
npx prisma generate
npx prisma migrate deploy
```

6. Start the App:

```bash
npm run dev
```

The API should now be running locally at [http://localhost:5000/](http://localhost:5000/)

## ๐Ÿ“„ API Documentation
You can explore and test the endpoints via the live Postman documentation:

๐Ÿ”— [View Postman Collection](https://documenter.getpostman.com/view/43614350/2sB2ixjZkQ)

## ๐Ÿ”Œ Available Endpoints
Here's an overview of available routes:

### ๐Ÿ“ Disputes
```
GET /api/v1/disputes โ€“ List all disputes

GET /api/v1/disputes/:id โ€“ Get a single dispute by ID

POST /api/v1/disputes โ€“ Create a new dispute

PUT /api/v1/disputes/:id โ€“ Update a dispute

DELETE /api/v1/disputes/:id โ€“ Delete a dispute

GET /api/v1/disputes/stats โ€“ Get dispute statistics
```
### ๐Ÿ”” Notifications
```
POST /api/v1/notifications โ€“ Create a new notification

GET /api/v1/notifications โ€“ Get all notifications (with query filters)

GET /api/v1/notifications/:id โ€“ Get a single notification by ID

PATCH /api/v1/notifications/:id/read โ€“ Mark a notification as read
```

### ๐Ÿ’ณ Transactions
```
POST /api/v1/transactions โ€“ Create a new transaction

GET /api/v1/transactions โ€“ List all transactions

GET /api/v1/transactions/:id โ€“ Get a transaction by ID

PUT /api/v1/transactions/:id โ€“ Update a transaction

DELETE /api/v1/transactions/:id โ€“ Delete a transaction

GET /api/v1/transactions/stats โ€“ Get overall transaction statistics

GET /api/v1/transactions/agent/:agent_id/stats โ€“ Get transaction stats for a specific agent
```
#### (More endpoints available in the Postman Docs)

## ๐Ÿงช Running Tests
```npm test```

## ๐Ÿง‘โ€๐Ÿ’ป Contributing

- Fork the repo
- Create your branch (git checkout -b feat/feature-name)
- Commit your changes
- Push and open a Pull Request