This guide walks you through getting a fully functional local instance of Balsamoa Backend running from scratch. By the end you will have the Express server running, the PostgreSQL schema applied to Supabase, and the public store API responding to requests.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MateoNavarroMN/Balsamoa-Backend/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites before you begin:
- Node.js 18 or later installed on your machine.
- pnpm installed globally (
npm install -g pnpm). - A Supabase project with a PostgreSQL database. You can create one for free at supabase.com.
Setup steps
Clone the repository
Clone the Balsamoa Backend repository from GitHub and change into the project directory.
Install dependencies
Install all runtime and development dependencies. The project uses pnpm as its primary package manager, but npm and yarn work equally well.This installs Express 5, the
pg PostgreSQL driver, Multer, dotenv, and nodemon.Configure environment variables
The environment template lives in Open
inicializar/.env.example. Copy it to a .env file at the root of the project (next to package.json) and fill in your values..env and update the two variables:.env
Initialize the database
The file
inicializar/balsamoa.sql contains the complete schema (tables, views, sequences) and seed data. You need to run it once against your Supabase database.Option A — Supabase SQL Editor (recommended):- Open your Supabase project dashboard.
- Navigate to SQL Editor in the left sidebar.
- Click New query, paste the full contents of
inicializar/balsamoa.sql, and click Run.
Use the direct connection string (port 5432) when running
psql for schema migrations — the pooler (port 6543) does not support session-level commands like setval.Start the development server
Run the dev script to start Express with nodemon. The server will restart automatically whenever you save a source file.On a successful start you will see:
Verify the server is working
Hit the public products endpoint and open the admin panel to confirm everything is wired up correctly.You should receive a JSON array of products with their variants, images, and stock data. Then open the admin panel in your browser:The admin dashboard should load, allowing you to create, edit, and manage products and inventory.
What’s running
Once the server starts, Express serves three separate static frontends alongside the API — all from the same process and port:| Route | Source folder | Purpose |
|---|---|---|
/recursos | src/public/recursos/ | Shared static assets: CSS, JavaScript, fonts, and product images |
/admin | src/public/admin/ | Admin panel HTML application for store management |
/ | src/public/tienda/ | Public-facing store frontend HTML pages |
/api/v1/... paths are handled by Express routers before the static middleware can intercept them.
The
balsamoa.sql seed script pre-loads a complete starting dataset so you can explore the API immediately after setup:- 10 products across two categories (Hoodies and Remeras), each with a product image.
- 5 sizes — S, M, L, XL, XXL — ordered for display.
- 8 colors — Blanco, Negro, Verde, Beige, Azul, Gris Claro, Gris Oscuro, Marrón — each with a hex value.
- Variant stock entries covering a range of scenarios: fully stocked, low stock, out-of-stock, and single-size products.