diff --git a/Readme.md b/Readme.md index c7511f8..d75f99a 100644 --- a/Readme.md +++ b/Readme.md @@ -1,60 +1,73 @@ -# ๐Ÿš€ LeetLab - Advanced Coding Platform +# ๐Ÿš€ CodeArena - Advanced Competitive Programming Platform -LeetLab is a comprehensive full-stack coding platform designed for developers to practice coding problems, participate in contests, access premium problem sheets, and get real-time code execution feedback. Built with modern technologies and containerized for easy deployment. +CodeArena is a comprehensive full-stack competitive programming platform designed for developers to practice coding problems, participate in contests, access premium DSA sheets, and get real-time code execution feedback. Built with modern technologies and containerized for easy deployment. ## โœจ Key Features ### Core Functionality -- ๐Ÿงฉ **Problem Solving**: Extensive library of coding problems with multiple difficulty levels -- ๐Ÿ’ป **Real-time Code Execution**: Integrated Judge0 API for instant code compilation and execution -- ๐Ÿ“Š **Progress Tracking**: Personal dashboard to track coding progress and statistics -- ๐Ÿ† **Contests**: Participate in timed coding competitions with leaderboards -- ๐Ÿ“š **Premium Sheets**: Curated DSA practice sheets with Razorpay payment integration +- ๐Ÿงฉ **Problem Solving**: Extensive library of coding problems with difficulty levels (Easy, Medium, Hard) +- ๐Ÿ’ป **Real-time Code Execution**: Integrated Judge0 API for instant code compilation and execution across 5 languages +- ๐Ÿ“Š **Progress Tracking**: Personal dashboard to track coding progress, submissions, and statistics +- ๐Ÿ† **Contests**: Full-featured timed coding competitions with live leaderboards and real-time updates +- ๐Ÿ“š **Premium DSA Sheets**: Curated Data Structures & Algorithms practice sheets with Razorpay payment integration +- ๐Ÿ“‹ **Custom Playlists**: Create and manage personal problem collections ### Advanced Features -- ๐Ÿ” **Secure Authentication**: JWT-based auth with refresh tokens and role-based access -- ๐Ÿ’ณ **Payment Integration**: Razorpay integration for premium content access -- ๏ฟฝ **Responsive Design**: Modern UI built with React, Tailwind CSS, and Lucide icons -- โšก **Real-time Updates**: Live notifications and updates using Socket.IO -- ๏ฟฝ **Containerized**: Full Docker support for development and production environments -- ๐Ÿ—ƒ๏ธ **Database Management**: PostgreSQL with Prisma ORM for type-safe database operations -- ๐Ÿš€ **Redis Caching**: Session management and performance optimization +- ๐Ÿ” **Secure Authentication**: JWT-based auth with refresh tokens and role-based access control (User, Admin, SuperAdmin) +- ๐Ÿ’ณ **Payment Integration**: Razorpay integration for premium DSA sheet purchases +- ๐ŸŽจ **Responsive Design**: Modern UI built with React 19, Vite, Tailwind CSS 4, and Lucide icons +- โšก **Real-time Updates**: Live contest updates and notifications using Socket.IO +- ๐Ÿณ **Containerized**: Full Docker support with Docker Compose for development and production +- ๐Ÿ—ƒ๏ธ **Database Management**: PostgreSQL 15 with Prisma ORM 6 for type-safe database operations +- ๐Ÿš€ **Redis Caching**: Session management and performance optimization with Redis 7 +- ๐Ÿ”‘ **Session Management**: Advanced session handling with token expiry and refresh mechanisms ### User Experience -- ๐ŸŽจ **Modern Interface**: Clean, intuitive design with dark theme support +- ๐ŸŽจ **Modern Interface**: Clean, intuitive design with dark theme support and theme toggle - ๐Ÿ” **Advanced Search**: Filter problems by difficulty, tags, and completion status -- ๐Ÿ“ˆ **Analytics Dashboard**: Detailed progress tracking and performance insights -- ๐Ÿ›ก๏ธ **Admin Panel**: Comprehensive admin interface for content management -- ๐Ÿ“ง **Email Notifications**: SMTP integration for user communications +- ๐Ÿ“ˆ **Analytics Dashboard**: Detailed progress tracking with recent submissions and activity feed +- ๐Ÿ›ก๏ธ **Admin Panel**: Comprehensive admin interface for user, problem, contest, and sheet management +- ๐Ÿ“ **Code Editor**: Monaco Editor (VS Code-based) with syntax highlighting and autocomplete +- โœ… **Test Cases**: Built-in test case execution with detailed results and error messages +- ๐ŸŽฏ **Contest Features**: Live leaderboards, real-time rankings, and submission tracking ## ๐Ÿ—๏ธ Architecture & Tech Stack ### Frontend -- **React 18** - Modern React with hooks and context -- **Vite** - Fast build tool and dev server -- **Tailwind CSS** - Utility-first CSS framework +- **React 19** - Latest React with hooks and context +- **Vite 7.1** - Lightning-fast build tool and dev server +- **Tailwind CSS 4** - Utility-first CSS framework with modern features - **Lucide React** - Beautiful icon library - **Zustand** - Lightweight state management -- **Monaco Editor** - VS Code-based code editor +- **Monaco Editor** - VS Code-based code editor with syntax highlighting +- **React Router 7** - Client-side routing +- **React Hook Form + Zod** - Form validation and management +- **DaisyUI** - Tailwind CSS component library +- **Framer Motion** - Animation library ### Backend -- **Node.js & Express** - Server runtime and web framework -- **Prisma ORM** - Type-safe database client and migrations -- **PostgreSQL** - Primary relational database -- **Redis** - Session storage and caching layer -- **Socket.IO** - Real-time bidirectional communication -- **Judge0 API** - Code execution and compilation service +- **Node.js & Express 4.19** - Server runtime and web framework +- **Prisma ORM 6.12** - Type-safe database client and migrations +- **PostgreSQL 15** - Primary relational database +- **Redis 7** - Session storage and caching layer +- **Socket.IO 4.8** - Real-time bidirectional communication +- **Judge0 API** - Code execution and compilation service (supports 5 languages) +- **Razorpay SDK** - Payment processing integration +- **bcryptjs** - Password hashing +- **jsonwebtoken** - JWT authentication ### DevOps & Infrastructure - **Docker & Docker Compose** - Containerization and orchestration - **Nginx** - Reverse proxy and load balancing -- **SSL/TLS** - HTTPS support with certificate management +- **PostgreSQL 15 Alpine** - Containerized database +- **Redis 7 Alpine** - Containerized cache +- **Health Checks** - Configured for all services ## ๐Ÿš€ Quick Start @@ -71,8 +84,8 @@ LeetLab is a comprehensive full-stack coding platform designed for developers to ```bash # Clone the repository -git clone https://github.com/yourusername/leetlab.git -cd leetlab +git clone https://github.com/Rahul5977/CodeArena.git +cd CodeArena # Copy environment template cp .env.example .env @@ -103,8 +116,8 @@ docker-compose logs -f #### 1. Clone and Install Dependencies ```bash -git clone https://github.com/yourusername/leetlab.git -cd leetlab +git clone https://github.com/Rahul5977/CodeArena.git +cd CodeArena # Install backend dependencies cd backend @@ -121,14 +134,14 @@ Create `.env` file in the `backend` directory: ```env # Database -DATABASE_URL="postgresql://myuser:mypassword@localhost:5432/leetlab" +DATABASE_URL="postgresql://myuser:mypassword@localhost:5432/codearena" REDIS_URL="redis://:redispassword@localhost:6379" # Authentication SECRET="your-super-secret-jwt-key-change-this-in-production" REFRESH_SECRET="your-super-secret-refresh-key-change-this-in-production" -# External Services +# External Services - Judge0 Code Execution JUDGE0_API_URL="https://judge0-ce.p.sulu.sh" SULU_API_KEY="your-judge0-api-key" @@ -136,7 +149,7 @@ SULU_API_KEY="your-judge0-api-key" RAZORPAY_KEY_ID="your-razorpay-key-id" RAZORPAY_KEY_SECRET="your-razorpay-key-secret" -# Email Configuration +# Email Configuration (SMTP configured, not actively used) SMTP_HOST="smtp.gmail.com" SMTP_PORT="587" SMTP_USER="your-email@gmail.com" @@ -186,20 +199,27 @@ redis-server --requirepass redispassword ## ๐Ÿ“ Project Structure ``` -leetlab/ +CodeArena/ โ”œโ”€โ”€ ๐Ÿ“ backend/ # Node.js Express API Server โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ controllers/ # Route handlers and business logic -โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ routes/ # API route definitions -โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ middleware/ # Custom middleware functions -โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ libs/ # External service integrations +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ auth.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ problem.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ submission.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ contest.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ sheet.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ playlist.controller.js +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ user.controller.js +โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ admin.controller.js +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ routes/ # API route definitions (11 route modules) +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ middleware/ # Auth, validation, error handling +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ libs/ # External service integrations (Judge0, Razorpay) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ utils/ # Utility functions and helpers โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ generated/ # Prisma generated client โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“„ index.js # Main server entry point โ”‚ โ”œโ”€โ”€ ๐Ÿ“ prisma/ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ migrations/ # Database migration files โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“„ schema.prisma # Database schema definition -โ”‚ โ”œโ”€โ”€ ๐Ÿ“ uploads/ # File upload storage โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile # Production Docker config โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile.dev # Development Docker config โ”‚ โ””โ”€โ”€ ๐Ÿ“„ package.json # Backend dependencies @@ -208,19 +228,20 @@ leetlab/ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ components/ # Reusable React components โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ ui/ # Base UI components -โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ layout/ # Layout components +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ layout/ # Layout components (Navbar, Footer) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ shared/ # Shared components โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ pages/ # Route-based page components -โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ auth/ # Authentication pages -โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ problems/ # Problem-related pages -โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ contests/ # Contest pages -โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ sheets/ # Sheet pages -โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ admin/ # Admin panel pages -โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ contexts/ # React context providers +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ auth/ # Login, Register, ForgotPassword +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ problems/ # Problem list, Problem solver +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ contests/ # Contest list, Contest detail +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ sheets/ # DSA sheets, Sheet detail +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ playlists/ # Playlist management +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ dashboard/ # User dashboard +โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ admin/ # Admin panel +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ contexts/ # React context providers (Auth, Theme) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ stores/ # Zustand state management โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ services/ # API service functions โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ utils/ # Utility functions -โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ assets/ # Static assets โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ lib/ # Third-party library configs โ”‚ โ”œโ”€โ”€ ๐Ÿ“ public/ # Public static files โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile # Production Docker config @@ -231,17 +252,23 @@ leetlab/ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ nginx/ # Nginx Reverse Proxy โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ nginx.conf # Nginx configuration -โ”‚ โ”œโ”€โ”€ ๐Ÿ“ ssl/ # SSL certificates -โ”‚ โ””โ”€โ”€ ๐Ÿ“ logs/ # Nginx access/error logs +โ”‚ โ””โ”€โ”€ ๐Ÿ“ ssl/ # SSL certificates directory โ”‚ โ”œโ”€โ”€ ๐Ÿ“ docs/ # Project Documentation -โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ API_DOCS.md # API documentation -โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ DEPLOYMENT.md # Deployment guide -โ”‚ โ””โ”€โ”€ ๐Ÿ“„ TESTING_GUIDE.md # Testing instructions +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ API_DOCS.md # API endpoint documentation +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ SHEETS_TESTING_GUIDE.md # DSA sheets testing guide +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ DASHBOARD_TESTING_GUIDE.md # Dashboard testing guide +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ CODE_EXECUTION_TESTING.md # Code execution testing +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ IMPLEMENTATION_SUMMARY.md # Feature implementation summary +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ PROJECT_SUMMARY.md # Comprehensive project summary +โ”‚ โ””โ”€โ”€ (40+ additional documentation files) โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.yml # Production compose config โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.dev.yml # Development compose config โ”œโ”€โ”€ ๐Ÿ“„ init-db.sql # Database initialization +โ”œโ”€โ”€ ๐Ÿ“„ test-sheets.sql # Test DSA sheets data +โ”œโ”€โ”€ ๐Ÿ“„ sample-problem.sql # Sample problem data +โ”œโ”€โ”€ ๐Ÿ“„ more-problems.sql # Additional problems โ”œโ”€โ”€ ๐Ÿ“„ .env.example # Environment variables template โ””โ”€โ”€ ๐Ÿ“„ README.md # This file ``` @@ -357,58 +384,220 @@ SMTP_PASS="your-app-password" ### Core Entities -- **Users**: Authentication, profiles, roles -- **Problems**: Coding challenges with test cases -- **Sheets**: Curated problem collections -- **Contests**: Timed competitions -- **Submissions**: Code submissions and results -- **Payments**: Transaction records +The application uses a comprehensive Prisma schema with the following main models: + +- **User**: Authentication, profiles, roles (USER, ADMIN, SUPERADMIN) + - Fields: id, name, email, password, role, refreshToken, passwordResetToken, isActive, emailVerified + - Relations: submissions, problems, playlists, contest participation, sheet purchases + +- **Problem**: Coding challenges with test cases + - Fields: id, title, description, difficulty (EASY, MEDIUM, HARD), tags, examples, constraints, hints, editorial + - Relations: submissions, sheet problems, contest problems, playlists + +- **Submission**: Code submissions and results + - Fields: id, userId, problemId, code, language, status, runtime, memory, createdAt + - Relations: user, problem, test case results + +- **TestCaseResult**: Individual test case execution results + - Fields: id, submissionId, input, expectedOutput, actualOutput, status, executionTime + +- **Contest**: Timed competitions + - Fields: id, title, description, startTime, endTime, status (UPCOMING, LIVE, COMPLETED, CANCELLED) + - Relations: participants, submissions, leaderboard, problems + +- **ContestParticipant**: User contest registrations +- **ContestSubmission**: Contest-specific submissions with scores +- **ContestLeaderboard**: Real-time contest rankings + +- **Sheet**: DSA practice sheets + - Fields: id, title, description, type (FREE, PREMIUM), price, difficulty, estimatedHours + - Relations: sheet problems, user purchases, progress tracking + +- **UserSheet**: Sheet purchases via Razorpay + - Fields: id, userId, sheetId, paymentId, amount, status, purchaseDate + +- **SheetProgress**: Problem-by-problem progress in sheets + - Fields: id, userId, sheetId, problemId, isCompleted, completedAt + +- **Playlist**: User-created problem collections + - Fields: id, name, description, userId, createdAt + - Relations: problems + +- **Payment**: Transaction records + - Fields: id, userId, razorpayOrderId, razorpayPaymentId, amount, status + +- **UserSession**: Session management + - Fields: id, userId, sessionToken, expiresAt + +- **RoleChange**: Audit trail for user role modifications + - Fields: id, userId, changedBy, previousRole, newRole, reason, createdAt ### Key Relationships -```sql +``` User 1---* Submission User 1---* Payment +User 1---* Playlist +User 1---* ProblemSolved +User 1---* UserSheet +User 1---* ContestParticipant Problem 1---* Submission +Problem 1---* TestCaseResult Sheet 1---* SheetProblem *---1 Problem Contest 1---* ContestProblem *---1 Problem +Contest 1---* ContestParticipant *---1 User ``` +## โœ… Implemented Features + +### ๐Ÿ” Authentication & Authorization System +- **Complete JWT-based authentication** with access and refresh tokens +- **Role-based access control** supporting three roles: USER, ADMIN, SUPERADMIN +- **Session management** with UserSession model and automatic cleanup +- **Password reset** functionality with secure token generation +- **Email verification** system (infrastructure ready) +- **Account status management** (active/inactive users) + +### ๐Ÿ’ป Code Execution Engine +- **Judge0 API integration** for real-time code compilation and execution +- **Multi-language support**: Python, Java, JavaScript, C++, C +- **Batch submission processing** for running multiple test cases +- **Detailed execution results** with runtime, memory usage, and error messages +- **Test case management** with expected vs actual output comparison +- **Submission history** tracking all code submissions per user + +### ๐Ÿงฉ Problem Management System +- **CRUD operations** for problems (admin/superadmin only) +- **Rich problem metadata**: title, description, difficulty, tags, examples, constraints +- **Editorial support** with hints and detailed solutions +- **Test cases** stored in JSON format with input/output pairs +- **Code snippets** for different languages as starter templates +- **Problem-solving tracking** per user with ProblemSolved model +- **Search and filter** by difficulty, tags, and completion status + +### ๐Ÿ† Contest Management +- **Full contest lifecycle**: UPCOMING โ†’ LIVE โ†’ COMPLETED +- **Contest registration** system with ContestParticipant tracking +- **Real-time leaderboards** with Socket.IO integration +- **Contest-specific submissions** with scoring and ranking +- **Time-based duration** management with automatic status updates +- **Penalty system** for wrong submissions +- **Multiple problems per contest** with ContestProblem association + +### ๐Ÿ“š DSA Sheets System +- **Free and Premium sheets** with type-based access control +- **Razorpay payment integration** for premium sheet purchases +- **Sheet progress tracking** per problem for each user +- **Curated problem collections** organized by topics and difficulty +- **Estimated completion time** for each sheet +- **Prerequisites and topics** metadata for better organization +- **Purchase history** tracking with payment records + +### ๐Ÿ“‹ Playlist Feature +- **User-created custom playlists** for organizing problems +- **Add/remove problems** from playlists dynamically +- **Playlist management** (create, update, delete) +- **Personal problem collections** for focused practice + +### ๐Ÿ‘ฅ Admin Features +- **User management**: view all users, search, filter by role +- **Role modification**: promote/demote users with audit trail (RoleChange model) +- **Problem creation and management** through admin interface +- **Contest management**: create, update, cancel contests +- **Sheet management**: create and manage DSA sheets +- **Statistics dashboard** for system overview +- **Permission-based access control** for sensitive operations + +### ๐Ÿ‘ค User Dashboard +- **Profile management**: update name, email, profile image +- **Activity feed** showing recent submissions +- **Statistics display**: problems solved, submission count, accuracy +- **Recent submissions** with status and language information +- **Progress visualization** for problem-solving journey +- **Problem recommendations** based on user history + +### ๐ŸŽจ Frontend Features +- **Dark/Light theme toggle** with persistent storage +- **Monaco Editor integration** with VS Code features +- **Split pane layout** for problem description and code editor +- **Custom test case input/output** for debugging +- **Loading states and error handling** throughout the app +- **Toast notifications** for user feedback +- **Responsive design** with Tailwind CSS +- **Smooth animations** with Framer Motion + +### ๐Ÿ”ง Technical Features +- **Type-safe database operations** with Prisma ORM +- **RESTful API design** with 11 route modules +- **Comprehensive error handling** with custom middleware +- **Input validation** on all API endpoints +- **Password hashing** with bcryptjs +- **Redis session storage** for performance +- **Health check endpoints** for monitoring +- **Docker containerization** for easy deployment + +### ๐Ÿ“ Current Limitations +- **Email notifications**: SMTP configured but not actively used +- **AI code review**: Endpoint stub exists but not fully implemented +- **Advanced analytics**: Basic statistics present, advanced features planned +- **Admin UI**: Some admin components are stubs requiring full implementation + ## ๐Ÿงช Testing ### Backend Testing +The backend includes several SQL files for testing and seeding: + ```bash -cd backend -npm test # Run all tests -npm run test:unit # Unit tests only -npm run test:integration # Integration tests only -npm run test:coverage # Generate coverage report -``` +# Initialize database +psql -U myuser -d postgres -f init-db.sql -### Frontend Testing +# Load test DSA sheets +psql -U myuser -d postgres -f test-sheets.sql -```bash -cd frontend -npm test # Run Jest/Vitest tests -npm run test:e2e # Run end-to-end tests -npm run test:component # Component testing +# Load sample problems +psql -U myuser -d postgres -f sample-problem.sql + +# Load additional problems +psql -U myuser -d postgres -f more-problems.sql ``` +### Testing Guides + +The project includes comprehensive testing documentation in the `/docs` directory: + +- **SHEETS_TESTING_GUIDE.md**: Complete guide for testing DSA sheets functionality +- **DASHBOARD_TESTING_GUIDE.md**: Dashboard feature testing guide +- **CODE_EXECUTION_TESTING.md**: Code execution and Judge0 integration testing + ### API Testing -Use the provided Postman collection or test manually: +Use the provided API documentation or test manually: ```bash # Health check curl http://localhost:8080/api/v1/health # Authentication +curl -X POST http://localhost:8080/api/v1/auth/register \ + -H "Content-Type: application/json" \ + -d '{"name":"Test User","email":"test@example.com","password":"password123"}' + +# Login curl -X POST http://localhost:8080/api/v1/auth/login \ -H "Content-Type: application/json" \ - -d '{"email":"user@example.com","password":"password"}' + -d '{"email":"test@example.com","password":"password123"}' ``` +### Judge0 Integration Testing + +Test code execution with supported languages: +- Python (language_id: 71) +- Java (language_id: 62) +- JavaScript (language_id: 63) +- C++ (language_id: 54) +- C (language_id: 50) + ## ๐Ÿšจ Troubleshooting ### Common Issues @@ -491,8 +680,8 @@ docker-compose logs [service-name] ```bash # Clone repository -git clone https://github.com/yourusername/leetlab.git -cd leetlab +git clone https://github.com/Rahul5977/CodeArena.git +cd CodeArena # Configure production environment cp .env.example .env @@ -545,8 +734,8 @@ curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh # Deploy application -git clone https://github.com/yourusername/leetlab.git -cd leetlab +git clone https://github.com/Rahul5977/CodeArena.git +cd CodeArena ./deploy-prod.sh ``` @@ -649,43 +838,49 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file ### Core Technologies -- **[React](https://react.dev/)** - Frontend framework +- **[React](https://react.dev/)** - Frontend framework (v19) - **[Node.js](https://nodejs.org/)** - Backend runtime -- **[PostgreSQL](https://postgresql.org/)** - Primary database -- **[Prisma](https://prisma.io/)** - Database ORM and migrations +- **[PostgreSQL](https://postgresql.org/)** - Primary database (v15) +- **[Prisma](https://prisma.io/)** - Database ORM and migrations (v6.12) - **[Docker](https://docker.com/)** - Containerization platform ### UI & Design -- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework +- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework (v4) - **[Lucide React](https://lucide.dev/)** - Beautiful icon library - **[Monaco Editor](https://microsoft.github.io/monaco-editor/)** - Code editor +- **[DaisyUI](https://daisyui.com/)** - Tailwind CSS component library +- **[Framer Motion](https://www.framer.com/motion/)** - Animation library ### External Services - **[Judge0](https://judge0.com/)** - Code execution API - **[Razorpay](https://razorpay.com/)** - Payment processing -- **[Redis](https://redis.io/)** - In-memory data structure store +- **[Redis](https://redis.io/)** - In-memory data structure store (v7) + +### State Management & Routing + +- **[Zustand](https://zustand-demo.pmnd.rs/)** - Lightweight state management +- **[React Router](https://reactrouter.com/)** - Client-side routing (v7) ### Community -Special thanks to all contributors, testers, and users who help make LeetLab better! +Special thanks to all contributors, testers, and users who help make CodeArena better! --- ## ๐Ÿ“ž Support -- **Documentation**: [Wiki](https://github.com/yourusername/leetlab/wiki) -- **Community**: [Discord Server](https://discord.gg/leetlab) -- **Issues**: [GitHub Issues](https://github.com/yourusername/leetlab/issues) -- **Email**: support@leetlab.com +- **Documentation**: [docs/ directory](docs/) - Comprehensive project documentation +- **Issues**: [GitHub Issues](https://github.com/Rahul5977/CodeArena/issues) +- **Repository**: [https://github.com/Rahul5977/CodeArena](https://github.com/Rahul5977/CodeArena) ---
-**[โฌ† Back to Top](#-leetlab---advanced-coding-platform)** +**[โฌ† Back to Top](#-codearena---advanced-competitive-programming-platform)** -Made with โค๏ธ by the LeetLab Team +Made with โค๏ธ by the CodeArena Team