Welcome to CompEgg, the ultimate web application that centralizes competitive programming data from renowned platforms like LeetCode, GeeksforGeeks, Codeforces, and HackerRank. Designed for both aspiring coders and seasoned programmers, CompEgg empowers you with real-time insights and analytics to elevate your competitive programming journey!
This is a MERN stack project for building a web application with a client-side (frontend) using Vite, React, and Tailwind CSS, and a server-side (backend) using Express, MongoDB, and Mongoose.
- Multi-Platform Integration: Seamlessly access and analyze your coding stats from various platforms, all in one dynamic dashboard.
- Interactive Dashboard: Enjoy a user-friendly interface that displays comprehensive metrics and performance analytics at a glance.
- Real-Time Data Fetching: Stay updated with live data retrieved through efficient API calls, ensuring you always have the latest stats.
- Responsive Design: Optimized for both desktop and mobile devices, CompEgg is accessible anytime, anywhere.
- Heatmap Visualization: Dive deep into your activity timeline with an interactive heatmap built using D3.js, showcasing your coding journey over time.
- Frontend: React, Tailwind CSS, Axios, React-toolkit, React-persist
- Data Visualization: D3.js, mui-charts
- APIs:
- LeetCode Stats API
- GeeksforGeeks API
- Codeforces API
- HackerRank API
- Backend and Databases: Node, Express, MongoDB, Firebase-Auth
- Node.js installed
- MongoDB instance running
-
Client Folder (Frontend):
- Navigate to the
client
directory. - Install dependencies using
npm install
. - Start the development server by running:
npm run dev
- Navigate to the
-
Backend Folder:
- Navigate to the
backend
directory. - Install dependencies using
npm install
. - Start the server by running:
npm run dev
- Navigate to the
-
Create Client Folder:
- The client-side code is created using Vite. Navigate to the
client
directory and run:npm create vite@latest
- The client-side code is created using Vite. Navigate to the
-
Integrate Tailwind CSS:
- Follow Tailwind CSS setup in Vite. You will need to install the Tailwind CSS dependencies:
npm install -D tailwindcss postcss autoprefixer
- Create the Tailwind config file and include it in
src/index.css
.
- Follow Tailwind CSS setup in Vite. You will need to install the Tailwind CSS dependencies:
-
Pages and Routing:
- Inside the
src
folder, create apages
directory and add the necessary page components likeHome.jsx
,SignIn.jsx
, andSignUp.jsx
. - Install React Router DOM for routing:
npm install react-router-dom
- Wrap your
App.jsx
file inBrowserRouter
and define routes for each page using the<Route />
component.
- Inside the
-
Components:
- Create a
components
folder insidesrc
for reusable UI elements such asHeader.jsx
(for your navbar).
- Create a
-
Install Express:
- In the root directory of the project (outside the
client
folder), initialize a new Node.js project and install Express:npm install express
- In the root directory of the project (outside the
-
ES Modules Setup:
- In your root
package.json
, add the following:"type": "module"
- In your root
-
Server Setup:
- Inside the
backend
folder, createindex.js
. Set up your Express server and listen on the appropriate port. - Install Nodemon for automatic server restarts during development:
npm install --save-dev nodemon
- Update the root
package.json
script:"scripts": { "dev": "nodemon backend/index.js" }
- Inside the
-
Database Connection:
- Install Mongoose and connect your server to a MongoDB instance:
npm install mongoose
- Install Mongoose and connect your server to a MongoDB instance:
-
Models and Controllers:
- Create a
models
folder with auser.model.js
file to define the user schema. - Create a
controllers
folder for handling the API logic (e.g.,userController.js
). - Define the API routes for user registration and login.
- Create a
-
Password Hashing:
- Install bcrypt.js for password hashing:
npm install bcryptjs
- Install bcrypt.js for password hashing:
-
Run the Frontend:
- Navigate to the
client
folder and run:npm run dev
- Navigate to the
-
Run the Backend:
- In the root directory, start the server by running:
npm run dev
- In the root directory, start the server by running:
We welcome contributions from the community! If you have suggestions for improvements or want to report a bug, please create an issue or submit a pull request. Let’s collaborate to make CompEgg even better!