Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AdriP-maker/JAAR_Antigravity/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you from a fresh clone to a running SIMAP Digital dev server with demo data pre-loaded for all five roles.

Prerequisites

Before you begin, make sure you have the following installed:
  • Node.js ≥ 18nodejs.org
  • npm (bundled with Node.js)
  • A Supabase project for cloud sync (optional for purely offline local testing — the app runs without it)

Installation

1

Clone the repository

Clone the SIMAP Digital source and move into the project directory.
git clone https://github.com/AdriP-maker/JAAR_Antigravity.git
cd JAAR_Antigravity
2

Install dependencies

Install all runtime and development dependencies.
npm install
3

Create your environment file

Copy the provided example environment file to create your local .env.
cp .env.example .env
The .env.example file ships with the following variables:
# App identity
VITE_APP_NAME="SIMAP Digital Plataforma"
VITE_APP_VERSION="1.0.0"

# AI provider (optional — defaults to browser-local window.ai)
VITE_AI_PROVIDER="local"   # Options: "local", "openai", "claude"
VITE_OPENAI_API_KEY="sk-..."

# Supabase cloud sync (required for online sync)
VITE_SUPABASE_URL="https://tu-proyecto.supabase.co"
VITE_SUPABASE_ANON_KEY="tu-anon-key"
4

Configure Supabase credentials

Open .env in your editor and replace the placeholder values with your real Supabase project credentials.
VITE_SUPABASE_URL="https://your-project-ref.supabase.co"
VITE_SUPABASE_ANON_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
You can find both values in your Supabase dashboard under Project Settings → API.
VITE_ prefixed variables are bundled into the client-side JavaScript by Vite and are therefore visible in the browser. Use only your anon (public) key here — never your service_role secret key.
5

Start the development server

Launch the Vite dev server. The browser opens automatically at http://localhost:5173.
npm run dev
You should see output similar to:
  VITE v8.x.x  ready in 312 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose

Demo credentials

The app seeds IndexedDB with demo accounts on first launch (defined in src/utils/constants.js). Use these to explore each role’s interface:
RoleUsernamePasswordDescription
adminadminadmin123Full system control — users, finances, audit logs, system config.
cobradorcobrador1234Field collector — offline payments, AI route suggestions, jornales.
minsaminsa1234Read-only MINSA inspector — download official Excel and PDF reports.
clientecliente1234Resident/neighbour view — payment history, points balance, notices.
devdevadmin123Audit log only — no access to financial data or resident PII.
These demo credentials are hardcoded for local development and testing only. Never deploy SIMAP Digital to a production environment with these default passwords. Replace all demo accounts with real credentials secured through Supabase Auth before going live.

Available npm scripts

ScriptCommandDescription
Dev servernpm run devStarts Vite dev server at http://localhost:5173 with HMR.
Production buildnpm run buildCompiles and bundles the app into the dist/ directory.
Preview buildnpm run previewServes the production dist/ build locally for pre-deploy testing.
Lintnpm run lintRuns ESLint across the source tree.

Offline-first behaviour

Once the app has loaded at least once, it operates fully without internet access:
  • All data (residents, payments, expenses, jornales) is stored in IndexedDB on the device via Dexie.js.
  • Any write made while offline is queued in the pendingSync table.
  • When the browser detects an online event, SIMAP Digital automatically flushes the pending queue to Supabase.
You can test this by loading the app, switching your browser to offline mode (DevTools → Network → Offline), and processing a payment — it will register instantly. Switch back online and the record will sync to Supabase in the background.

Build docs developers (and LLMs) love