Prerequisites
Before installing ARCA, ensure you have the following tools installed on your system:Node.js
Version 18 or higher required
PostgreSQL
Latest stable version recommended
npm
Version 10 or higher (comes with Node.js)
Git
For cloning the repository
ARCA uses npm workspaces and Turborepo for monorepo management. The package manager is locked to [email protected] for consistency.
Verify Prerequisites
Check that you have the required versions installed:Installation Steps
Clone the Repository
Clone the ARCA repository from GitHub to your local machine:This creates a local copy of the ARCA monorepo with all apps and configurations.
Install Dependencies
Install all dependencies for the monorepo using npm:This command:
- Installs root dependencies (Turborepo, Prettier, etc.)
- Installs backend dependencies (NestJS, Prisma, bcrypt)
- Installs frontend dependencies (Next.js, React, TailwindCSS)
- Links workspace packages together
The installation uses npm workspaces to manage dependencies across the monorepo. This may take a few minutes on first install.
Set Up Environment Variables
Create a Edit
.env file in the backend directory:apps/backend/.env and configure your database connection:apps/backend/.env
Replace
username and password with your PostgreSQL credentials. Generate a secure random string for JWT_SECRET in production.Run Database Migrations
Navigate to the backend directory and execute Prisma migrations:This command:
- Creates all required database tables
- Sets up relationships and constraints
- Generates the Prisma Client
- Seeds initial data (roles, etc.)
Verify Installation
You can verify that everything is set up correctly by checking the Prisma schema:http://localhost:5555, where you can:
- View all database tables
- Inspect the schema structure
- Verify migrations were applied
- See initial seed data
Press
Ctrl+C in the terminal to stop Prisma Studio when you’re done exploring.Project Structure
After installation, your project structure should look like this:Database Schema
The ARCA database includes the following main entities:Usuarios
Users (interns and supervisors) with role-based access
Pacientes
Patient records with demographics and medical history
Atendimentos
Appointment sessions with timestamps and observations
Documentos
Clinical documents with version control
RelatorioAlta
Discharge reports and clinical assessments
LogAuditoria
Audit logs for compliance and traceability
Troubleshooting
Connection refused to PostgreSQL
Connection refused to PostgreSQL
Make sure PostgreSQL is running:Verify the DATABASE_URL in
apps/backend/.env matches your PostgreSQL configuration.Prisma Client not found
Prisma Client not found
Generate the Prisma Client manually:This creates the type-safe database client used by the backend.
Port already in use
Port already in use
If port 3000 or 3333 is already in use, you can change them:
- Backend: Set
PORT=3334inapps/backend/.env - Frontend: Use
npm run dev:frontend -- -p 3001or set in package.json
npm install fails
npm install fails
Clear npm cache and try again:Ensure you’re using Node.js 18 or higher and npm 10 or higher.
Next Steps
Now that ARCA is installed, proceed to the Quick Start Guide to start the development servers and explore the application.Quick Start
Learn how to start ARCA and access the application