Introduction
PC Fix is a modern full-stack e-commerce platform built for selling PC hardware and components. The architecture follows a monorepo structure using NPM Workspaces, enabling efficient code sharing and unified development workflows.This is a production-ready SaaS application deployed on Vercel (frontend) and Railway (backend + database).
High-Level Architecture
The system consists of three main layers:Frontend
Astro 5 with React islands for optimal performance
Backend API
Express 5 REST API with modular architecture
Database
PostgreSQL with Prisma ORM
System Architecture Diagram
Technology Stack
Frontend Stack
Core Technologies
Core Technologies
- Astro 5.16.3 - Meta-framework for SSR and static generation
- React 18.3 - UI library for interactive islands
- Tailwind CSS 3.4 - Utility-first CSS framework
- TypeScript 5.9 - Type safety across the codebase
State & Forms
State & Forms
- Zustand 5.0 - Lightweight state management
- React Hook Form 7.67 - Performant form handling
- Zod 3.25 - Schema validation
UI & Interactions
UI & Interactions
- Lucide React - Icon library
- Swiper 11.1 - Touch-enabled carousels
- Recharts 3.5 - Data visualization
- Sonner 2.0 - Toast notifications
Backend Stack
Core Technologies
Core Technologies
- Express 5.2.1 - Web application framework
- Prisma 6.18 - Next-generation ORM
- PostgreSQL - Relational database
- TypeScript 5.9 - Type-safe backend code
Security & Auth
Security & Auth
- JWT (jsonwebtoken 9.0.2) - Stateless authentication
- Bcrypt 3.0.3 - Password hashing
- Helmet 8.1 - HTTP header security
- CORS 2.8 - Cross-origin resource sharing
- Express Rate Limit 8.2 - Rate limiting protection
Integrations
Integrations
- Cloudinary 2.8 - Image CDN
- MercadoPago 2.11 - Payment gateway
- Google Auth Library 10.5 - OAuth integration
- Resend 6.6 - Transactional email
- Node-cron 4.2 - Background job scheduler
Key Features
Comprehensive Admin Dashboard
Full CRUD operations, analytics, charts, and support ticket management
Deployment Architecture
Frontend Deployment
- Platform: Vercel
- Features: Edge functions, preview deployments
- CDN: Global edge network
- Analytics: Built-in web analytics
Backend Deployment
- Platform: Railway
- Services: API + PostgreSQL database
- Monitoring: Sentry error tracking
- Scaling: Automatic container scaling
Development Workflow
Development Ports
| Service | Port | URL |
|---|---|---|
| Frontend (Astro) | 4321 | http://localhost:4321 |
| Backend API | 3002 | http://localhost:3002 |
| Prisma Studio | 5555 | http://localhost:5555 |
Testing Strategy
Unit Testing
Vitest 4.0 for fast unit and integration tests
- Component testing with @testing-library/react
- Store testing with vitest-mock-extended
- Backend service testing
E2E Testing
Playwright 1.57 for end-to-end testing
- Critical user flows (checkout, login)
- Visual regression testing
- Cross-browser compatibility
Monitoring & Observability
Next Steps
Monorepo Structure
Explore the NPM Workspace setup
Frontend Architecture
Learn about Astro and React integration
Backend Architecture
Dive into the Express API structure
Database Schema
Understand the data model