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.
- Host: GitHub
- URL: https://github.com/internpulse/pos-padi-express-backend
- Owner: InternPulse
- Created: 2025-04-10T11:45:07.000Z (about 1 year ago)
- Default Branch: dev
- Last Pushed: 2025-05-12T19:52:54.000Z (about 1 year ago)
- Last Synced: 2025-06-01T20:54:00.126Z (about 1 year ago)
- Topics: api, express, express-middleware, expressjs, fintech, fintech-api, jest, mysql, nodejs, otp-verification, pos, prisma, typescript
- Language: TypeScript
- Homepage: https://documenter.getpostman.com/view/43614350/2sB2ixjZkQ#98477155-68ee-41d1-b8b0-7babb146d728
- Size: 17.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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