The only RPG where your code is your sword.
Conquer bugs, build systems, and become a legend in Neo-Jakarta 2077.
- Real Coding Challenges - Solve actual JavaScript/Python problems
- Character Classes - Frontend Warrior, Backend Mage, or Fullstack Ranger
- Progression System - Level up, earn XP & Gold, unlock new challenges
- AI Mentor - Get real-time code reviews and hints from "The Architect"
- Full-Stack Architecture - Next.js 14 + Express.js + MongoDB
- Secure Code Execution - Sandboxed via Piston API
- AI Integration - OpenRouter API with Qwen model
- GitHub OAuth - Login with your GitHub account
- Responsive Design - Works on desktop and mobile
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, React 18, TypeScript, Tailwind CSS |
| State | Zustand |
| Code Editor | Monaco Editor |
| Animations | Framer Motion |
| Backend | Node.js, Express.js, TypeScript |
| Database | MongoDB with Mongoose |
| Auth | JWT + GitHub OAuth |
| AI | OpenRouter API (Qwen model) |
| Code Execution | Piston API |
CodeQuest-RPG/
โโโ backend/ # Express.js API
โ โโโ src/
โ โ โโโ config/ # Database & env config
โ โ โโโ controllers/ # Route controllers
โ โ โโโ middleware/ # Auth, validation, rate limiting
โ โ โโโ models/ # MongoDB schemas
โ โ โโโ routes/ # API endpoints
โ โ โโโ services/ # Business logic
โ โ โโโ app.ts # Entry point
โ โ โโโ seed.ts # Database seeding
โ โโโ package.json
โ
โโโ frontend/ # Next.js 14 App
โ โโโ src/
โ โ โโโ app/ # App Router pages
โ โ โโโ components/ # Reusable components
โ โ โโโ lib/ # API client, utilities
โ โ โโโ store/ # Zustand store
โ โโโ package.json
โ
โโโ README.md
- Node.js 18+
- MongoDB (local or MongoDB Atlas)
- npm or yarn
git clone https://github.com/noahvlone/codequest-rpg.git
cd codequest-rpgcd backend
npm installCreate .env file (copy from .env.example):
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/codequest
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
OPENROUTER_API_KEY=your-openrouter-api-key
OPENROUTER_MODEL=qwen/qwen-2.5-vl-7b-instruct:free
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GITHUB_CALLBACK_URL=http://localhost:5000/api/auth/github/callback
FRONTEND_URL=http://localhost:3000
PISTON_API_URL=https://emkc.org/api/v2/pistonSeed the database:
npm run db:seedStart the server:
npm run devcd frontend
npm installCreate .env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000/apiStart the development server:
npm run devVisit http://localhost:3000 ๐
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in:
- Application name: CodeQuest RPG
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:5000/api/auth/github/callback
- Copy the Client ID and Client Secret to your
.env
- Push your code to GitHub
- Import project to Vercel
- Set environment variables:
NEXT_PUBLIC_API_URL= Your backend URL
- Create a new project on Railway
- Add MongoDB (or use MongoDB Atlas)
- Deploy from GitHub
- Set environment variables in Railway dashboard
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login with email/password |
| GET | /api/auth/github |
Initiate GitHub OAuth |
| GET | /api/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/characters |
Create character |
| GET | /api/characters/active |
Get active character |
| GET | /api/characters/progress |
Get challenge progress |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/challenges |
Get all challenges |
| GET | /api/challenges/:id |
Get challenge details |
| POST | /api/challenges/:id/execute |
Execute code |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/ai/chat |
Chat with AI mentor |
| POST | /api/ai/review |
Get code review |
| POST | /api/ai/hint |
Get hint |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shop/items |
Get shop items |
| POST | /api/shop/purchase/:itemId |
Purchase item |
| GET | /api/leaderboard |
Get leaderboard |
| Class | Specialty | Starting Stats |
|---|---|---|
| Frontend Warrior | DOM manipulation, CSS, UI | CSS: 20, JS: 15, Python: 5 |
| Backend Mage | Server-side, APIs, Databases | Python: 15, DB: 15, JS: 10 |
| Fullstack Ranger | Jack of all trades | Balanced stats |
- Syntax Valley (Easy) - Basic syntax and variables
- Logic Labyrinth (Medium) - Loops, conditions, functions
- Algorithm Abyss (Hard) - Sorting, searching, optimization
- Data Structure Dungeon (Expert) - Stacks, queues, trees
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
Built for developers who want to level up their skills
ยฉ 2077 Neotech Industries