Skip to content

monopoly21/CPegle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

CPegle

CPegle is a project idea i got during my endsem exams that if there is omegle why not have something similar for CP so i made CPegle.Which uses Codeforces API endpoints to get questions and verify whether a user exists in Codeforces.

Features

User Authentication

  • Login: Secure login functionality for existing users.
  • Signup: Easy registration process for new users.
  • It also uses zod for input validation.

Compete And Chat

  • So when a user Signs In/Up he/she is redirected to the dashboard page

  • The dashboard page has a button to register which is to register particularly to set a map with username as key and socket with its value

  • Now, if a user wants to compete he clicks start competion which will pair him with a user to compete a link will be sent out and whoever submits first WINS and they could also chat during or after the competion which is implemented using Websockets

  • The dashboard has a logout button which on clicking will redirect to the sign in page clearing all the local storage

Technologies Used

Frontend

  • React: React
  • Vite: Vite

Backend

  • Node.js: Node.js
  • Express: Express

Real-Time Communication

  • ws: a Node.js WebSocket library

Database

  • MongoDB: MongoDB

Authentication

  • JWT (JSON Web Tokens): JWT

Setup and Installation

  1. Clone the Repository:

    git clone https://github.com/balani491/CPegle
    cd CPegle
  2. Install Dependencies:

    • Navigate to the frontend and install dependencies:
      cd frontend
      npm install
    • Navigate to the backend and install dependencies:
      cd backend
      npm install
  3. Environment Variables:

    • Create a .env file in the backend directory and configure your MongoDB URI, JWT secret, and other necessary environment variables. Example .env file:
    PORT1=3000
    DATABASE_URL={YOUR_MONGO_DB_CONNECTION_STRING}
    JWT_SECRET = {YOUR_JWT_SECRET}
    
  4. Run the Application:

    • Start the backend server:
      cd backend
      tsc -b
      node src/index.js
    • Start the frontend development server:
      cd frontend
      npm run dev

Usage

Once a user logs in he could compete and chat.

Contribution And Improvements

Contributors are welcome to contribute.The Website is hosted on https://cpegle.netlify.app/

The backend is currently hosted as a Web Service in Render

Possible And Future Improvements:-

  • Add firebase authentication to verify email
  • Send attachments in a message
  • WebRTC implementation so that users could see and talk as well
  • Proper queue implementation using Redis
  • Add CI/CD pipeline
  • Unit Testing with jest or vitest
  • Change Password with mobile/email verification
  • An LLM to answer some coding related doubt.
  • In house questions and IDE so that we don't need to rely on Codeforces API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published