Skip to content

bagusardin25/SkillBridge-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

130 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ‰ SkillBridge

AI-Powered Learning Roadmap Generator β€” Describe your goal, and AI builds a personalized, interactive learning path complete with resources, quizzes, and an AI tutor.

TypeScript React Node.js PostgreSQL Vite TailwindCSS


πŸ“Έ Screenshots

AI-Generated Roadmap Node Details & Resources

AI Tutor Chat Quiz System


✨ Features

πŸ€– AI-Powered Roadmap Generation

  • Describe your learning goal in natural language
  • AI generates a structured, multi-node learning path with branching topics
  • Dual AI providers: OpenAI GPT-4o-mini (primary) with Google Gemini fallback
  • Automatic retry with validation to ensure quality output

πŸ—ΊοΈ Interactive Visual Flowchart

  • Powered by React Flow (xyflow) β€” a node-based visual canvas
  • Drag, zoom, pan, and reorganize your learning path
  • Auto-layout with custom edge styles and node components
  • Custom node types: topic nodes, milestone nodes

πŸ“š Curated Learning Resources

  • Auto-enriched nodes with YouTube videos, Dev.to articles, and documentation links
  • In-memory caching for fast resource lookup
  • YouTube Data API v3 integration for video thumbnails and metadata

πŸ’¬ AI Tutor Chat

  • Context-aware chat per node β€” click any topic to dive deeper
  • Full-screen and side-panel chat modes
  • Streaming responses (SSE) with markdown rendering and syntax highlighting
  • Persistent chat history stored in database

πŸ“ Quiz System

  • AI-generated 5-question quizzes per topic
  • Auto-grading with 90% pass threshold
  • Full-screen distraction-free quiz mode with timer
  • Passing a quiz auto-marks the node as completed

πŸ“Š Progress & Gamification

  • XP & Leveling β€” earn XP for completing quizzes and activities
  • Daily Streaks β€” consecutive day tracking with longest streak record
  • Learning Time β€” automatic time tracking per session
  • Completion Stats β€” visual progress bar per roadmap

πŸ” Authentication & Security

  • Email/password registration with email verification
  • OAuth 2.0 β€” Google and GitHub social login
  • JWT-based session management with auto-refresh
  • Helmet.js security headers
  • Rate limiting on auth and AI endpoints
  • Role-based access (USER, ADMIN, MODERATOR)

🌐 Internationalization

  • Full English and Bahasa Indonesia support
  • Language selection persisted across sessions

🎨 UI/UX

  • Dark/Light mode with smooth transitions
  • Responsive design (mobile, tablet, desktop)
  • Animated landing page with scroll reveals, typewriter effects, and 3D tilt cards
  • Toast notifications via Sonner
  • Error boundary with graceful fallback UI
  • Loading skeleton components

πŸš€ Quick Start

Prerequisites

Tool Version Required
Node.js v18+ βœ…
PostgreSQL v14+ βœ…
OpenAI API Key β€” βœ…
Google Gemini API Key β€” Optional (fallback)
YouTube Data API Key β€” Optional (for video resources)

Installation

# 1. Clone repository
git clone https://github.com/yourusername/SkillBridge.git
cd SkillBridge

# 2. Install all dependencies
npm install
cd server && npm install && cd ..

# 3. Setup environment variables
cp server/.env.example server/.env
# Edit server/.env with your credentials (see section below)

# 4. Setup database
npm run db:push       # Push schema to database
npm run db:generate   # Generate Prisma client

# 5. Start development server (frontend + backend concurrently)
npm run dev

Open http://localhost:5173 πŸŽ‰

The frontend runs on port 5173 (Vite) and the backend API on port 3001 (Express).


πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React 19 + TypeScript UI framework
Vite Build tool & dev server
TailwindCSS Utility-first styling
shadcn/ui + Radix UI Accessible component library
React Flow (xyflow) Interactive node-based flowchart canvas
Zustand Lightweight state management
React Markdown + Prism.js Markdown rendering with syntax highlighting
Sonner Toast notifications
Lucide React Icon library

Backend

Technology Purpose
Express + TypeScript REST API server
Prisma ORM Type-safe database access
PostgreSQL Relational database
OpenAI SDK GPT-4o-mini for roadmap/quiz/chat generation
Google Generative AI Gemini fallback provider
JWT (jsonwebtoken) Authentication tokens
bcryptjs Password hashing
Helmet HTTP security headers
express-rate-limit API rate limiting
Pino + pino-pretty Structured JSON logging
Nodemailer Email verification & password reset
Zod Runtime validation for AI output
Vitest Unit testing framework

