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.
- 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
- Frontend
- Backend
- Environment Variables
- Running the Application
- Troubleshooting
- Contributing
- License
Markdown
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.
- 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.
├── 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)
The frontend is built using React and styled-components, providing a dynamic and responsive user interface.
- React
- React Router DOM (v6)
- Styled Components
- Formik & Yup (for form handling)
- Axios (for API requests)
- Context API (for state management)
-
Navigate to the
client
directory:cd client
-
Install dependencies:
npm install
-
Start the development server:
npm start
The frontend will be available at
http://localhost:3000
.
- User authentication (login, signup, logout)
- Theme toggling (light/dark mode)
- Admin protected routes
- Contest solutions display
- API data fetching and display
The backend is built using [Specify your backend technology, e.g., Node.js with Express], providing the API endpoints for the frontend.
- Node.js
- Express.js
- MongoDB Mongoose
- CORS, Middleware
- jsonwebtoken
-
Navigate to the
server
directory:cd server
-
Install dependencies:
npm install
-
Start the server:
npm start
The backend will be available at
http://localhost:5000
(or your defined port).
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.
Create a .env
file in the root directory to store environment variables.
-
Start the backend server in the
server
directory:cd server npm start
-
Start the frontend development server in the
client
directory:cd client npm start
-
Open your browser and navigate to
http://localhost:3000
.
- "Cannot read properties of undefined (reading 'body')": This error usually indicates a problem with the Theme Context. Ensure
ThemeProvider
is correctly wrapping yourApp
component inindex.js
. Verify the contents ofThemeContext.js
andstyles/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
inservices/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.
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Push to your fork.
- Create a pull request.
[ MIT License]