- 🎥 Full Project Video Series
- 🧠 Architecture Overview
- 📦 Monorepo Structure
- ⚙️ Prerequisites
- 🔐 Environment Variables Guide
- 🧪 Install Dependencies
▶️ Run Project Locally- 🏗 Build Project
- 🧹 Clean Project
- 🗄 Database Migration Guide
- 🌱 Seed Database
- 🚀 Deployment Guide
- Shared Packages
- Available Root Commands
- 🤝 Contribution Guide
- License
If you want a complete understanding of the project architecture, setup, and implementation, watch these videos first:
▶️ Part 1: https://youtu.be/942PSbDTXgo▶️ Part 2: https://youtu.be/7qP-xAnQhLc▶️ Part 3: https://youtu.be/TH5K2ebqar8▶️ Final Part: https://youtu.be/_-w6VZlO30Y▶️ Deployment: https://youtu.be/IVfM_tpFlUc?si=yBByGfgD3qvSgiHk
A full-stack monorepo project built with pnpm workspace, featuring:
- Backend: Express + TypeORM + PostgreSQL + Redis
- Frontend: Vite + TypeScript + Tanstack Router + Tanstack Query
- Shared packages: Definitions & Logger
- Documentation: Docusaurus
- Deployment-ready architecture
This project follows:
- Monorepo architecture
- Shared packages pattern
- Scalable backend structure
- Workspace dependency linking
Benefits:
- Code reuse
- Type safety across frontend/backend
- Faster builds
- Easier maintenance
This project uses pnpm workspace to manage multiple apps and shared packages.
code-tode/
│
├── backend/ # Express backend API
├── frontend/ # Vite frontend app
├── doc/ # Documentation (Docusaurus)
│
├── packages/
│ ├── definitions/ # Shared types, schemas, constants
│ └── logger/ # Shared logging utility
│
├── pnpm-workspace.yaml
├── package.json
└── README.md
Install these before running locally:
- Node.js ≥ 18
- pnpm ≥ 9
- PostgreSQL (or NeonDB)
- Redis (local or RedisCloud)
- GitHub OAuth App
- LemonSqueezy account (for payments)
Install pnpm if not installed:
npm install -g pnpm
You must create .env files for both backend and frontend.
Create:
backend/.env
Example:
NODE_ENV=development
SERVER_PORT=8000
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=password
DB_NAME=code_tode
# OR use NeonDB
# NEON_DB_CONNECTION_STRING=postgres://...
REDIS_URL=redis://localhost:6379
FRONTEND_URL=http://localhost:5173
GITHUB_CALLBACK_URL=http://localhost:8000/api/auth/github/callback
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
JWT_SECRET=super_secret_key
ACCESS_TOKEN_EXPIRES_IN=15m
REFRESH_TOKEN_EXPIRES_IN=7d
MAX_DEVICES_PER_USER=3
LS=your_lemonsqueezy_api_key
LS_WEBHOOK_SECRET=your_webhook_secret
COURSES_PATH="/course"
Local PostgreSQL:
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=yourpassword
DB_NAME=yourdb
Cloud option: NeonDB https://neon.tech
Copy connection string → use as:
NEON_DB_CONNECTION_STRING=
Local:
REDIS_URL=redis://localhost:6379
Cloud option: RedisCloud https://redis.com
Go to:
https://github.com/settings/developers
Create OAuth App:
Callback URL:
http://localhost:8000/api/auth/github/callback
Copy:
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
Get:
- API Key
- Webhook secret
In the /course folder you can put any course content in .md file which will be visible in the admin panel to link with your lesson as lesson content
Create:
frontend/.env
VITE_API_URL=http://localhost:8000/api
This connects frontend → backend.
From root folder:
pnpm install
Run everything:
pnpm dev:all
Or run individually:
Backend:
pnpm dev:backend
Frontend:
pnpm dev:frontend
Packages watch mode:
pnpm dev:packages
Build everything:
pnpm build
Build specific:
pnpm build:definitions
pnpm clean
Create migration:
pnpm --filter backend migration:create
Generate migration:
pnpm --filter backend migration:generate
Run migration:
pnpm --filter backend migration:run
Revert migration:
pnpm --filter backend migration:revert
Seed data:
pnpm --filter backend seed
Generate seed data:
pnpm --filter backend seed:generate
Clean seed data:
pnpm --filter backend seed:clean
Verify seed:
pnpm --filter backend seed:verify
You need accounts on:
- NeonDB
- RedisCloud
- Render
- Netlify
- LemonSqueezy
- GitHub
Build Command:
pnpm install && pnpm -r --filter "./packages/*" --filter backend build
Start Command:
pnpm --filter backend start
Set environment variables in Render dashboard.
Make sure add this value in render env to get markdown content list:
COURSES_PATH=/opt/render/project/src/backend/course
Build Command:
pnpm install && pnpm -r --filter "./packages/*" build && pnpm --filter frontend build
Publish directory:
frontend/dist
Set environment variable:
VITE_API_URL=https://your-backend-url/api
Create project → copy connection string → use:
NEON_DB_CONNECTION_STRING=
Create Redis instance → copy URL:
REDIS_URL=
Packages are automatically linked using pnpm workspace:
@packages/definitions
@packages/logger
Build shared packages:
pnpm -r --filter "./packages/*" build
pnpm dev:backend
pnpm dev:frontend
pnpm dev:packages
pnpm dev:all
pnpm build
pnpm clean
We welcome contributions!
Describe:
- Bug
- Feature
- Improvement
git checkout -b feature/your-feature-name
Follow project structure.
Include:
- Proper description
- Screenshots or video of changes
- Explain what you changed
For discussion and sync:
ISC License © 2025-present | CodeTode build with 💚 by Hasan