Skip to content

ktrubilo9/pcassembler

Repository files navigation

PCAssembler

PCAssembler is a web application for building custom PC configurations. It lets users choose components, check hardware compatibility, save and share configurations, manage a cart and place orders. The application also includes an admin panel for component management, analytics and report export.

Features

  • PC configuration builder with component selection.
  • Compatibility checks for CPU, GPU, motherboard, memory, storage, cooler, case and PSU.
  • Compatibility-based filters and validation messages.
  • User registration, login and JWT-based sessions.
  • User dashboard with saved configurations, orders, addresses and statistics.
  • Shareable configuration pages.
  • Cart, checkout and order flow.
  • Password reset by email.
  • Admin dashboard for component management, configuration preview, analytics and CSV reports.
  • Unit tests for compatibility rules.

Tech Stack

  • Next.js 15 with App Router
  • React 18
  • TypeScript
  • Sass modules
  • Supabase
  • JWT with jose
  • bcrypt
  • Nodemailer
  • Vitest
  • Recharts
  • React Bootstrap

Project Structure

src/app
  api/                         API routes
  components/                  UI and feature components
  lib/auth/                    JWT and auth helpers
  lib/supabase/                Supabase clients
  types/                       Shared TypeScript types
  images/                      Application images

test/compatibility             Unit tests for compatibility rules

Getting Started

Requirements

  • Node.js 20 LTS recommended
  • npm
  • Supabase project
  • SMTP/email account for password reset emails

Installation

npm ci

Environment Variables

Create a .env file in the project root. Use .env.example as the starting point.

macOS/Linux:

cp .env.example .env

Required variables:

SUPABASE_URL=
SUPABASE_KEY=

JWT_SECRET=
JWT_REFRESH_SECRET=
NODE_ENV=development

EMAIL_USER=
EMAIL_PASS=

BASE_URL=http://localhost:3000/
PASSWORD_RESET_URL=http://localhost:3000/password-reset?token={token}&email={email}

SECRET_KEY=

Optional server-only variable:

SUPABASE_SERVICE_ROLE_KEY=

Database

The application uses Supabase as its database layer. The repository includes a sanitized database export split into two files:

  • database/schema.sql - database schema only, without table data.
  • database/seed.sql - catalog and lookup data needed by the app, without private user-owned data.

The seed file includes component categories, component models, parts, specifications, delivery options and payment methods. It intentionally excludes users, addresses, carts, orders, saved configurations and password reset tokens.

Run the files in this order on an empty development Supabase database:

psql "$DATABASE_URL" -f database/schema.sql
psql "$DATABASE_URL" -f database/seed.sql

database/schema.sql contains DROP statements from the database dump, so do not run it against a database you want to keep.

Main tables used by the app:

  • users - account data, roles, password hashes and profile fields.
  • addresses - user shipping addresses.
  • parttypes - component categories such as CPU, GPU, Memory or Case.
  • partmodels - component model metadata, brand, description and release date.
  • parts - sellable component entries with price, stock, image and rating.
  • specifications - specification definitions for component types.
  • partspecifications - specification values assigned to parts.
  • configurations - saved PC builds owned by users.
  • configurationitems - parts and quantities inside saved configurations.
  • carts - active and completed user carts.
  • cartitems - configurations added to carts.
  • orders - placed orders.
  • deliveryoptions - available delivery methods.
  • paymentmethods - available payment methods.
  • password-reset-tokens - password reset tokens and creation dates.

Important relationships:

  • users.user_id is referenced by addresses, configurations, carts and orders.
  • parttypes.part_type_id is referenced by partmodels and specifications.
  • partmodels.part_model_id is referenced by parts.
  • parts.part_id is referenced by partspecifications and configurationitems.
  • configurations.configuration_id is referenced by configurationitems and cartitems.
  • carts.cart_id is referenced by cartitems and orders.
  • orders references users, carts, addresses, delivery options and payment methods.

For a public deployment, configure Supabase Row Level Security policies for user-owned data and keep service-role keys server-only.

Development

npm run dev

Open http://localhost:3000.

Production Build

npm run build
npm start

Linting

npm run lint

Tests

Run the compatibility test suite once:

npx vitest run

Contributors

  • Konrad Trubiło - authentication with JWT, middleware, configuration builder, compatibility rules, filters, tests and cart-related API work.
  • Damian Turek - base backend, login and registration flow, password reset, user panel, shared configurations and UI fixes.
  • Mikołaj Olszewski - landing page, user dashboard, address management, order and transaction flow, payment/delivery views and email styling.
  • Kacper Domalewski - admin panel, component management, statistics, configuration preview, analytics and CSV report export.

About

Team-built Next.js app for building PC configurations with hardware compatibility checks, saved builds, cart/order flow, sharing, and an admin dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors