Master Coding through Gamified Learning
Welcome to NorthStaRs, a cutting-edge educational platform designed to transform the way users learn programming. By blending rigorous technical content with engaging gamification mechanics, NorthStaRs makes the journey from novice to architect both fun and rewarding.
- Project Overview
- Architecture
- Key Features
- Tech Stack
- Project Structure
- Getting Started
- API Documentation
- Contributing
NorthStaRs is more than just a quiz app; it's a comprehensive learning ecosystem. Users can:
- Learn: Dive into structured modules covering various computer science topics.
- Practice: Solve real coding problems in an integrated IDE.
- Compete: Climb the global leaderboards and earn achievements.
- Track: Monitor progress with detailed statistics and visual analytics.
The platform is built to be scalable, secure, and highly interactive, providing a seamless experience across devices.
NorthStaRs follows a modern Client-Server architecture:
- Frontend (The "North"): A responsive Single Page Application (SPA) built with Next.js. It handles all user interactions, rendering, and state management.
- Backend (The Core): A robust RESTful API built with Express.js. It manages business logic, authentication, and data processing.
- Database: A relational MySQL database managed via Prisma ORM, storing everything from user profiles to complex coding problems.
graph TD
User[User Device] <-->|HTTPS| Frontend[Next.js Frontend]
Frontend <-->|REST API| Backend[Express.js Backend]
Backend <-->|Prisma| DB[(MySQL Database)]
Backend <-->|Execution| Piston[Code Execution Engine]
- JWT-Based: Stateless authentication using JSON Web Tokens.
- Secure Storage: Passwords are hashed using
bcryptbefore storage. - Role-Based Access: Granular permissions for users and admins.
- XP System: Earn Experience Points (XP) for every quiz passed and problem solved.
- Leveling: Progress from "Novice" to "Architect" as you gain XP.
- Streaks: Daily login rewards to encourage consistency.
- Badges: Unlockable achievements for specific milestones (e.g., "Bug Hunter", "Speedster").
- Multi-Language Support: Write and run code in Python, JavaScript, C++, and Java.
- Real-Time Execution: Code is sent to a secure sandbox for execution, with output returned instantly.
- Syntax Highlighting: Powered by CodeMirror 6 for a premium developer experience.
- Test Cases: Automated validation against hidden test cases to ensure correctness.
- Quizzes: Timed multiple-choice questions with instant feedback.
- Daily Challenges: A new problem every day to keep skills sharp.
- Progress Tracking: Visual graphs showing activity and improvement over time.
- Framework: Next.js 16 (React 19)
- Styling: Tailwind CSS
- Icons: Lucide React
- Editor: CodeMirror
- HTTP Client: Axios
- Runtime: Node.js
- Framework: Express.js
- ORM: Prisma
- Database: MySQL
- Auth: JSON Web Tokens (JWT), Bcrypt
- Logging: Morgan, Winston
Here's a high-level look at the codebase organization:
NorthStaRs/
├── backend/ # Server-side code
│ ├── controllers/ # Request handlers (logic)
│ ├── routes/ # API route definitions
│ ├── prisma/ # Database schema and migrations
│ ├── middleware/ # Auth and error handling middleware
│ └── server.js # Entry point
│
├── frontend/North/ # Client-side code
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ │ ├── auth/ # Login/Signup pages
│ │ │ ├── code-editor/# IDE page
│ │ │ └── quiz/ # Quiz interface
│ │ ├── components/ # Reusable UI components
│ │ └── utils/ # API helpers and constants
│ └── public/ # Static assets
│
└── README.md # You are here!
Ready to run NorthStaRs locally? Follow these steps:
- Node.js (v18 or higher)
- MySQL (Running locally or via Docker)
- Git
git clone https://github.com/portneon/NorthStaRs.git
cd NorthStaRs- Navigate to the backend folder:
cd backend - Install dependencies:
npm install
- Create a
.envfile and configure your database URL:DATABASE_URL="mysql://user:password@localhost:3306/northstars" JWT_SECRET="supersecretkey" PORT=3005
- Run database migrations:
npx prisma migrate dev
- Start the server:
npm start
- Open a new terminal and navigate to the frontend folder:
cd frontend/North - Install dependencies:
npm install
- Start the development server:
npm run dev
Open your browser and visit http://localhost:3000. You're ready to start learning!
The backend exposes a rich set of RESTful endpoints. Here are a few key ones:
- POST
/user/register: Create a new account. - POST
/user/login: Log in and receive a JWT. - GET
/quiz: Fetch all available quizzes. - POST
/code/execute: Run code in the sandbox. - GET
/leaderboard: See the top players.
For a full list, check the Backend README.
We welcome contributions! Whether it's fixing a bug 🐛, adding a feature ✨, or improving documentation 📝.
- Fork the repo on GitHub.
- Clone your fork locally.
- Create a new branch (
git checkout -b feature/cool-feature). - Commit your changes.
- Push to your fork.
- Submit a Pull Request.
Built with ❤️ by the NorthStaRs Team