Infrastructure

Technology Purpose
Railway Backend hosting & PostgreSQL
Vercel Frontend hosting
GitHub Actions CI pipeline (type check + tests)

πŸ“ Project Structure

SkillBridge/
β”œβ”€β”€ public/
β”‚   └── screenshots/                # App screenshots for README
β”‚
β”œβ”€β”€ src/                            # ── Frontend (React + Vite) ──
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ canvas/                 # FlowCanvas, node interaction
β”‚   β”‚   β”œβ”€β”€ chat/                   # ChatPanel, MarkdownRenderer
β”‚   β”‚   β”œβ”€β”€ edges/                  # Custom React Flow edge types
β”‚   β”‚   β”œβ”€β”€ landing/                # Landing page sub-components
β”‚   β”‚   β”œβ”€β”€ layout/                 # AppLayout, Sidebar, Header
β”‚   β”‚   β”œβ”€β”€ nodes/                  # Custom React Flow node types
β”‚   β”‚   β”œβ”€β”€ quiz/                   # QuizFullScreen, QuizPanel
β”‚   β”‚   β”œβ”€β”€ roadmap/                # RoadmapSettings, ShareDialog
β”‚   β”‚   β”œβ”€β”€ ui/                     # Button, Input, Skeleton, Logo...
β”‚   β”‚   β”œβ”€β”€ ErrorBoundary.tsx       # Global error fallback UI
β”‚   β”‚   └── ProtectedRoute.tsx      # Auth guard wrapper
β”‚   β”‚
β”‚   β”œβ”€β”€ contexts/                   # React contexts (Language)
β”‚   β”œβ”€β”€ hooks/                      # Custom hooks (useLearningTimeTracker)
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ api.ts                  # REST API client (authFetch, CRUD)
β”‚   β”‚   β”œβ”€β”€ translations.ts         # i18n translation loader
β”‚   β”‚   β”œβ”€β”€ appTranslations.ts      # EN/ID translation strings
β”‚   β”‚   └── utils.ts                # Utility functions
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/                      # Route-level page components
β”‚   β”‚   β”œβ”€β”€ LandingPage.tsx         # Public marketing page
β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx           # Email + OAuth login
β”‚   β”‚   β”œβ”€β”€ RegisterPage.tsx        # Registration with confirm password
β”‚   β”‚   β”œβ”€β”€ ProfilePage.tsx         # User profile, stats, streaks
β”‚   β”‚   β”œβ”€β”€ SettingsPage.tsx        # Account settings
β”‚   β”‚   β”œβ”€β”€ SharePage.tsx           # Public shared roadmap view
β”‚   β”‚   └── ...                     # ForgotPassword, ResetPassword, etc.
β”‚   β”‚
β”‚   └── store/                      # Zustand stores
β”‚       β”œβ”€β”€ useAuthStore.ts         # Auth state (user, token)
β”‚       └── useRoadmapStore.ts      # Roadmap, theme, UI state
β”‚
β”œβ”€β”€ server/                         # ── Backend (Express + Prisma) ──
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma           # Database schema (6 models)
β”‚   β”‚   └── seed.ts                 # Database seeder
β”‚   β”‚
β”‚   └── src/
β”‚       β”œβ”€β”€ routes/
β”‚       β”‚   β”œβ”€β”€ auth.ts             # Login, register, OAuth, verify, reset
β”‚       β”‚   β”œβ”€β”€ chat.ts             # AI chat (streaming SSE + non-streaming)
β”‚       β”‚   β”œβ”€β”€ roadmap.ts          # Generate, save, load, share roadmaps
β”‚       β”‚   β”œβ”€β”€ project.ts          # CRUD project management
β”‚       β”‚   β”œβ”€β”€ quiz.ts             # Generate quizzes, submit answers
β”‚       β”‚   β”œβ”€β”€ profile.ts          # User stats, streaks, XP, avatar
β”‚       β”‚   └── notes.ts            # Per-node note CRUD
β”‚       β”‚
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ ai.ts               # OpenAI + Gemini abstraction layer
β”‚       β”‚   β”œβ”€β”€ oauth.ts            # Google & GitHub OAuth handlers
β”‚       β”‚   β”œβ”€β”€ email.ts            # Nodemailer templates
β”‚       β”‚   └── resourceEnricher.ts # YouTube + Dev.to resource fetcher
β”‚       β”‚
β”‚       β”œβ”€β”€ middleware/
β”‚       β”‚   └── auth.ts             # JWT verification middleware
β”‚       β”‚
β”‚       β”œβ”€β”€ lib/
β”‚       β”‚   β”œβ”€β”€ prisma.ts           # Prisma client singleton
β”‚       β”‚   β”œβ”€β”€ logger.ts           # Pino structured logger
β”‚       β”‚   └── businessLogic.ts    # Pure functions (streak, XP, quiz scoring)
β”‚       β”‚
β”‚       └── __tests__/
β”‚           β”œβ”€β”€ auth.test.ts        # Auth middleware tests (6 tests)
β”‚           └── businessLogic.test.ts # Streak, XP, quiz scoring (19 tests)
β”‚
β”œβ”€β”€ .github/workflows/
β”‚   └── ci.yml                      # GitHub Actions CI pipeline
β”‚
└── README.md

