Skip to main content

POS Nest API Documentation

Build powerful point of sale applications with our NestJS-powered REST API. Complete with authentication, product management, transactions, and coupon support.

POST /auth/signin
GET /products
POST /transactions
PATCH /coupons/:id

Quick Start

Get your POS Nest API up and running in minutes with these simple steps.

1

Clone and Install

Clone the repository and install dependencies:
git clone https://github.com/SRT2801/pos-nest.git
cd pos-nest
npm install
2

Configure Environment

Set up your environment variables for database and Supabase authentication:
# Database configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=your_password
DATABASE_NAME=pos_nest

# Supabase configuration
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
You’ll need a Supabase account for authentication. Visit supabase.com to create one.
3

Start the Server

Run the development server:
npm run start:dev
The API will be available at http://localhost:3000
4

Make Your First Request

Create a user account and get an access token:
curl -X POST http://localhost:3000/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123"
  }'
{
  "message": "User created successfully",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "role": "user"
  }
}

Explore by Topic

Dive into specific areas of the API to build your point of sale solution.

Authentication

Secure your API with Supabase-powered authentication and role-based access control.

Product Management

Create, update, and organize products with categories and inventory tracking.

Transactions

Process sales transactions with detailed line items and automatic calculations.

Coupons & Discounts

Implement promotional campaigns with flexible coupon codes and expiration dates.

Core Features

Everything you need to build a complete point of sale system.

Role-Based Access

Protect endpoints with admin and user roles powered by Supabase authentication.

TypeORM Integration

Robust database management with PostgreSQL and TypeORM entities.

Image Upload

Upload product images with Supabase storage integration.

Inventory Tracking

Monitor product stock levels and manage inventory across categories.

Discount Engine

Apply percentage-based coupons with automatic expiration handling.

Validation & Guards

Input validation with class-validator and custom guards for route protection.

Resources

Additional resources to help you get the most out of POS Nest API.

Architecture Guide

Learn about the NestJS module structure and application design.

Database Setup

Configure PostgreSQL and run migrations for your database.

Deployment

Deploy your API to production with best practices and configuration tips.

Ready to Start Building?

Follow our quickstart guide to set up your development environment and make your first API call in minutes.

Get Started Now

Build docs developers (and LLMs) love