Skip to content

This is a full-stack technical Q&A platform inspired by community forums, enabling users to post questions, answer peers, and manage profiles using authentication system.

Notifications You must be signed in to change notification settings

harsh323dev/code-quest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CodeQuest

A Full-Stack Collaborative Q&A Platform with Gamification & Social Features

πŸ”— Live Demo (Vercel) β€’ 🌐 Backend API (Render)

Next.js Node.js MongoDB Express TypeScript


🎯 Overview

CodeQuest is a feature-rich Stack Overflow–style platform built using the MERN stack (Next.js on the frontend, Node/Express on the backend). It goes beyond standard Q&A by adding:

  • A social Public Space with friend-based posting limits
  • A subscription system with time-gated mock payments
  • A gamified reward system and point transfers
  • Multi-language support with OTP security
  • Login/device tracking and time-based access rules

Deployed on:


πŸ“Έ Screenshots

All screenshots are stored in the /screenshots folder in the repo.

Home & Questions Feed

Home Page

Public Space (Social Feed)

Public Space

Subscription Plans

Subscription

User Rewards & Wallet

Points & Wallet

Language Switch & OTP Flow

Language Switch
OTP Trigger

Login Verification & History

Login Verification

Reset Password

Reset Password

Render Console Logs (OTP)

Render Console
Render Console OTP


✨ Key Features

❓ Core Q&A Engine

  • Post questions, answers, and comments.
  • Upvote/downvote questions and answers.
  • Tag-based filtering and search.

🌐 Public Space (Social Hub)

  • Users share posts with images/videos, like, comment, and share.
  • Friend-based posting limits:
    • 0 friends β†’ cannot post.
    • 1 friend β†’ 1 post/day.
    • 2 friends β†’ 2 posts/day.
    • β‰₯10 friends β†’ unlimited posts/day.

πŸ’³ Subscription System (Mock Payment)

  • Plans:
    • Free: 1 question/day.
    • Bronze: β‚Ή100/month – 5 questions/day.
    • Silver: β‚Ή300/month – 10 questions/day.
    • Gold: β‚Ή1000/month – unlimited questions/day.
  • Payment allowed only between 10:00 AM – 11:00 AM IST.
  • After payment, invoice/plan details are sent to the user via email (mocked in logs / mailer).

πŸ† Gamification & Rewards

  • +5 points for each answer.
  • +5 bonus points when an answer reaches 5 upvotes.
  • Points reduced when an answer is removed or downvoted.
  • Users can transfer points to others if they have more than 10 points.

πŸ”’ Advanced Security & Login Rules

  • Track login IP, browser, OS, and device type.
  • Show login history in the user profile.
  • If user logs in via Chrome, access can require OTP.
  • If user logs in via Microsoft Edge, allow direct access without extra OTP.
  • If the device is mobile, restrict access to 10:00 AM – 1:00 PM IST only.

🌍 Multi-Language Support

  • Supported languages: English, French, Spanish, Hindi, Portuguese, Chinese.
  • Switching to French triggers email OTP verification.
  • Switching to any other language triggers mobile OTP verification.
  • The entire UI (navigation, labels, major screens) updates to the selected language.

πŸ› οΈ Tech Stack

Layer Technologies
Frontend Next.js, TypeScript, Tailwind CSS, Axios, Context API
Backend Node.js, Express.js, Mongoose, JWT, Bcrypt, Nodemailer
Database MongoDB Atlas
i18n i18next, react-i18next
Deployment Vercel (frontend), Render (backend)
Utilities Nodemon, Dotenv

πŸ“‹ Prerequisites

  • Node.js v16 or higher
  • npm or yarn
  • MongoDB Atlas connection string

πŸš€ Quick Start

1️⃣ Clone the Repository

git clone https://github.com/harsh323dev/code-quest.git

cd code-quest

2️⃣ Backend Setup

cd server

npm install

Create a .env file in server/:

PORT=5000 MONGODB_URL=your_mongodb_connection_string JWT_SECRET=your_secret_key NODE_ENV=development

Start the backend server:

Backend runs at: http://localhost:5000

3️⃣ Frontend Setup

cd ../stack npm install

Create a .env.local in stack/:

NEXT_PUBLIC_BACKEND_URL=http://localhost:5000

Start the frontend:

npm run dev

Frontend runs at: http://localhost:3000


πŸ“ Project Structure

code-quest/ β”œβ”€β”€ server/ # Backend Logic (Node/Express) β”‚ β”œβ”€β”€ controllers/ # Auth, Question, Answer, Payment, Reward, OTP β”‚ β”œβ”€β”€ models/ # Mongoose Schemas (User, Question, Post, LoginHistory) β”‚ β”œβ”€β”€ routes/ # API Routes β”‚ β”œβ”€β”€ middleware/ # Auth & Security Middleware β”‚ β”œβ”€β”€ seed.js # Seed script for demo questions β”‚ └── index.js # Entry Point β”‚ β”œβ”€β”€ stack/ # Frontend (Next.js) β”‚ β”œβ”€β”€ public/ # Assets & Locales (i18n) β”‚ β”œβ”€β”€ screenshots/ # Project screenshots for README β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ components/ # UI Components (Navbar, Sidebar, Cards) β”‚ β”‚ β”œβ”€β”€ pages/ # Routes (Auth, Questions, Public Space, Subscription) β”‚ β”‚ β”œβ”€β”€ lib/ # Axios instance, Contexts, Hooks β”‚ β”‚ └── styles/ # Global styles β”‚ └── package.json β”‚ └── README.md


🌐 API Highlights

  • POST /payment/subscribe – Upgrade user plan (time-restricted 10–11 AM IST).
  • POST /posts/create – Create Public Space post with friend-based rate limits.
  • POST /user/transfer-points – Transfer reward points between users.
  • POST /user/otp/generate – Generate OTP for language switching / login flows.
  • GET /login/history – Fetch login history with browser/OS/device/IP details.

πŸ‘¨β€πŸ’» Author

Harsh Agarwal


⭐ If you found this project interesting, consider giving it a star!

Built with ❀️ by Harsh Agarwal

About

This is a full-stack technical Q&A platform inspired by community forums, enabling users to post questions, answer peers, and manage profiles using authentication system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published