Skip to main content

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:
Docker Desktop must be running before executing the docker-compose commands.

Step-by-Step Setup

1

Clone the Repository

Clone the PC Fix repository to your local machine:
2

Configure Environment Variables

PC Fix requires environment variables for the API and Web packages. Create the following files:

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.
3

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
The first build may take 5-10 minutes as it downloads base images and installs dependencies.
4

Verify Services are Running

Once Docker Compose finishes starting, verify all services are accessible:You should see the PC Fix homepage at localhost:4321 and a JSON health response from the API.
5

Seed the Database (Optional)

To populate the database with sample products and data:
This will create:
  • Sample product categories and brands
  • Demo products with images
  • Test user accounts
  • Sample orders and transactions

What’s Running?

Your Docker Compose setup includes three services:

PostgreSQL Database

Container: pcfix-postgresPort: 5432Credentials:
  • User: admin
  • Password: password123
  • Database: pcfix_db
Persistent volume: postgres_data

Express 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

1

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.
2

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:
  1. Frontend changes: Edit files in packages/web/src/ - Astro will hot reload
  2. Backend changes: Edit files in packages/api/src/ - Nodemon will restart the server
  3. Database schema changes: Edit packages/api/prisma/schema.prisma then run:

Environment Variables Explained

  • Uses postgres hostname (Docker service name)
  • Default credentials match docker-compose.yml
  • schema=public specifies Prisma schema
  • Access tokens expire in 15 minutes
  • Refresh tokens last 7 days
  • Change secrets in production!
  • PUBLIC_API_URL: Used by client-side React components
  • SSR_API_URL: Used by Astro SSR pages (uses Docker network)
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
The app will work without these, but some features will be disabled.

Troubleshooting

If you see errors about ports 3001, 4321, or 5432 being in use:
Ensure PostgreSQL container is healthy:
If needed, reset the database:
Rebuild the containers to reinstall dependencies:
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

Run Tests