Skip to main content

Prerequisites

Before you begin, make sure you have the following installed:
  • Node.js 18+ and npm
  • PostgreSQL database (running locally or hosted)
  • Git
You need to run both the frontend and backend servers simultaneously. Open two terminal windows to keep them running side by side.

Steps

1

Clone the repository

git clone https://github.com/saquiray/crm
cd crm
2

Install frontend dependencies

From the project root:
npm install
3

Configure frontend environment

Create a .env.local file in the project root:
.env.local
NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
Replace the Supabase values with the URL and anon key from your Supabase project dashboard (Project Settings → API).
4

Navigate to the backend and install dependencies

cd backend
npm install
5

Configure backend environment

Create a .env file in the backend/ directory:
backend/.env
DATABASE_URL="postgresql://user:password@localhost:5432/inventory_db"
JWT_SECRET="your-super-secret-jwt-key"
PORT=5000
NODE_ENV=development
In production, set JWT_SECRET to a long, randomly generated string. You can generate one with:
openssl rand -base64 32
6

Generate the Prisma client

Run this from inside the backend/ directory:
npm run prisma:generate
7

Run database migrations

npm run prisma:migrate
This applies the Prisma schema to your PostgreSQL database and creates all required tables.
8

Seed the database (optional)

Populate the database with sample data for development:
npm run prisma:seed
9

Start the backend server

npm run dev
The backend API starts at http://localhost:5000.
10

Start the frontend server

In a separate terminal window, from the project root:
npm run dev
The frontend starts at http://localhost:3000.
11

Register your account

Open http://localhost:3000/register in your browser. Fill in the registration form:
  • Business Name — your company or organization name
  • Email — your login email
  • Password — a secure password
  • Confirm Password — repeat the password
Click Create Account. Supabase creates your account and sends a confirmation email if email confirmation is enabled in your Supabase project. You are then redirected to /register-success.
12

Navigate to the Dashboard

After registration, you are redirected to the dashboard at http://localhost:3000. From here you can manage products, services, inventory, stock movements, and customers — all scoped to your tenant.

Next steps

Architecture

Learn how the multi-tenant system is structured.

Environment variables

Review all configuration options for frontend and backend.

API reference

Explore the full REST API.

Database setup

Configure and manage your PostgreSQL database.

Build docs developers (and LLMs) love