Skip to content

This is the Website build using Next.js and Express.js which will help students to access materials uploaded by the admin of the website.

License

Notifications You must be signed in to change notification settings

ashankgupta/studyportal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Made with Node.js GitHub stars License: MIT Express MongoDB Next.js

πŸ“š Study Material Manager

A full-stack platform to manage and upload academic study material (Docs, PDFs, PPTs) with role-based access and structured database design. Built with Node.js, MongoDB, and Next.js.

✨ Features

  • πŸ‘€ User Registration & JWT-based Authentication

  • πŸ§‘β€πŸ’Ό Admin Panel to Create Semesters, Subjects, Units & Upload Materials

  • πŸ—‚οΈ Hierarchical Database:

      Semester β†’ Subject β†’ Unit β†’ Materials
    
  • 🧾 Upload support for Docs, PDFs, PPTs

  • πŸ”’ College email-only access restriction (@mietjammu.in)

  • πŸ” Secure Cookie-based Sessions

πŸ“ Folder Structure

.
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ controllers/        # All core logic (user, material, etc.)
β”‚   β”œβ”€β”€ routes/             # Express routes
β”‚   β”œβ”€β”€ models/             # Mongoose schemas (Sem, Subject, Unit, Material)
β”‚   β”œβ”€β”€ middlewares/        # Auth & token validators
β”‚   β”œβ”€β”€ config/             # DB config
β”‚   β”œβ”€β”€ utils/              # API Response/Error wrappers
β”‚   └── server.js           # Entry file
└── frontend
    β”œβ”€β”€ src/app/            # App Pages & Layout
    β”œβ”€β”€ src/components/     # Custom UI Components
    └── public/             # Static assets

πŸš€ Getting Started

Backend Setup

cd backend
npm install

Create .env file with the following variables:

MONGODB_URI=your_mongodb_url
JTW_SECRET=your_jwt_secret
LOGIN_TOKEN=admin_token_key
FRONTENT_URL=http://localhost:3000

Run the backend server:

node server.js

Frontend Setup

cd frontend
npm install
npm run dev

πŸ“Œ API Endpoints

πŸ” Auth Routes

Method Endpoint Description
POST /api/v1/user/register Register user
POST /api/v1/user/login Login
GET /api/v1/user/logout Logout (Auth required)
POST /api/v1/user/admin Admin login via token
GET /api/v1/user/admin/getall Get all registered users

πŸ“„ Material Routes

Method Endpoint Description
POST /api/v1/material/create Create and attach material to unit
DELETE /api/v1/material/delete Remove material from unit
POST /api/v1/material/getall Get all materials of a unit

πŸ—‚οΈ Semester Routes

Method Endpoint Description
POST /api/v1/sem/create Create a new semester
DELETE /api/v1/sem/delete Delete a semester
GET /api/v1/sem/admingetall Get all semesters (admin)
GET /api/v1/sem/getall Get all semesters (public)

πŸ“š Subject Routes

Method Endpoint Description
POST /api/v1/subject/create Create a new subject
DELETE /api/v1/subject/delete Delete a subject
POST /api/v1/subject/allsubjects Get all subjects in sem

πŸ“˜ Unit Routes

Method Endpoint Description
POST /api/v1/unit/create Create a unit
DELETE /api/v1/unit/delete Delete a unit
POST /api/v1/unit/getall Get all units of subject

🧠 Tech Stack

  • Frontend: Next.js 14, Tailwind CSS, TypeScript

  • Backend: Express.js, MongoDB, Mongoose

  • Authentication: JWT + Secure Cookies

  • UI Enhancements: Chakra UI + Lottie + Animations

πŸ“„ License

  • This project is licensed under the MIT License.

About

This is the Website build using Next.js and Express.js which will help students to access materials uploaded by the admin of the website.

Topics

Resources

License

Stars

Watchers

Forks