Skip to content

CH-USAMA/JavaLearningPlatform-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☕ JavaLearningPlatform

A full-stack, developer-focused platform to Write, Run, and Master Java — all in one place. Built with React, Vite, Node.js, Express, Prisma, and Monaco Editor.

Platform Preview


🚀 Features

Feature Description
🖥️ Live Java IDE Monaco Editor (same as VS Code) with Java syntax highlighting. Compile & run code instantly using your local JDK.
📝 Notes System Create, edit, and organize Markdown notes by topic — inspired by Notion.
📚 Learning Hub Structured Java modules: Basics, OOP, Collections, Threads, and more.
🔐 JWT Auth Register/Login with JSON Web Tokens. Snippets and notes are saved per-user.
💾 Snippet Saving Save your favourite code snippets to the database and retrieve them anytime.
🌑 Dark Mode UI Ultra-high-contrast dark theme designed specifically for long coding sessions.

🛠️ Tech Stack

Frontend

Backend

Code Execution

  • Local JDK — Java code is compiled and run natively on your machine using javac + java.

📁 Project Structure

JavaLearningPlatform/
├── backend/                   # Node.js Express API
│   ├── prisma/
│   │   └── schema.prisma      # DB schema (User, Snippet, Note, KnowledgeModule)
│   ├── src/
│   │   ├── controllers/       # Auth, Snippets, Notes, Knowledge
│   │   ├── middlewares/       # JWT Auth Middleware
│   │   ├── routes/            # API route definitions
│   │   └── index.ts           # Express entry point
│   └── .env                   # Environment variables (not committed)
│
├── frontend/                  # React + Vite Application
│   ├── src/
│   │   ├── components/
│   │   │   ├── Editor.tsx     # Monaco Editor + Java Runner
│   │   │   ├── Notes.tsx      # Notes creation/editing UI
│   │   │   └── LearningHub.tsx# Learning module browser
│   │   ├── App.tsx            # Sidebar navigation + routing
│   │   └── index.css          # Tailwind base styles
│   └── tailwind.config.js     # Custom dark-mode theme
│
├── package.json               # Root concurrent start script
└── memory.md                  # Persistent development context

⚙️ Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/CH-USAMA/JavaLearningPlatform-.git
cd JavaLearningPlatform-

2. Install all dependencies

# Root concurrently runner
npm install

# Backend
cd backend && npm install && npx prisma generate && npx prisma db push
cd ..

# Frontend
cd frontend && npm install
cd ..

3. Configure the backend environment

Create a file at backend/.env:

PORT=5000
JWT_SECRET=your_secret_key_here

4. Start the application (single command)

npm start

This starts both the backend (port 5000) and frontend (port 5173) concurrently.

Open http://localhost:5173 in your browser.


🔌 API Endpoints

Method Route Auth Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and get a JWT token
POST /api/snippets/run Compile and run Java code
GET /api/snippets Get all saved snippets
POST /api/snippets Save a new snippet
GET /api/notes Get all user notes
POST /api/notes Create a new note
GET /api/knowledge List all learning modules

🔐 Security Notes

  • JWT secrets are stored in .env (never committed to Git)
  • Java code execution is sandboxed with a 10-second timeout to prevent infinite loops
  • Passwords are hashed using bcryptjs

🗺️ Roadmap

  • Full Authentication UI (Login/Register pages)
  • Snippet version history
  • PDF export for Notes
  • AI code explanation (OpenAI integration)
  • Docker-based sandbox for more secure execution
  • Deploy to production (Railway + Vercel)

👨‍💻 Author

CH Usama — Full-Stack Developer


📄 License

MIT License — feel free to use, modify, and share!

About

A full-stack, developer-focused platform to Write, Run, and Master Java — all in one place. Built with React, Vite, Node.js, Express, Prisma, and Monaco Editor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors