source: README.md@ 3a9c59c

main
Last change on this file since 3a9c59c was 5a1bf39, checked in by Tome <gjorgievtome@…>, 7 months ago

Update README.md

  • Property mode set to 100644
File size: 4.4 KB
Line 
1# PC Forge
2
3**Forge your own PC build.** A web application for crafting, sharing, and rating custom PC builds. A project for the **Databases 2025/26** course.
4
5## ✨ Features
6
7- 🔨 Forge custom PC builds from a comprehensive component database
8- 💾 Browse CPUs, GPUs, motherboards, storage, and more
9- ⭐ Rate and review community builds
10- 💬 Suggest new components for the database
11- 👤 User authentication and admin management
12
13## 🛠️ Tech Stack
14
15- **Frontend**: React 19, Material-UI, Emotion
16- **Backend**: Hono, Node.js
17- **Database**: PostgreSQL 16
18- **ORM**: Drizzle ORM
19- **Build Tool**: Vite
20- **Containerization**: Docker & Docker Compose
21
22## 📋 Prerequisites
23
24- [Docker Desktop](https://www.docker.com/products/docker-desktop) (latest version)
25- Docker Compose V2 (included with Docker Desktop)
26- [Node.js 20+](https://nodejs.org/) (optional, for local development)
27- [npm](https://www.npmjs.com/)
28
29## 🚀 Quick Start
30
31### 1. Clone the Repository
32```agsl
33git clone https://github.com/nkvtd/pc-forge.git
34cd pc-forge
35```
36
37### 2. Configure Environment
38
39**Copy the example environment file:**
40```agsl
41cp .env.example .env
42```
43**Update only the AUTH_SECRET in `.env`:**
44```agsl
45DATABASE_URL="postgresql://app:app@db:5432/postgres"
46AUTH_SECRET="YOUR_GENERATED_SECRET_KEY_HERE"
47PORT=8080
48```
49> **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`).
50
51### 3. Start with Docker
52```agsl
53docker compose up --build
54```
55
56The application will automatically:
57- ✅ Start PostgreSQL database on port **5432**
58- ✅ Run database migrations
59- ✅ Seed initial data (users, components, builds)
60- ✅ Start the web server on port **8080**
61
62**Access the application at: http://localhost:8080**
63
64## ⚙️ Pre-configured Settings
65
66The following settings are pre-configured for Docker and should **not** be changed unless you know what you're doing:
67
68- **Database Host**: `db` (Docker service name)
69- **Database Port**: `5432`
70- **Database Name**: `postgres`
71- **Database User**: `app`
72- **Database Password**: `app`
73- **Application Port**: `8080`
74
75## 💻 Development
76
77### Local Development (Without Docker)
78**Install dependencies**
79```agsl
80npm install
81```
82**Update DATABASE_URL in .env to use localhost**
83```agsl
84DATABASE_URL="postgresql://app:app@localhost:5432/postgres"
85```
86**Run database migrations**
87```agsl
88npm run drizzle:migrate
89```
90
91**Seed database**
92```agsl
93npm run drizzle:seed
94```
95
96**Start development server**
97```agsl
98npm run dev
99```
100
101## 📁 Project Structure
102```agsl
103pc-forge/
104├── database/
105│ └── drizzle/
106│ ├── schema/ # Database schema definitions
107│ ├── queries/ # Database queries
108│ └── util/
109│ └── seed.ts # Database seeding script
110├── dist/ # Built application
111├── migrations/ # Generated database migrations
112├── pages/ # Vike pages
113├── server/ # Backend server code
114├── Dockerfile # Docker image configuration
115├── docker-compose.yml # Docker services orchestration
116├── docker-entrypoint.sh # Container startup script
117├── drizzle.config.ts # Drizzle ORM configuration
118├── .env.example # Example environment variables
119└── package.json
120```
121
122
123## 👥 Default Users
124
125After the database is seeded, you can log in with these accounts:
126
127| Username | Password | Role |
128|----------|----------|------|
129| admin | admin | Admin |
130| tome | tg | User |
131| mihail | mn | User |
132| stefan | sv | User |
133| pc_wizard | pw | User |
134| budget_king | bk | User |
135| rgb_lover | rgb | User |
136| streamer_pro | sp | User |
137| office_guy | og | User |
138| linux_fan | lf | User |
139| first_timer | ft | User |
140
141## 🔧 Environment Variables
142
143| Variable | Description | Default | Should Change? |
144|----------|-------------|---------|----------------|
145| `DATABASE_URL` | PostgreSQL connection string | `postgresql://app:app@db:5432/postgres` | ❌ No (pre-configured) |
146| `AUTH_SECRET` | Authentication secret key | - | ✅ **Yes (required)** |
147| `PORT` | Application port | `8080` | ❌ No (pre-configured) |
148
149# 📚 Course Information
150
151This project was developed for the Databases 2025/26 course. It demonstrates:
152
153- Complex relational database design with PostgreSQL
154- Database migrations and seeding
155- ORM usage (Drizzle ORM)
156- Full-stack web application development
157- Containerization with Docker
158
159# 📄 License
160
161MIT License
Note: See TracBrowser for help on using the repository browser.