Skip to content

Repository files navigation

PC Forge

Forge your own PC build. A web application for crafting, sharing, and rating custom PC builds. A project for the Databases 2025/26 course.

✨ Features

  • 🔨 Forge custom PC builds from a comprehensive component database
  • 💾 Browse CPUs, GPUs, motherboards, storage, and more
  • ⭐ Rate and review community builds
  • 💬 Suggest new components for the database
  • 👤 User authentication and admin management

🛠️ Tech Stack

  • Frontend: React 19, Material-UI, Emotion
  • Backend: Hono, Node.js
  • Database: PostgreSQL 16
  • ORM: Drizzle ORM
  • Build Tool: Vite
  • Containerization: Docker & Docker Compose

📋 Prerequisites

🚀 Quick Start

1. Clone the Repository

git clone https://github.com/nkvtd/pc-forge.git
cd pc-forge

2. Configure Environment

Copy the example environment file:

cp .env.example .env

Update only the AUTH_SECRET in .env:

DATABASE_URL="postgresql://app:app@db:5432/postgres"
AUTH_SECRET="YOUR_GENERATED_SECRET_KEY_HERE"
PORT=8080

Important: The DATABASE_URL and PORT are pre-configured for Docker. Only change the AUTH_SECRET to a random, secure value (you can generate one using openssl rand -base64 32).

3. Start with Docker

docker compose up --build

The application will automatically:

  • ✅ Start PostgreSQL database on port 5432
  • ✅ Run database migrations
  • ✅ Seed initial data (users, components, builds)
  • ✅ Start the web server on port 8080

Access the application at: http://localhost:8080

⚙️ Pre-configured Settings

The following settings are pre-configured for Docker and should not be changed unless you know what you're doing:

  • Database Host: db (Docker service name)
  • Database Port: 5432
  • Database Name: postgres
  • Database User: app
  • Database Password: app
  • Application Port: 8080

💻 Development

Local Development (Without Docker)

Install dependencies

npm install

Update DATABASE_URL in .env to use localhost

DATABASE_URL="postgresql://app:app@localhost:5432/postgres"

Run database migrations

npm run drizzle:migrate

Seed database

npm run drizzle:seed

Start development server

npm run dev

📁 Project Structure

pc-forge/
├── database/
│ └── drizzle/
│ ├── schema/ # Database schema definitions
│ ├── queries/ # Database queries
│ └── util/
│ └── seed.ts # Database seeding script
├── dist/ # Built application
├── migrations/ # Generated database migrations
├── pages/ # Vike pages
├── server/ # Backend server code
├── Dockerfile # Docker image configuration
├── docker-compose.yml # Docker services orchestration
├── docker-entrypoint.sh # Container startup script
├── drizzle.config.ts # Drizzle ORM configuration
├── .env.example # Example environment variables
└── package.json

👥 Default Users

After the database is seeded, you can log in with these accounts:

Username Password Role
admin admin Admin
tome tg User
mihail mn User
stefan sv User
pc_wizard pw User
budget_king bk User
rgb_lover rgb User
streamer_pro sp User
office_guy og User
linux_fan lf User
first_timer ft User

🔧 Environment Variables

Variable Description Default Should Change?
DATABASE_URL PostgreSQL connection string postgresql://app:app@db:5432/postgres ❌ No (pre-configured)
AUTH_SECRET Authentication secret key - Yes (required)
PORT Application port 8080 ❌ No (pre-configured)

📚 Course Information

This project was developed for the Databases 2025/26 course. It demonstrates:

  • Complex relational database design with PostgreSQL
  • Database migrations and seeding
  • ORM usage (Drizzle ORM)
  • Full-stack web application development
  • Containerization with Docker

📄 License

MIT License

About

Project for Databases 2025/26 course

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages