Skip to content

bhavesh1129/uniQuest-next

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ uniQuest - Elevate Your University Journey!

Next.js React MongoDB TailwindCSS Framer Motion

πŸš€ A modern Q&A platform designed specifically for university students

Unlock the full potential of your university experience with uniQuest, where questions find answers, connections become opportunities, and your journey to success begins.


πŸ“‹ Table of Contents


🌟 Features

πŸ” User Authentication & Management

  • Secure Registration & Login with JWT tokens
  • Email Verification system for account activation
  • Password Reset functionality with secure tokens
  • User Profile Management with customizable avatars
  • Session Management with automatic token refresh

❓ Question & Answer System

  • Anonymous Question Posting - Ask without revealing identity
  • Topic-based Organization - Categorize questions by subjects
  • Rich Text Descriptions - Detailed question explanations
  • Answer System - Community-driven responses
  • Search Functionality - Find relevant questions quickly
  • Slug-based URLs - SEO-friendly question links

🏷️ Topic Management

  • Dynamic Topic Creation - Add new categories on-the-fly
  • Topic-based Filtering - Browse questions by subject
  • Admin Topic Management - Organized content structure

πŸ‘₯ Community Features

  • University Community Building - Connect with fellow students
  • Peer-to-Peer Learning - Share knowledge and experiences
  • Mentorship Opportunities - Connect with seniors and alumni
  • Professional Networking - Build career connections

🎨 Modern UI/UX

  • Responsive Design - Works perfectly on all devices
  • Dark/Light Theme Support - Customizable appearance
  • Smooth Animations - Powered by Framer Motion
  • Interactive Elements - Engaging user experience
  • Loading States - Professional loading indicators

πŸ”§ Developer Experience

  • TypeScript Support - Type-safe development
  • ESLint Configuration - Code quality enforcement
  • Hot Reload - Instant development feedback
  • Modular Architecture - Clean, maintainable code

πŸ› οΈ Tech Stack

Frontend

  • Next.js 14.0.4 - React framework with App Router
  • React 18 - Modern React with hooks and concurrent features
  • TailwindCSS - Utility-first CSS framework
  • Framer Motion - Production-ready motion library
  • Lucide React - Beautiful & consistent icon toolkit
  • React Hot Toast - Elegant notifications

Backend

  • Next.js API Routes - Full-stack application
  • MongoDB - NoSQL database for flexible data storage
  • Mongoose - MongoDB object modeling for Node.js
  • JWT (jsonwebtoken) - Secure authentication tokens
  • bcryptjs - Password hashing and verification
  • Nodemailer - Email sending capabilities

Development Tools

  • ESLint - Code linting and formatting
  • PostCSS - CSS processing
  • Autoprefixer - CSS vendor prefixing

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (local or cloud instance)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone https://github.com/bhavesh1129/uniQuest-next.git
    cd uniQuest-next
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Environment Setup Create a .env.local file in the root directory:

    MONGODB_URI=your_mongodb_connection_string
    TOKEN_SECRET=your_jwt_secret_key
    EMAIL_USER=your_email@gmail.com
    EMAIL_PASS=your_email_password
    NEXTAUTH_URL=http://localhost:3000
  4. Run the development server

    npm run dev
    # or
    yarn dev
  5. Open your browser Navigate to http://localhost:3000


πŸ“ Project Structure

uniQuest-next/
β”œβ”€β”€ πŸ“ public/                    # Static assets
β”‚   β”œβ”€β”€ next.svg
β”‚   └── vercel.svg
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ app/                   # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ πŸ“ (authentication)/  # Auth route group
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ signin/
β”‚   β”‚   β”‚   └── πŸ“ signup/
β”‚   β”‚   β”œβ”€β”€ πŸ“ api/               # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ answers/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ questions/
β”‚   β”‚   β”‚   └── πŸ“ users/
β”‚   β”‚   β”œβ”€β”€ πŸ“ about/             # About page
β”‚   β”‚   β”œβ”€β”€ πŸ“ add-question/      # Question creation
β”‚   β”‚   β”œβ”€β”€ πŸ“ add-topic/         # Topic management
β”‚   β”‚   β”œβ”€β”€ πŸ“ contact/           # Contact page
β”‚   β”‚   β”œβ”€β”€ πŸ“ find-friends/      # Community features
β”‚   β”‚   β”œβ”€β”€ πŸ“ questions/         # Q&A listing
β”‚   β”‚   β”‚   └── πŸ“ [slug]/        # Dynamic question pages
β”‚   β”‚   β”œβ”€β”€ globals.css           # Global styles
β”‚   β”‚   β”œβ”€β”€ layout.js             # Root layout
β”‚   β”‚   β”œβ”€β”€ loading.jsx           # Loading component
β”‚   β”‚   β”œβ”€β”€ not-found.jsx         # 404 page
β”‚   β”‚   └── page.js               # Home page
β”‚   β”œβ”€β”€ πŸ“ components/            # Reusable components
β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   └── index.js
β”‚   β”œβ”€β”€ πŸ“ dbConfig/              # Database configuration
β”‚   β”‚   └── dbConfig.js
β”‚   β”œβ”€β”€ πŸ“ models/                # Database models
β”‚   β”‚   β”œβ”€β”€ answerModel.js
β”‚   β”‚   β”œβ”€β”€ questionModel.js
β”‚   β”‚   β”œβ”€β”€ topicModel.js
β”‚   β”‚   └── userModel.js
β”‚   β”œβ”€β”€ πŸ“ utils/                 # Utility functions
β”‚   β”‚   β”œβ”€β”€ cn.js
β”‚   β”‚   β”œβ”€β”€ fomattedTime.js
β”‚   β”‚   β”œβ”€β”€ getDataFromToken.js
β”‚   β”‚   └── mailer.js
β”‚   └── middleware.js             # Authentication middleware
β”œβ”€β”€ jsconfig.json                 # JavaScript configuration
β”œβ”€β”€ next.config.js                # Next.js configuration
β”œβ”€β”€ package.json                  # Dependencies and scripts
β”œβ”€β”€ postcss.config.js             # PostCSS configuration
└── tailwind.config.js            # TailwindCSS configuration

