Platform belajar JavaScript interaktif untuk developer Indonesia
Overview ยท Tech Stack ยท Quick Start ยท Structure ยท API ยท Deployment ยท Roadmap
JSCraft adalah platform EdTech full-stack untuk belajar JavaScript โ dari nol sampai siap kerja. Terinspirasi dari freeCodeCamp, Codecademy, dan Scrimba, dengan UI modern dan konten dalam Bahasa Indonesia.
Dashboard dengan progress tracker, XP system, dan streak calendar
| Belajar | Gamifikasi | Platform |
|---|---|---|
| 42 hari kurikulum terstruktur | Sistem XP, level & streak | Auth JWT + refresh token rotation |
| Live code editor (Monaco) | Kuis interaktif + leaderboard | Role-based access (Student / Admin) |
| Latihan dengan test cases | Verifiable certificates | Dark / Light mode |
| AI coding assistant (Claude) | Dashboard progress visual | Responsive mobile-first |
Live code editor (Monaco)1 ย ยทย Sistem kuis interaktif
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite 5, TypeScript 5 |
| Styling | Tailwind CSS v3 + custom design tokens |
| State | Zustand v4 (persist + devtools) |
| Animation | Framer Motion |
| Editor | Monaco Editor (VS Code engine) |
| Routing | React Router v6 |
| Backend | Node.js 20, Express 4, TypeScript |
| Database | PostgreSQL + Prisma ORM |
| Auth | JWT โ RS256 access token + opaque refresh (httpOnly cookie) |
| Nodemailer (Resend / SMTP) | |
| AI | Anthropic Claude API |
| Monorepo | Turborepo + npm workspaces |
| CI/CD | GitHub Actions โ Vercel (web) + Railway (API) |
- Node.js
>= 20.0.0 - PostgreSQL
>= 15 - npm
>= 10.0.0
git clone https://github.com/Jouqio/JSCraft.git
cd jscraft
npm install# API
cp apps/api/.env.example apps/api/.env
# Web
cp apps/web/.env.example apps/web/.envEdit apps/api/.env dan isi nilai berikut:
DATABASE_URL=postgresql://user:password@localhost:5432/jscraft
JWT_ACCESS_SECRET=<generated-secret>
JWT_REFRESH_SECRET=<generated-secret># Jalankan dua kali โ satu untuk ACCESS, satu untuk REFRESH
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"cd apps/api
npx prisma migrate dev --name init
npx prisma generate
npm run db:seed # Membuat demo users + konten Week 1# Dari root project โ menjalankan web (5173) dan api (3000) sekaligus
npm run dev| Service | URL |
|---|---|
| Web | http://localhost:5173 |
| API | http://localhost:3000/v1 |
| Prisma Studio | http://localhost:5555 |
Jalankan
npm run db:studiountuk membuka Prisma Studio.
| Role | Password | |
|---|---|---|
| Admin | admin@jscraft.dev | Admin@123456 |
| Student | budi@example.com | Student@123 |
jscraft/ # Turborepo monorepo root
โโโ docs/
โ โโโ images/ # Screenshot dan aset README
โ โโโ banner.png
โ โโโ dashboard.png
โ โโโ editor.png
โ โโโ quiz.png
โโโ apps/
โ โโโ web/ # React + Vite frontend (@jscraft/web)
โ โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ ui/ # Button, Input, Badge, Modal, Spinner
โ โ โ โโโ layout/ # Navbar, RootLayout
โ โ โ โโโ editor/ # CodeEditor, ConsoleOutput, RunButton
โ โ โ โโโ lesson/ # QuizBlock
โ โ โ โโโ dashboard/ # ProgressRing, XPBar, StreakCalendar
โ โ โโโ features/ # Feature-specific logic
โ โ โโโ hooks/ # useAuth, useProgress, useEditor, ...
โ โ โโโ lib/ # api.ts, utils.ts, xp.ts, validators.ts
โ โ โโโ pages/ # Route-level page components
โ โ โโโ router/ # Router config + guards
โ โ โโโ store/ # Zustand stores (auth, progress, editor, theme)
โ โ โโโ styles/ # globals.css (Tailwind + design tokens)
โ โ
โ โโโ api/ # Express + Prisma backend (@jscraft/api)
โ โโโ prisma/ # schema.prisma + seed.ts + migrations/
โ โโโ src/
โ โโโ config/ # env.ts (Zod), database.ts (Prisma)
โ โโโ middleware/ # auth.ts, errorHandler.ts, rateLimit.ts, validate.ts
โ โโโ routes/ # auth, courses, progress, quiz, exercises, profile, admin, ai
โ โโโ services/ # authService, xpService, streakService, progressService, emailService
โ โโโ utils/ # response.ts, crypto.ts
โ โโโ server.ts # Express app + graceful shutdown
โ
โโโ packages/
โโโ types/ # Shared TypeScript types (@jscraft/types)
โโโ content/ # Lesson MDX content files (@jscraft/content)
Key models in apps/api/prisma/schema.prisma:
| Model | Description |
|---|---|
User |
Auth, XP, level, streak |
Course โ Lesson |
Content as JSON, starterCode, solutionCode |
Progress |
Per user/lesson, unique constraint |
Quiz โ Question โ QuizAttempt |
Graded answers |
Exercise |
Test cases + submissions |
Achievement โ UserAchievement |
Many-to-many |
Session |
Refresh token store, rotated on each use |
Certificate |
Verifiable via unique code |
Base URL: http://localhost:3000/v1
Auth
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/auth/register |
โ | Register + set refresh cookie |
POST |
/auth/login |
โ | Login + set refresh cookie |
POST |
/auth/refresh |
cookie | Rotate refresh token |
POST |
/auth/logout |
cookie | Revoke session |
GET |
/auth/me |
Bearer | Current user |
Courses & Progress
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/courses |
optional | All published courses |
GET |
/courses/:slug |
optional | Course with lessons |
GET |
/courses/:slug/lessons/:id |
optional | Lesson + quiz + exercises |
POST |
/progress/:lessonId/start |
Bearer | Mark in-progress |
POST |
/progress/:lessonId/complete |
Bearer | Mark complete + award XP |
GET |
/progress |
Bearer | Full progress map |
GET |
/progress/streak |
Bearer | Streak info |
Quiz, Profile & AI
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/quiz/:lessonId |
Bearer | Quiz (answers hidden) |
POST |
/quiz/:id/attempt |
Bearer | Submit + grade answers |
GET |
/quiz/leaderboard |
โ | Top 50 by XP |
GET |
/profile/:username |
optional | Public profile |
PATCH |
/profile |
Bearer | Update own profile |
POST |
/ai/hint |
Bearer | AI hint / explain / review |
Admin
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/admin/stats |
Admin | Platform stats |
GET |
/admin/users |
Admin | Paginated user list |
POST |
/admin/courses |
Admin | Create course |
POST |
/admin/lessons |
Admin | Create lesson |
# Connect GitHub repo ke Vercel, lalu set environment variable:
VITE_API_URL=https://api.jscraft.dev/v1
# Build command: npm run build --filter=@jscraft/web
# Output dir: apps/web/dist# Connect GitHub repo ke Railway
# Set semua env vars dari apps/api/.env.example
# Railway otomatis menjalankan: npm run start --filter=@jscraft/api# Tambahkan PostgreSQL plugin di Railway
# Salin DATABASE_URL ke env vars API service
# Prisma migrations berjalan otomatis via:
# RAILWAY_RUN_UID=0 npx prisma migrate deploy- Passwords โ bcrypt (cost 12)
- JWT โ opaque refresh token in httpOnly cookie; signed access token (15 min)
- Refresh rotation โ setiap penggunaan menghasilkan token pair baru
- Code execution โ iframe sandbox (
allow-scriptsonly, no DOM access) - Rate limiting โ 100 req/15min global, 10 req/15min pada auth routes
- Input validation โ Zod pada semua API endpoints
- SQL injection โ Prisma parameterized queries
- Headers โ Helmet.js (CSP, HSTS, X-Frame-Options)
- CORS โ origin whitelist only
- Monorepo setup (Turborepo)
- Full TypeScript frontend + backend
- Authentication (JWT + refresh rotation)
- Database schema (Prisma + PostgreSQL)
- Week 1 curriculum (7 lessons seeded)
- Lesson page with Monaco editor
- Sandboxed code execution (iframe)
- XP + level gamification
- Streak tracking
- Quiz system with grading
- Dashboard with progress visualization
- Admin panel foundation
- CI/CD (GitHub Actions)
- Migrate all 42 lessons from bootcamp repo
- Exercise test runner (isolated-vm)
- Email verification + reset password flow
- Leaderboard (live updates)
- Certificate PDF generation
- Notes system per lesson
- Bookmarks
- AI coding assistant (Claude API, streaming)
- AI code review
- Community comments per lesson
- Personalized learning path
- Playground sharing (public URLs)
- Multiplayer coding rooms
Contributions are welcome! Silakan buka issue terlebih dahulu untuk mendiskusikan perubahan yang ingin dilakukan.
- Fork repository ini
- Buat feature branch โ
git checkout -b feat/nama-fitur - Commit perubahan โ
git commit -m 'feat: tambahkan fitur x' - Push ke branch โ
git push origin feat/nama-fitur - Buka Pull Request
MIT ยฉ 2026 Jouqio