CompCode is a web application designed to help you prepare for coding interviews by solving commonly asked LeetCode problems from various popular companies. The app provides a user-friendly interface to browse, solve, and track your progress.
- Company-Specific Problems – View and solve questions by company.
- Submission Reports – Track which problems you've completed.
- Progress Tracking – Lessons, quizzes, and coding tasks are auto-tracked.
- Stripe Payments – Premium subscription with checkout and customer portal.
- User Authentication – Google login powered by Passport.js and JWT.
- Dark/Light Mode – Theme adapts to system or manual preference.
- Responsive Design – Mobile-first and fully responsive.
- Frontend: React + Vite + React Router + Tailwind CSS
- Backend: Express.js + MongoDB + Mongoose
- Auth: Google OAuth 2.0 with Passport.js + JWT
- Payments: Stripe Checkout and Webhooks
- Hosting:
- Node.js v16+
- MongoDB Atlas (or local MongoDB)
- Stripe Account
- Google Cloud OAuth Client
- Vercel Account
-
Clone the project and set up server directory:
git clone https://github.com/ahmad-masud/CompCode.git cd CompCode/server npm install
-
Create a
.env
file:MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret STRIPE_SECRET=your_stripe_secret_key STRIPE_WEBHOOK_SIGNING_SECRET=your_stripe_webhook_secret GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret CLIENT_URL=http://localhost:3000 SERVER_URL=http://localhost:4000
-
Run the server:
npm start
-
Navigate to client:
cd ../client npm install
-
Add a
.env
file:REACT_APP_SERVER_URL=http://localhost:4000 REACT_APP_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
-
Run the client:
npm run dev
- Deploy the client (React) to Vercel
- Deploy the server (Express) to Vercel
- Set up your Stripe Webhook URL to:
https://your-backend-host.com/api/payment/webhook
Distributed under the CC BY-NC-ND 4.0 License. See LICENSE for more information.