πŸ”‘ Environment Variables

Create server/.env with the following:

# ── Database ────────────────────────────────────
DATABASE_URL="postgresql://user:password@localhost:5432/skillbridge"

# ── AI Providers ────────────────────────────────
OPENAI_API_KEY="sk-..."                    # Required β€” GPT-4o-mini
GEMINI_API_KEY="AIza..."                   # Optional β€” Gemini fallback

# ── Authentication ──────────────────────────────
JWT_SECRET="your-random-secret-string"     # Required β€” JWT signing key

# ── OAuth (optional) ────────────────────────────
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."
GITHUB_CLIENT_ID="..."
GITHUB_CLIENT_SECRET="..."

# ── Frontend URL (for OAuth callback) ───────────
FRONTEND_URL="http://localhost:5173"

# ── Email (optional β€” for verification) ─────────
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"

# ── YouTube (optional β€” for video resources) ────
YOUTUBE_API_KEY="AIza..."

πŸ“¦ Available Scripts

Root (frontend + full stack)

Command Description
npm run dev Start both frontend (Vite) and backend (Express) concurrently
npm run dev:frontend Start Vite dev server only
npm run dev:backend Start Express dev server only
npm run build Build frontend for production
npm run preview Preview production build locally
npm run lint Run ESLint
npm run db:push Push Prisma schema to database
npm run db:generate Generate Prisma client
npm run db:migrate Run Prisma migrations
npm run db:studio Open Prisma Studio (DB GUI)

Server

Command Description
npm run dev Start backend with hot-reload (tsx watch)
npm run build Compile TypeScript to dist/
npm run start Run compiled server (node dist/index.js)
npm test Run unit tests (Vitest)
npm run test:watch Run tests in watch mode

πŸ§ͺ Testing

Unit Tests (Vitest)

cd server
npm test

25 tests across 2 test suites:

Suite Tests Covers
auth.test.ts 6 JWT middleware (missing token, invalid token, expired token, user not found, valid flow)
businessLogic.test.ts 19 Streak calculation, XP/Level math, quiz scoring/pass threshold

CI Pipeline (GitHub Actions)

Runs automatically on every push to main and on pull requests:

  1. Frontend TypeScript type check
  2. Backend TypeScript type check
  3. Prisma client generation
  4. Unit test execution

πŸ—„οΈ Database Schema

The app uses 6 Prisma models:

User ──────── 1:N ──── Project ──── 1:N ──── Roadmap
                                                β”‚
                                     QuizResult β”€β”˜
                                     ChatMessage β”€β”˜
                                     NodeNote β”€β”€β”€β”€β”˜
Model Purpose
User Auth, profile, XP/level, streaks, OAuth fields
Project Groups roadmaps under a named project
Roadmap React Flow nodes/edges stored as JSON, shareable
QuizResult Quiz answers, score, pass/fail per node per user
ChatMessage Chat history per project or per node
NodeNote User notes attached to specific roadmap nodes

🚒 Deployment

Backend (Railway)

  1. Connect your GitHub repo to Railway
  2. Set the root directory to server
  3. Railway auto-detects the Dockerfile or uses Nixpacks
  4. Add all environment variables in Railway dashboard
  5. Railway provides a PostgreSQL add-on for the database

Frontend (Vercel)

  1. Connect your GitHub repo to Vercel
  2. Set VITE_API_URL to your Railway backend URL (e.g. https://your-app.up.railway.app/api)
  3. Deploy β€” Vercel auto-detects Vite

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License β€” feel free to use for your own projects!


Built with ❀️ for Education & Upskilling

About

AI-Based Learning Web App Roadmap

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages