Quick Start Guide
Get PC Fix up and running on your local machine in under 5 minutes using Docker Compose. This guide will have you running the complete stack - frontend, backend, and database.This quickstart uses Docker Compose to orchestrate all services. If you prefer manual setup or need to customize your installation, see the Installation Guide.
Prerequisites
Before you begin, ensure you have the following installed:- Node.js 20+: Download here
- Docker Desktop: Download here
- Git: Download here
Step-by-Step Setup
Configure Environment Variables
PC Fix requires environment variables for the API and Web packages. Create the following files:API Environment (
Create Web Environment (
Create
API Environment (packages/api/.env)
Create packages/api/.env with these variables:Web Environment (packages/web/.env)
Create packages/web/.env with these variables:The database URL uses
postgres as the hostname because Docker Compose creates an internal network where services reference each other by service name.Start Docker Compose
Launch all services with a single command:This command will:
- Build the API and Web Docker images
- Start a PostgreSQL 15 database container
- Run Prisma migrations to set up the database schema
- Start the Express API server on port 3001
- Start the Astro development server on port 4321
Verify Services are Running
Once Docker Compose finishes starting, verify all services are accessible:
- Frontend: http://localhost:4321
- API: http://localhost:3001/api/health
- Prisma Studio (optional): Run
docker exec -it pcfix-api npx prisma studioto access the database GUI at http://localhost:5555
localhost:4321 and a JSON health response from the API.What’s Running?
Your Docker Compose setup includes three services:PostgreSQL Database
Container:
pcfix-postgresPort: 5432Credentials:- User:
admin - Password:
password123 - Database:
pcfix_db
postgres_dataExpress API
Container:
pcfix-apiPort: 3001Features:- Hot reload with nodemon
- Auto-runs migrations on start
- Volume-mounted source code
Astro Web Frontend
Container:
pcfix-webPort: 4321Features:- Hot reload on file changes
- SSR with React islands
- Volume-mounted source code
Common Docker Commands
Accessing the Admin Dashboard
Create an Admin User
Connect to the API container and create an admin user:Navigate to the
User model and create a user with role: ADMIN.Login to Admin Panel
Visit http://localhost:4321/admin and login with your admin credentials.
Development Workflow
With Docker Compose running, you can edit files locally and see changes immediately:- Frontend changes: Edit files in
packages/web/src/- Astro will hot reload - Backend changes: Edit files in
packages/api/src/- Nodemon will restart the server - Database schema changes: Edit
packages/api/prisma/schema.prismathen run:
Environment Variables Explained
Database Connection
Database Connection
- Uses
postgreshostname (Docker service name) - Default credentials match docker-compose.yml
schema=publicspecifies Prisma schema
JWT Configuration
JWT Configuration
- Access tokens expire in 15 minutes
- Refresh tokens last 7 days
- Change secrets in production!
API URLs (Web Package)
API URLs (Web Package)
PUBLIC_API_URL: Used by client-side React componentsSSR_API_URL: Used by Astro SSR pages (uses Docker network)
Optional External Services
Optional External Services
For full functionality, configure these optional services:
- Cloudinary: Image upload and CDN
- MercadoPago: Payment processing
- Google OAuth: Social login
- Resend: Transactional emails
- Sentry: Error monitoring
Troubleshooting
Port already in use
Port already in use
If you see errors about ports 3001, 4321, or 5432 being in use:
Database connection errors
Database connection errors
Ensure PostgreSQL container is healthy:If needed, reset the database:
Module not found errors
Module not found errors
Rebuild the containers to reinstall dependencies:
Prisma migration errors
Prisma migration errors
Reset Prisma migrations:
Next Steps
Now that you have PC Fix running locally:Explore the Codebase
- Frontend:
packages/web/src/ - Backend:
packages/api/src/ - Database:
packages/api/prisma/schema.prisma
Read Full Installation Guide
Learn about manual setup without Docker and advanced configuration
Configure External Services
Set up Cloudinary, MercadoPago, and other integrations