Quickstart Guide
Get POS Nest API up and running in just a few minutes. This guide will walk you through cloning the repository, setting up your environment, and making your first API call.Before starting, ensure you have Node.js 18+ and PostgreSQL installed, or a Supabase account for hosted PostgreSQL.
Getting Started
Install Dependencies
Install all required npm packages:This will install all dependencies including:
- NestJS core packages (v11.0.1)
- TypeORM (v0.3.28)
- Supabase JS client (v2.97.0)
- PostgreSQL driver
- Validation libraries
Configure Environment Variables
Create a
.env file in the root directory with your configuration:.env
Start the Development Server
Run the API in development mode with hot reload:You should see output indicating the server is running:The API is now running at
http://localhost:3000Create Your First User
Make a signup request to create your first user account:Expected Response:
cURL
The password must be at least 6 characters long due to validation rules in
src/auth/dto/sign-up.dto.tsSign In and Get Access Token
Sign in with your credentials to get an access token:Expected Response:Save the
cURL
access_token - you’ll need it for authenticated requests.What’s Next?
Congratulations! You now have POS Nest API running locally. Here are some next steps:API Reference
Explore all available endpoints
Authentication
Learn about authentication and authorization
Products
Manage products and inventory
Transactions
Process sales transactions
Common Issues
Port 3000 already in use
Port 3000 already in use
If port 3000 is already in use, you can change it in your Or set it when starting the server:
.env file:Database connection failed
Database connection failed
Verify your database credentials in the
.env file match your PostgreSQL or Supabase configuration. The connection settings are loaded in src/config/typeorm.config.ts:9-13.If using Supabase, ensure:- Your project is active
- Database password is correct
- Host includes the correct region
Supabase authentication errors
Supabase authentication errors
Double-check your Supabase configuration:
SUPABASE_URLshould be your project URL (e.g.,https://xxxxx.supabase.co)SUPABASE_SERVICE_ROLE_KEYis the service role key, not the anon key- The service role key can be found in Supabase Dashboard under Settings > API
Validation errors when signing up
Validation errors when signing up
The signup endpoint validates:
- Email must be a valid email format
- Password must be at least 6 characters
src/auth/dto/sign-up.dto.ts:1-12