The CodeFrenzy is a MERN stack application designed to track programming contests from platforms like Codeforces, CodeChef, and Leetcode. It provides features such as:
- Real-Time Contest Tracking
- Filtering contests by platform or status
- Bookmarking contests for future reference
- Automatic YouTube solution integration
- Dark/Light mode toggle
- User authentication (Sign-up, Login, Logout)
- Responsive and user-friendly UI
- Scalable MERN stack architecture
The backend is built with Node.js, Express, and MongoDB, while the frontend is built with React and TailwindCSS. The project is licensed under the GNU GENERAL PUBLIC LICENSE v3.
🔗 Live Website: CodeFrenzy
- Frontend: React, TailwindCSS
- Backend: Node.js, Express, MongoDB
- Authentication: JSON Web Tokens (JWT)
- API Fetching & Scheduling: Cron jobs
- Database: MongoDB
- Base URL:
/api/auth
- Endpoints:
POST /register
- Registers a new user.POST /login
- Logs in a user and returns a token.POST /logout
- Logs out a user by invalidating the token.GET /check
- Verifies if the user is authenticated using JWT.POST /sendOtp
- Sends an OTP for verification.POST /verifyOtp
- Verifies the provided OTP.
- Base URL:
/api/contests
- Endpoints:
GET /all
- Fetches all upcoming and past contests from Codeforces, CodeChef, and Leetcode.POST /addSolution
- Allows admins to add YouTube solution links for contests. Requires admin authentication.
- Base URL:
/api/bookmarks
- Endpoints:
POST /add
- Adds a contest to the user's bookmarks. Requires JWT verification.DELETE /delete/:id
- Deletes a specific bookmark by ID. Requires JWT verification.GET /:userId
- Retrieves all bookmarks for a specific user. Requires JWT verification.
- Home Page: Displays a list of upcoming and past contests with filtering and bookmarking options.
- Profile Page (Bookmarks): Shows all bookmarked contests of the user.
- Register & Login Pages: Provides authentication features with JWT-based login.
- AddSolution Page (Admin Only): Allows admins to add YouTube solution links for past contests. Accessible via a button on each contest card (if user is an admin).
- Contest Details Page: Displays contest details with attached YouTube links (if available).
- Endpoints: See APIs section above.
- Request Format: JSON requests for POST and DELETE methods.
- Response Format: JSON responses with relevant data or error messages.
- Authentication: Token-based authentication using JWT for protected routes.
- Third-Party APIs:
- Contest Fetching APIs:
- Codeforces API: Fetches upcoming and past contests from Codeforces.
- CodeChef API: Fetches upcoming and past contests from CodeChef.
- Leetcode API: Fetches upcoming and past contests from Leetcode.
- YouTube Data API: Fetches Post-Contest Discussion (PCD) videos related to contests.
- Contest Fetching APIs:
- Frontend to Backend Communication: Via Axios requests to the backend endpoints for authentication, bookmarking, and fetching contest data.
- YouTube API Fetching: Fetching relevant video links every 6 hours via cron jobs.
- Contest Fetching: Fetching contest data every 2 hours via cron jobs.
- Allows admins to add YouTube solution links for past contests.
- Accessible via a button on each contest card if the user is an admin.
- Sends a POST request to
/api/contests/addSolution
to save the YouTube link.
- Displays a list of contests.
- Allows filtering by platform or status.
- Shows contests with titles, platforms, start times, contest url, and discussion links if available.
- Allows new users to create an account by providing username, email, and password.
- Includes OTP-based email verification for account activation.
- Allows users to log in with email and password.
- Returns a JWT token for authentication.
- Displays the user's bookmarked contests.
- Allows users to remove bookmarks.
interface Contest {
id: string;
title: string;
site: 'Codeforces' | 'Codechef' | 'Leetcode';
url: string;
startTime: string;
duration: number;
contestStatus: 'UPCOMING' | 'FINISHED';
youtubeLink?: string;
}
interface Bookmark {
id: string;
userId: string;
contestId: string;
}
interface User {
id: string;
username: string;
email: string;
password: string;
}
Create a .env
file in the root of your backend directory and add the following:
MONGODB_URL=your_mongodb_url
NODE_ENV=development
JWT_SECRET=your_jwt_secret
MAIL_USER=your_email_user
SECRET_PASSWORD=your_email_app_password
YOUTUBE_API_KEY=your_youtube_api_key
ADMIN_EMAILS=admin1@example.com,admin2@example.com
Create a .env
file in the root of your frontend directory and add the following:
VITE_ADMIN_EMAILS=admin1@example.com,admin2@example.com
- Clone the repository from GitHub.
- Install dependencies using
npm install
for both frontend and backend. - Set up environment variables as described above.
- Run the backend using
npm run start
. - Run the frontend using
npm run dev
.
Feel free to contribute to CodeFrenzy! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch-name
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch-name
). - Create a Pull Request.
This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.
For any inquiries or collaboration, you can reach me at: Suyash Pandey.
- GitHub Link
- Description: Contains the full codebase for the CodeFrenzy project, including both frontend and backend implementations.