Skip to content

maruf-pfc/build-to-learn

🧱 Build to Learn

A modern, adaptive, and project-based learning platform designed for developers. Built using a monorepo architecture with Turborepo, this platform features multiple apps (web, dashboard, blog, forum, docs, API) and a shared UI component library.

Project Demo

πŸš€ Live: https://build-to-learn-web.vercel.app

πŸ“¦ Monorepo Structure

This project uses Turborepo to manage multiple apps and packages.

App Structure

apps/
β”œβ”€β”€ web # Main landing & learning platform (Next.js)
β”œβ”€β”€ dashboard # Instructor/admin panel (Next.js)
β”œβ”€β”€ blog # Developer blog (Next.js)
β”œβ”€β”€ forum # Community Q\&A (Next.js)
β”œβ”€β”€ docs # Platform documentation (Vuepress)
└── api # Backend API service (Nest.js)

configs/
β”œβ”€β”€ eslint-config # Shared ESLint config
└── typescript-config # Shared TypeScript configs

packages/
└──ui # Shared UI components (ShadCN + Tailwind)

πŸ› οΈ Tech Stack

  • 🧠 Next.js 15 (App Router)
  • βš™οΈ Nest.js (Backend API)
  • πŸ–ŒοΈ Tailwind CSS + ShadCN UI
  • πŸ—ƒοΈ PostgreSQL (Supabase) (via Prisma)
  • πŸ§ͺ Jest + Supertest (Testing)
  • 🐳 Docker (for DB & CI/CD)
  • ☁️ GitHub Actions (CI)
  • 🌐 Vercel (Deployment)

πŸš€ Getting Started

Ensure you have PNPM, Node.js (>=22.x), and Docker installed.

1. Clone the repository

git clone https://github.com/maruf-pfc/build-to-learn.git
cd build-to-learn

2. Install dependencies

pnpm install

πŸ’‘ If you face issues, try: pnpm install --no-frozen-lockfile

3. Setup Environment Variables

Create .env files in relevant apps:

For apps/api/.env:

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/build_to_learn_db
JWT_SECRET=your_secret_here

For apps/web/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:3001

4. Start PostgreSQL with Docker

docker compose up -d

⚠️ Make sure port 5432 is not already in use on your machine.

Stop the Docker containers

docker compose down

Rebuild and start Docker in development mode

docker compose up --build

5. Push Prisma Schema (API)

pnpm --filter api prisma db push

6. Start Development Servers

pnpm dev

Starts all apps concurrently (via Turborepo). You can also run each app individually:

pnpm --filter web dev
pnpm --filter api dev

πŸ§ͺ Running Tests

To run backend tests:

pnpm --filter api test

πŸ” Code Quality

  • Format code:
pnpm format
  • Lint code:
pnpm lint

πŸ“¦ Building for Production

pnpm build

🌍 Deployment

  • Web apps (web, dashboard, etc.) are deployed via Vercel.
  • Backend (api) can be deployed via Render, Railway, or Docker VPS.

πŸ“ Useful Scripts

pnpm dev                # Start all apps for development
pnpm build              # Build all apps
pnpm lint               # Run ESLint across all packages
pnpm format             # Run Prettier
pnpm test               # Run all tests (API)

🀝 Contributing

We welcome contributions! Feel free to:

  • Open issues
  • Suggest features
  • Submit pull requests

πŸ“„ License

Apache License

About

πŸ“š An project based learning platform focused on real-world projects.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •