This guide walks you from a fresh clone to a running ContabilidadISV instance with a logged-in session, ready to create your first consolidation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Medinaallan/ContabilidadISV/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
| Requirement | Version / Notes |
|---|---|
| Node.js | 16 or higher |
| npm | Bundled with Node.js 16+ |
| SQL Server | Local instance or SQLEXPRESS named instance. SQL Server Express (free) is sufficient for development. |
| Git | To clone the repository |
On Windows, the recommended setup is SQL Server Express with default TCP port
1433. The Database_SqlServer.js connection config defaults to port 1433 automatically. If your SQL Server instance listens on a different port, set DB_PORT in your .env file accordingly.Clone the repository and install all dependencies
ContabilidadISV is a monorepo with a root
package.json that coordinates the backend/ and frontend/ workspaces. A single convenience script installs both.npm run install-all runs cd backend && npm install followed by cd ../frontend && npm install, so both sub-projects end up with their own node_modules.Configure the environment
Create the file Key defaults from
backend/.env. The backend reads this file at startup via dotenv. All database keys map directly to the mssql connection config in backend/src/models/Database_SqlServer.js.Database_SqlServer.js:DB_SERVER→localhostDB_NAME→ContabilidadISVDB_PORT→1433DB_TRUST_CERT→true(local dev default)DB_ENCRYPT→false(Azure requirestrue)
Initialize the database
Before running the Node.js init script, ensure the SQL Server database and all required tables (This is a shortcut for
users, consolidaciones_generales, consolidaciones_hoteles, clientes, system_logs, uploaded_files) already exist in SQL Server. Create them using your SQL Server management tool, then run the init script to seed the default admin user:cd backend && npm run init-db (backend/scripts/initDatabase.js). It connects to SQL Server using your .env credentials and inserts the default admin account (admin@contabilidad.com / admin123). If you see a connection error, double-check DB_SERVER, DB_PORT, and that SQL Server is running.Start the application in development mode
The root You should see two sets of startup logs interleaved in your terminal:
dev script uses concurrently to start both servers simultaneously. The backend listens on port 3002 and the Vite dev server listens on port 5174 (with /api proxied to the backend).Individual services can also be started separately:
- Backend only:
npm run dev:backend(Express on port 3002) - Frontend only:
npm run dev:frontend(Vite on port 5174)
Open the app and log in
Open http://localhost:5174 in your browser. You will be redirected to the login page.Sign in with the default admin credentials created by
init-db. After a successful login, the backend issues a JWT which the frontend stores in localStorage and attaches as a Bearer token on every subsequent API request via the Axios interceptor in frontend/src/services/api.ts.Once authenticated you will land on the Dashboard — the Home section showing summary metrics. The top navigation bar exposes the Consolidaciones dropdown (Crear Consolidación, Historial, Reportes), the Clientes dropdown (Ver y Añadir, Cargar desde CSV), and — for admin users — Logs del Sistema, Gestión de Usuarios, and Soporte técnico.Creating your first consolidation
After logging in, follow these sub-steps to record your first tax consolidation:- Select a client — Go to Clientes → Ver y Añadir and confirm your client exists. If not, click Nuevo Cliente, fill in the company name, RTN (Registro Tributario Nacional), industry sector, and representative details, then save.
-
Open the consolidation form — Go to Consolidaciones → Crear Consolidación. The upload/create section (mapped to
UploadSectionin the frontend) loads the entry form. - Choose the consolidation type — Select either Generales (standard businesses, ISV 15 % / 18 %) or Hoteles (tourism businesses, ISV + IST 4 %). The form layout adjusts automatically to show or hide the IST column.
- Fill in Debe and Haber values — Work through the 55 accounts. ISV and IST totals are calculated in real time as you type.
-
Save the consolidation — Click Guardar. The record is written to
consolidaciones_generalesorconsolidaciones_hotelesdepending on your selection, and asystem_logsentry is created for auditability. - Export — Navigate to Consolidaciones → Reportes to generate an Excel workbook or PDF for the period you just created. See the Reports & Export guide for template options.