Complete step-by-step guide to set up the ML Engineer RoadMap web application locally.
- Prerequisites
- Quick Start
- Detailed Installation
- Environment Configuration
- Database Setup
- Running the Application
- Creating Admin User
- Project Structure
- Available Commands
- Troubleshooting
Before starting, ensure you have the following installed on your system:
-
Node.js (v18.17.0 or higher)
- Download: https://nodejs.org/
- Check version:
node --version
-
pnpm (v8.0.0 or higher)
- Install globally:
npm install -g pnpm - Check version:
pnpm --version
- Install globally:
-
Git
- Download: https://git-scm.com/
- Check version:
git --version
- PostgreSQL (v14.0 or higher) - for production database
- Download: https://www.postgresql.org/download/
For experienced developers who want to get started quickly:
# 1. Clone the repository
git clone https://github.com/Ahmet-Ruchan/ML-Engineer-RoadMap.git
cd ML-Engineer-RoadMap
# 2. Install dependencies
pnpm install
# 3. Set up environment variables
cp apps/web/.env.example apps/web/.env.local
# 4. Generate Prisma client and run migrations
cd apps/web
pnpm prisma generate
pnpm prisma migrate dev
# 5. Start the development server
pnpm devOpen http://localhost:3000 in your browser!
# Clone the repository
git clone https://github.com/Ahmet-Ruchan/ML-Engineer-RoadMap.git
# Navigate to the project directory
cd ML-Engineer-RoadMap
# Verify you're on the correct branch
git branchThis project uses pnpm workspaces for monorepo management.
# Install all dependencies for all packages
pnpm installThis will install dependencies for:
apps/web- Main Next.js applicationpackages/db- Prisma database packagepackages/ui- Shared UI components (if any)
Expected output:
Packages: +437
Progress: resolved 437, reused 437, downloaded 0, added 437, done
Done in 8.5s
# Navigate to the web app
cd apps/web
# Copy the example environment file
cp .env.example .env.localOpen apps/web/.env.local and configure the following:
# Database URL (SQLite for development)
DATABASE_URL="file:./dev.db"
# NextAuth Configuration
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-super-secret-key-change-this-in-production"
# Optional: OAuth Providers (GitHub, Google, etc.)
# GITHUB_CLIENT_ID=""
# GITHUB_CLIENT_SECRET=""
# GOOGLE_CLIENT_ID=""
# GOOGLE_CLIENT_SECRET=""Important: Generate a secure NEXTAUTH_SECRET:
# Generate a random secret
openssl rand -base64 32# Make sure you're in apps/web directory
cd apps/web
# Generate Prisma Client
pnpm prisma generate# Run migrations to create database schema
pnpm prisma migrate devYou'll be prompted to name your migration. Example: init
Expected output:
β Enter a name for the new migration: β¦ init
Applying migration `20250116_init`
Your database is now in sync with your schema.
β Generated Prisma Client
To populate your database with sample data:
# Run the seed script
pnpm prisma db seedThis will create:
- Sample tracks (ML Engineer, Data Scientist, etc.)
- Sample phases and topics
- Sample resources and quizzes
- Sample badges
# Open Prisma Studio to view your database
pnpm prisma studioThis opens a browser interface at http://localhost:5555
From the root directory of the project:
# Start all apps in development mode
pnpm devOR from the apps/web directory:
cd apps/web
pnpm devExpected output:
> @ml-roadmap/web@0.1.0 dev
> next dev
β² Next.js 14.0.4
- Local: http://localhost:3000
- Environments: .env.local
β Ready in 5.7s
Open your browser and navigate to:
- English: http://localhost:3000/en
- Turkish: http://localhost:3000/tr
- Auto-detect: http://localhost:3000
Press Ctrl + C in the terminal
-
Open Prisma Studio:
cd apps/web pnpm prisma studio -
Navigate to the
Usermodel -
Click "Add record"
-
Fill in the details:
- email: admin@example.com
- name: Admin User
- password: (You need to hash it - see Method 2)
- role: admin
- emailVerified: (leave null)
-
Click "Save 1 change"
-
Register a new account at http://localhost:3000/en/register
-
Open Prisma Studio:
pnpm prisma studio
-
Find your user in the
Usertable -
Edit the user and change
rolefrom"user"to"admin" -
Save changes
-
Refresh your browser and you'll have admin access!
# Open Prisma Studio
pnpm prisma studio
# Or use SQLite CLI
sqlite3 apps/web/dev.db
# Update user role
UPDATE users SET role = 'admin' WHERE email = 'youremail@example.com';ML-Engineer-RoadMap/
βββ apps/
β βββ web/ # Main Next.js application
β βββ app/ # Next.js 14 App Router
β β βββ [locale]/ # Internationalized routes
β β β βββ (auth)/ # Auth pages (login, register)
β β β βββ admin/ # Admin panel pages
β β β βββ roadmap/ # Public roadmap pages
β β β βββ dashboard/ # User dashboard
β β β βββ profile/ # User profile
β β β βββ badges/ # Badges page
β β β βββ bookmarks/ # Bookmarks page
β β β βββ search/ # Search page
β β β βββ page.tsx # Home page
β β βββ api/ # API routes
β β βββ auth/ # NextAuth endpoints
β β βββ admin/ # Admin CRUD APIs
β β βββ progress/ # Progress tracking
β β βββ badges/ # Badge system
β β βββ bookmarks/ # Bookmarks API
β β βββ notes/ # Notes API
β β βββ search/ # Search API
β βββ components/ # React components
β β βββ ui/ # shadcn/ui components
β β βββ layout/ # Layout components (Navbar, etc.)
β βββ lib/ # Utility functions
β β βββ auth.ts # NextAuth configuration
β β βββ db.ts # Prisma client
β β βββ utils.ts # Utility functions
β βββ locales/ # i18n translations
β β βββ en/ # English translations
β β βββ tr/ # Turkish translations
β βββ public/ # Static assets
β βββ .env.local # Environment variables (create this)
β βββ .env.example # Example environment file
β βββ next.config.js # Next.js configuration
β βββ i18n.ts # i18n configuration
β βββ package.json # Dependencies
βββ packages/
β βββ db/ # Database package
β βββ prisma/
β β βββ schema.prisma # Database schema
β β βββ migrations/ # Database migrations
β βββ package.json
βββ pnpm-workspace.yaml # pnpm workspace config
βββ turbo.json # Turborepo config
βββ package.json # Root package.json
βββ README.md # Main README
βββ INSTALLATION.md # This file
# Install dependencies
pnpm install
# Start all apps in development
pnpm dev
# Build all apps for production
pnpm build
# Run linter
pnpm lint
# Format code
pnpm format# Development
pnpm dev # Start dev server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
# Database
pnpm prisma generate # Generate Prisma Client
pnpm prisma migrate dev # Run migrations (development)
pnpm prisma migrate deploy # Run migrations (production)
pnpm prisma studio # Open Prisma Studio
pnpm prisma db seed # Seed database
pnpm prisma db push # Push schema changes (prototype)
# Testing (if configured)
pnpm test # Run tests
pnpm test:watch # Run tests in watch modeSolution:
# Clean install
rm -rf node_modules apps/*/node_modules packages/*/node_modules
pnpm installSolution 1: Kill the process using port 3000
# macOS/Linux
lsof -ti:3000 | xargs kill -9
# Windows
netstat -ano | findstr :3000
taskkill /PID <PID> /FSolution 2: Use a different port
PORT=3001 pnpm devSolution:
cd apps/web
pnpm prisma generateSolution: Check your DATABASE_URL in .env.local
For SQLite (development):
DATABASE_URL="file:./dev.db"For PostgreSQL (production):
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"Solution: Ensure NEXTAUTH_SECRET is set
# Generate a new secret
openssl rand -base64 32
# Add to .env.local
NEXTAUTH_SECRET="generated-secret-here"Solution: Ensure all pages using hooks have 'use client' directive
Example:
'use client'
import { useTranslations } from 'next-intl'
export default function MyPage() {
const t = useTranslations()
// ...
}Solution: Install pnpm globally
npm install -g pnpm
# Or using corepack (Node.js 16.13+)
corepack enable
corepack prepare pnpm@latest --activateSolution:
# Clean and reinstall
pnpm install
cd apps/web
pnpm prisma generate
cd ../..
pnpm dev- Change NEXTAUTH_SECRET to a strong, random value
- Use PostgreSQL instead of SQLite
- Enable HTTPS (configure NEXTAUTH_URL with https://)
- Set secure cookies in NextAuth configuration
- Review and restrict API route permissions
- Add rate limiting for auth endpoints
- Configure CORS properly
- Use environment variables for all secrets
- Never commit
.env.localto git
- Next.js Documentation: https://nextjs.org/docs
- Prisma Documentation: https://www.prisma.io/docs
- NextAuth.js Documentation: https://next-auth.js.org/
- next-intl Documentation: https://next-intl-docs.vercel.app/
- shadcn/ui Documentation: https://ui.shadcn.com/
If you encounter issues not covered in this guide:
- Check existing issues: GitHub Issues
- Create a new issue: Provide detailed information about your problem
- Discord Community: (Coming soon)
- Email: aruchanavci01@gmail.com
- β Application is running
- π Create an admin user
- π¨ Explore the admin panel
- π Add content (tracks, phases, topics, resources)
- π§ͺ Test all features
- π― Start learning!
Happy Coding! π
Last Updated: November 16, 2025