πŸ”§ API Endpoints

Authentication Routes

POST /api/users/signup          # User registration
POST /api/users/signin          # User login
GET  /api/users/signout         # User logout
GET  /api/users/user            # Get current user
GET  /api/users/users           # Get all users
POST /api/users/verifyEmail     # Email verification
GET  /api/users/user/[id]       # Get user by ID

Question Routes

GET  /api/questions/data        # Get all questions
POST /api/questions/data        # Create new question
GET  /api/questions/data/[slug] # Get question by slug
GET  /api/questions/topic       # Get all topics
POST /api/questions/topic       # Create new topic
GET  /api/questions/topic/[id]  # Get topic by ID

Answer Routes

GET  /api/answers/data          # Get all answers
POST /api/answers/data          # Create new answer
GET  /api/answers/data/[slug]   # Get answers by question slug

🎨 UI Components

Navbar Component

  • Responsive Design - Mobile-first approach
  • Dynamic Menu - Context-aware navigation
  • User Profile - Avatar and status indicators
  • Search Functionality - Quick question search
  • Authentication State - Login/logout management

Home Page

  • Hero Section - Compelling call-to-action
  • Interactive Background - Animated grid pattern
  • Feature Highlights - Key platform benefits
  • Call-to-Action Buttons - Direct user engagement

Question Components

  • Question List - Paginated question display
  • Question Detail - Full question view with answers
  • Question Form - Rich question creation interface
  • Topic Selector - Dynamic topic management

πŸ” Authentication

JWT Implementation

  • Secure Token Generation - Industry-standard JWT tokens
  • Token Expiration - Configurable session duration
  • Middleware Protection - Route-level authentication
  • Cookie Management - HttpOnly cookies for security

Password Security

  • bcrypt Hashing - Secure password storage
  • Salt Rounds - Configurable encryption strength
  • Password Validation - Client and server-side validation

Email Verification

  • Token-based Verification - Secure email confirmation
  • Expiration Handling - Time-limited verification links
  • Resend Functionality - User-friendly verification process

πŸ“Š Database Schema

User Model

{
  name: String (required),
  email: String (required, unique),
  password: String (required),
  image: String (default avatar),
  isVerified: Boolean (default: false),
  isAdmin: Boolean (default: false),
  forgetPasswordToken: String,
  forgetPasswordTokenExpiry: Date,
  verifyToken: String,
  verifyTokenExpiry: Date,
  timestamps: true
}

Question Model

{
  name: String (required),
  title: String (required),
  topicName: ObjectId (ref: 'topics'),
  description: String (required),
  userId: String (required),
  slug: String (required, unique),
  timestamps: true
}

Answer Model

{
  qnsId: String (required),
  answer: String (required),
  name: String (required),
  userId: String (required),
  timestamps: true
}

Topic Model

{
  topicName: String (required, unique),
  userId: String (required),
  timestamps: true
}

🎯 Key Features Explained

Anonymous Question System

  • Users can post questions without revealing their identity
  • Maintains privacy while encouraging open dialogue
  • Option to post as "Anonymous" or with real name

Topic-based Organization

  • Questions are categorized by topics for better discoverability
  • Dynamic topic creation allows for flexible content organization
  • Topic-based filtering helps users find relevant content

Community Building

  • University-specific community features
  • Peer-to-peer learning opportunities
  • Professional networking capabilities

Modern UI/UX

  • Responsive design works on all devices
  • Smooth animations enhance user experience
  • Intuitive navigation and user flows

πŸ”„ Development Workflow

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

Code Quality

  • ESLint Configuration - Enforces coding standards
  • Prettier Integration - Consistent code formatting
  • TypeScript Support - Type safety (optional)

Git Workflow

  1. Create feature branch from main
  2. Make changes and commit with descriptive messages
  3. Push branch and create pull request
  4. Code review and merge to main

πŸš€ Deployment

Vercel Deployment (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables in Vercel dashboard
  3. Deploy automatically on every push to main branch

Manual Deployment

  1. Build the application: npm run build
  2. Start production server: npm run start
  3. Configure reverse proxy (nginx/Apache)
  4. Set up SSL certificates

Environment Variables

Ensure all required environment variables are set:

  • MONGODB_URI - MongoDB connection string
  • TOKEN_SECRET - JWT secret key
  • EMAIL_USER - Email service username
  • EMAIL_PASS - Email service password

🀝 Contributing

We welcome contributions! Here's how you can help:

Ways to Contribute

  • πŸ› Bug Reports - Report issues you encounter
  • πŸ’‘ Feature Requests - Suggest new features
  • πŸ”§ Code Contributions - Submit pull requests
  • πŸ“– Documentation - Improve documentation
  • 🎨 UI/UX Improvements - Enhance user experience

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Standards

  • Follow existing code style and patterns
  • Write meaningful commit messages
  • Add comments for complex logic
  • Test your changes thoroughly

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


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

Made with πŸ’– by @bhavesh1129

GitHub LinkedIn Twitter


🌟 If you find this project helpful, please give it a star! 🌟

Your support motivates me to keep building amazing projects!

About

uniQuest, πŸŽ“ an essential companion for your university journey. 🌟 Ask and answer questions anonymously, connect with your university community, and unlock hidden gems with genuine reviews. πŸ€” Prepare for the working world by leveraging valuable insights from alumni and mentors. πŸš€

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors