A full-stack web application inspired by GeeksforGeeks and LeetCode, built with React.js, Node.js, Express, and MongoDB.
SolveNet/
├── backend/
│ ├── config/
│ │ └── db.js
│ ├── controllers/
│ │ ├── userController.js
│ │ ├── problemController.js
│ │ ├── solutionController.js
│ │ └── leaderboardController.js
│ ├── middleware/
│ │ └── authMiddleware.js
│ ├── models/
│ │ ├── User.js
│ │ ├── Problem.js
│ │ ├── Solution.js
│ │ └── Vote.js
│ ├── routes/
│ │ ├── userRoutes.js
│ │ ├── problemRoutes.js
│ │ ├── solutionRoutes.js
│ │ └── leaderboardRoutes.js
│ ├── server.js
│ ├── seed.js
│ └── package.json
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Navbar.jsx
│ │ │ ├── ProblemCard.jsx
│ │ │ ├── SolutionCard.jsx
│ │ │ ├── SearchBar.jsx
│ │ │ └── VoteButton.jsx
│ │ ├── pages/
│ │ │ ├── Home.jsx
│ │ │ ├── Problems.jsx
│ │ │ ├── ProblemDetail.jsx
│ │ │ ├── CreateProblem.jsx
│ │ │ ├── SubmitSolution.jsx
│ │ │ ├── Login.jsx
│ │ │ ├── Register.jsx
│ │ │ ├── Profile.jsx
│ │ │ ├── Dashboard.jsx
│ │ │ ├── Leaderboard.jsx
│ │ │ └── Archive.jsx
│ │ ├── services/
│ │ │ └── api.js
│ │ ├── styles/
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
│
└── README.md
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file (optional, defaults provided)
# PORT=5000
# MONGODB_URI=mongodb://localhost:27017/solvenet
# JWT_SECRET=your_secret_key
# Seed database with sample data
npm run seed
# Start server
npm start
# or for development
npm run dev
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
The frontend will run on http://localhost:3000
After seeding the database, you can login with:
POST /api/users/register - Register new userPOST /api/users/login - Login userGET /api/users/profile - Get user profile (protected)GET /api/users/dashboard - Get user dashboard (protected)GET /api/problems - Get all problemsGET /api/problems/:id - Get problem by IDPOST /api/problems/create - Create new problem (protected)GET /api/problems/archive - Get solved problems archivePOST /api/solutions/submit/:problemId - Submit solution (protected)POST /api/solutions/vote/:solutionId - Vote on solution (protected)POST /api/solutions/solve/:problemId - Mark problem as solved (protected)GET /api/leaderboard - Get leaderboardUsers earn badges based on reputation:
Users gain reputation by:
Problems are organized by:
MIT