Skip to content

VineetMittal007/ContestCompass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

React Full-Stack Application

🚀 React Full-Stack Application

Welcome to the repository for our dynamic and responsive full-stack application! This project showcases a seamless integration of a modern React frontend with a robust [e.g., Node.js/Express] backend. Dive in to explore the features and setup instructions.

Application Screenshot

🌟 Features

  • User Authentication: Secure login, signup, and logout functionalities.
  • Theme Toggling: Effortlessly switch between light and dark modes.
  • Admin Protected Routes: Exclusive access for administrative users.
  • Contest Solutions Display: Easily view and manage contest solutions.
  • API Data Fetching: Efficiently retrieve and display data from the backend.
  • Responsive Design: A seamless experience across various devices.

Table of Contents

📂 Project Structure

Markdown

🚀 React Full-Stack Application

Welcome to the repository for our dynamic and responsive full-stack application! This project showcases a seamless integration of a modern React frontend with a robust [e.g., Node.js/Express to name a few] backend. Dive in to explore the features and setup instructions.

Application Screenshot

🌟 Features

  • User Authentication: Secure login, signup, and logout functionalities.
  • Theme Toggling: Effortlessly switch between light and dark modes.
  • Admin Protected Routes: Exclusive access for administrative users.
  • Contest Solutions Display: Easily view and manage contest solutions.
  • API Data Fetching: Efficiently retrieve and display data from the backend.
  • Responsive Design: A seamless experience across various devices.

📂 Project Structure

├── client/ # ⚛️ React Frontend │ ├── public/ │ ├── src/ │ │ ├── components/ │ │ ├── context/ │ │ ├── pages/ │ │ ├── services/ │ │ ├── styles/ │ │ ├── App.js │ │ ├── index.js │ │ └── ... │ ├── package.json │ └── ... ├── server/ # ⚙️ Backend ([Specify your backend technology, e.g., Node.js/Express]) │ ├── controllers/ │ ├── models/ │ ├── routes/ │ ├── server.js │ ├── package.json │ └── ... ├── .env # 🔑 Environment Variables ├── .gitignore ├── README.md └── package.json # 📦 Top-level package.json (if monorepo)

Frontend

The frontend is built using React and styled-components, providing a dynamic and responsive user interface.

Frontend Technologies Used

  • React
  • React Router DOM (v6)
  • Styled Components
  • Formik & Yup (for form handling)
  • Axios (for API requests)
  • Context API (for state management)

Frontend Setup

  1. Navigate to the client directory:

    cd client
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start

    The frontend will be available at http://localhost:3000.

Frontend Key Features

  • User authentication (login, signup, logout)
  • Theme toggling (light/dark mode)
  • Admin protected routes
  • Contest solutions display
  • API data fetching and display

Backend

The backend is built using [Specify your backend technology, e.g., Node.js with Express], providing the API endpoints for the frontend.

Backend Technologies Used

  • Node.js
  • Express.js
  • MongoDB Mongoose
  • CORS, Middleware
  • jsonwebtoken

Backend Setup

  1. Navigate to the server directory:

    cd server
  2. Install dependencies:

    npm install
  3. Start the server:

    npm start

    The backend will be available at http://localhost:5000 (or your defined port).

API Endpoints

  • GET /contests: Retrieves a list of contests.
  • GET /solutions: Retrieves a list of solution links.
  • POST /solutions: Adds a new solution link.
  • POST /login: Authenticates a user and returns a JWT.
  • POST /signup: Creates a new user account.

Environment Variables

Create a .env file in the root directory to store environment variables.

Running the Application

  1. Start the backend server in the server directory:

    cd server
    npm start
  2. Start the frontend development server in the client directory:

    cd client
    npm start
  3. Open your browser and navigate to http://localhost:3000.

Troubleshooting

  • "Cannot read properties of undefined (reading 'body')": This error usually indicates a problem with the Theme Context. Ensure ThemeProvider is correctly wrapping your App component in index.js. Verify the contents of ThemeContext.js and styles/theme.js.
  • "Request failed with status code 404": This error means the frontend is trying to access a backend endpoint that doesn't exist. Double-check your API_BASE_URL in services/api.js and verify that the backend is running and the routes are defined. Use Postman or Insomnia to test the backend endpoints directly.
  • "fetchSolutionLinks is not defined": This error means that the function is not being imported correctly. Double check the import statement, and make sure that the function is exported correctly from the api.js file.
  • CORS issues: If the backend and frontend are on different origins, make sure your backend is configured to allow CORS requests.

Contributing

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes.
  4. Push to your fork.
  5. Create a pull request.

License

[ MIT License]

About

Contest tracker fetched all the past and upcoming contest form codechef, leetcode, codeforces and many more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published