This guide walks you through spinning up a complete SCO Autolavados environment on your local machine. By the end you will have all three services running — PostgreSQL database, Express API, and React frontend — with a seeded database and a working JWT token ready for API exploration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Luisangelebp/SCO_Autolavados/llms.txt
Use this file to discover all available pages before exploring further.
Steps
Prerequisites
Ensure the following tools are installed on your machine before proceeding.
Docker Desktop for macOS and Windows bundles both Docker Engine and Docker Compose. On Linux, install Docker Compose v2 as a plugin separately.
| Tool | Minimum Version | Check Command |
|---|---|---|
| Docker | 24+ | docker --version |
| Docker Compose | 2.20+ | docker compose version |
| Git | 2.30+ | git --version |
Clone the Repository
Clone the SCO Autolavados repository from GitHub and navigate into the project root.
Configure Environment Variables
The application requires several environment variables to be present before the containers start. Create a Populate it with the following values:Variable reference:
.env file in the project root (alongside docker-compose.yml).| Variable | Description |
|---|---|
DB_USER | PostgreSQL superuser name, passed to the sco_db container |
DB_PASSWORD | PostgreSQL password, passed to the sco_db container |
DB_NAME | Name of the database to create inside PostgreSQL |
DATABASE_URL | Full Prisma connection string; the host segment must be db (the Compose service name) |
JWT_SECRET | Arbitrary secret string for JWT signing — the server exits if this is absent |
Start the Stack
Build all images and start all three services in the foreground so you can watch the logs:Docker Compose will start the following services:
Wait until you see the following line in the logs before proceeding:
| Container | Image | Port(s) | Role |
|---|---|---|---|
sco_db | postgres:15 | (not exposed externally) | PostgreSQL 15 database with persistent postgres_data volume |
sco_api | Custom (built from ./backend) | 3000:3000, 5555:51212 | Express REST API + Prisma Studio |
sco_web | Custom (built from ./frontend) | 5173:5173 | React/Vite frontend (depends on sco_api) |
Run Database Migrations and Seed
With the containers running, open a second terminal and apply the Prisma migration to create all tables, then seed the database with initial data (admin user, sample laundrer, and seed customer).A successful migration will print each applied migration name. The seed script creates the default
AutoLavado configuration record, roles, and initial users so you can immediately start testing the full business flow.The
backend/package.json does not define a prisma.seed configuration entry, so npx prisma db seed will not work. The seed file is a plain TypeScript script — run it directly with tsx as shown above.Make Your First API Call
Authenticate as the admin user to receive a JWT token. Use the seeded credentials:A successful response looks like this:Copy the
token value and use it as a Bearer token in the Authorization header for all subsequent protected API requests:A
POST /api/users/refresh endpoint is also available for token renewal. Send the refreshToken value (returned alongside token in the login response) in the request body to receive a new access token without re-authenticating:What’s Next?
Now that your environment is running and you have an authenticated token, explore the core concepts and API reference:Users & Roles
Learn how the Admin, Customer, and Laundrer roles work, how accounts are created for each, and how JWT middleware enforces access control across all routes.
API Reference
Browse the full HTTP API — all endpoints, request bodies, response shapes, and authentication requirements across every module.