📌 Table of Contents
- What Is This Project?
- Tech Stack Overview
- Before You Start (VERY IMPORTANT)
- Install Everything (Windows & Linux)
- Clone the Project
- Project Structure Explained
- Environment Variables (.env)
- Database Setup (PostgreSQL + Prisma)
- Running the Project
- Testing That Everything Works
- Daily Git Workflow (NO COLLISIONS)
- Working From a NON‑Existing Folder
- Working From an EXISTING Folder
- Merging Your Work Safely
- Common Mistakes & Fixes
- Golden Rules (READ THIS TWICE)
3Dēx is a completed MVP for a 3D services & asset marketplace with:
Frontend: Next.js + Tailwind
Backend: Node.js + Express
Database: PostgreSQL + Prisma
This document tells you exactly how to become productive without breaking anything.
Frontend -> Next.js (React), Tailwind CSS
Backend -> Node.js, Express
Database -> PostgreSQL
ORM -> Prisma
Storage -> MinIO (S3 Compatible)
Versions -> Git + GitHub
-
Code is shared
-
Database data is NOT shared
-
Storage bucket is NOT shared (local dev)
-
Secrets are NEVER committed
-
We work on branches, not on master
If you don’t understand this yet — it’s okay.
This guide will enforce it for you.
- Install Git
Windows: https://git-scm.com/download/win
Linux:
sudo apt install gitVerify:
git --version- Install Node.js (LTS ONLY)
https://nodejs.org (choose LTS)
Verify:
node -v
npm -v- Install PostgreSQL
Windows: https://www.postgresql.org/download/windows/
Linux:
sudo apt install postgresql postgresql-contribVerify:
psql --version
pg_isreadyExpected:
accepting connections
Note: This is only if you installed PostgreSQL as a service, otherwise you have to start it manually.
- Install MinIO (Optional for local dev, prevents errors)
You can run it via Docker:
docker run -p 9000:9000 -p 9001:9001 minio/minio server /data --console-address ":9001"Or just install the binary.
git clone https://github.com/Schryzon/3Dex.git
cd 3DexIf this works, you are officially a baby developer 👶✨
3Dex/
├─ apps/
│ ├─ frontend/ # Next.js + Tailwind
│ └─ backend/ # Express + Prisma
├─ docs/ # Documentation
├─ dev.md
└─ README.md
❌ Do NOT add random folders
❌ Do NOT put databases here
Copy apps/backend/.env.example to apps/backend/.env.
DATABASE_URL="postgresql://YOUR_USERNAME:YOUR_PASSWORD@localhost:5432/threedex"
PORT=4000
# ... see .env.example for full listCopy apps/frontend/.env.local.example to apps/frontend/.env.local.
NEXT_PUBLIC_API_URL=http://localhost:4000
# ... see .env.local.example for full listFor Docker Compose Only.
Copy .env.docker.example to .env.docker.
This file combines both Backend and Frontend variables for the containerized environment.
🚨 NEVER COMMIT THESE FILES
They are already in .gitignore.
If you're not using PostgreSQL as a service:
pg_ctl start -D "PATH_TO_DATA_FOLDER"The data folder usually comes with the installation. Its path can be invoked via the following environment variable names:
%PGDATA%(Command Prompt)$env:PGDATA(Powershell)$PGDATA(Linux)
Example:
pg_ctl start -D $env:PGDATAThen, from apps/backend:
npm install
npx prisma migrate dev --name init
npx prisma generateIf this succeeds:
-
PostgreSQL is running
-
Prisma is connected
-
You are safe 🟢
If you want to stop PostgreSQL, do:
pg_ctl stopcd apps/backend
npm run devCheck:
http://localhost:4000/health
Expected:
{ "status": "ok" }cd apps/frontend
npm install
npm run devOpen:
http://localhost:3000
Checklist:
[ ] Frontend loads
[ ] Backend /health works
[ ] No red errors
[ ] Prisma migrate ran successfully
If YES → you are fully set up 🎉
git checkout dev
git pull origin dev
git checkout -b feature/your-task-namegit add .
git commit -m "clear description"
git push -u origin feature/your-task-nameIf you never cloned before:
git clone https://github.com/Schryzon/3Dex.git
cd 3Dex
git checkout devThen follow setup steps above.
If you already cloned before:
git checkout dev
git pull origin devThen create your feature branch:
git checkout -b feature/new-taskStep 1: Update dev
git checkout dev
git pull origin devStep 2: Merge dev into your branch
git checkout feature/your-task
git merge devFix conflicts here, not on dev.
Step 3: Merge into dev
git checkout dev
git merge feature/your-task
git push origin devStep 4: Delete branch
git branch -d feature/your-task
git push origin --delete feature/your-taskClean. Safe. Professional.
❌ “Git overwrote my work”
You didn’t commit before pulling.
Fix:
git add .
git commit -m "wip"
git pull❌ “Prisma can’t connect”
Postgres isn’t running or port isn’t 5432.
Fix:
- Check if PostgreSQL is running
pg_isready- If not, start it manually at a certain port (
-p 5432) Example: (Powershell)
pg_ctl -o "-p 5432" start -D $env:PGDATA- ❌ Never code on master
- ✅ Always branch from dev
- ❌ Never commit .env
- ✅ One task = one branch
- ❌ Never share DB data
- ✅ Ask mommy before panicking