Skip to content

ShaliniWanasinghe/VUC-University-Digital-NoticeBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ VUC β€” Vavuniya University Connect

A full-stack Digital Notice Board application built for university environments. VUC enables administrators and moderators to publish notices across categories, while students can browse, filter, and stay informed β€” all through a modern, responsive web interface.


πŸ“‹ Table of Contents


✨ Features

  • JWT Authentication β€” Secure login & registration with bcrypt password hashing
  • Role-Based Access Control β€” Three roles: admin, moderator, student
  • Notice Management β€” Full CRUD operations for creating, editing, and deleting notices
  • Approval Workflow β€” Notices go through a pending β†’ published / rejected pipeline
  • Category Filtering β€” Browse notices by categories: Academic, Sports, Clubs & Societies, Welfare, Marketplace, Lost & Found, Donations, Hostel & Accommodation
  • Pending Notices Queue β€” Dedicated admin view for approving or rejecting notices
  • User Profiles β€” View and manage user profile information
  • Responsive Design β€” Modern UI with Tailwind CSS, Framer Motion animations, and Lucide icons
  • Toast Notifications β€” Real-time feedback using React Hot Toast

πŸ›  Tech Stack

Frontend

Technology Purpose
React 19 UI library
Vite 7 Build tool & dev server
Tailwind CSS 4 Utility-first styling
React Router 7 Client-side routing
Axios HTTP client
Framer Motion Animations
Lucide React Icon library
React Hot Toast Toast notifications

Backend

Technology Purpose
Node.js + Express 4 REST API server
MongoDB + Mongoose 8 Database & ODM
JSON Web Tokens Authentication
bcryptjs Password hashing
Nodemailer Email utilities
dotenv Environment config
CORS Cross-origin support

πŸ“ Project Structure

VUC_project/
β”œβ”€β”€ client/                     # Frontend (React + Vite)
β”‚   β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/                # Axios API configuration
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateNotice.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EditNotice.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ NoticeList.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.jsx
β”‚   β”‚   β”‚   └── ProtectedRoute.jsx
β”‚   β”‚   β”œβ”€β”€ context/            # React context (AuthContext)
β”‚   β”‚   β”œβ”€β”€ pages/              # Route-level pages
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CategoryPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PendingNotices.jsx
β”‚   β”‚   β”‚   └── StudentServices.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx             # Root component & routes
β”‚   β”‚   β”œβ”€β”€ main.jsx            # Entry point
β”‚   β”‚   └── index.css           # Global styles
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                     # Backend (Express + MongoDB)
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js               # MongoDB connection
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js   # Login & register logic
β”‚   β”‚   └── noticeController.js # Notice CRUD & status updates
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── authMiddleware.js   # JWT auth & role checks
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js             # User schema (userId, name, email, role)
β”‚   β”‚   └── Notice.js           # Notice schema (title, content, category, status)
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js       # POST /login, /register
β”‚   β”‚   └── noticeRoutes.js     # CRUD + status endpoints
β”‚   β”œβ”€β”€ utils/                  # Utility helpers
β”‚   β”œβ”€β”€ seed.js                 # Database seeding script
β”‚   β”œβ”€β”€ server.js               # Express app entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ .gitignore
└── README.md

πŸ“¦ Prerequisites

  • Node.js v18 or higher
  • npm v9 or higher
  • MongoDB Atlas account (or a local MongoDB instance)

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/your-username/VUC_project.git
cd VUC_project

2. Setup the Backend

cd server
npm install

Create a .env file in the server/ directory (see Environment Variables).

# Start the development server
npm run dev

The API server will start on http://localhost:5000.

3. Setup the Frontend

cd client
npm install

Create a .env file in the client/ directory:

VITE_API_URL=http://localhost:5000/api
# Start the development server
npm run dev

The client will start on http://localhost:5173.

4. Seed the Database (Optional)

cd server
npm run seed

This populates the database with sample users and notices for testing.


πŸ” Environment Variables

Server (server/.env)

Variable Description Example
PORT Server port 5000
MONGO_URI MongoDB connection string mongodb+srv://user:pass@cluster.mongodb.net/vuc
JWT_SECRET Secret key for JWT signing your_jwt_secret_key

Client (client/.env)

Variable Description Example
VITE_API_URL Backend API base URL http://localhost:5000/api

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description Access
POST /api/auth/register Register a new user Public
POST /api/auth/login Login & receive JWT Public

Notices

Method Endpoint Description Access
GET /api/notices Get all notices (filtered by role) Authenticated
GET /api/notices/:id Get a single notice Authenticated
POST /api/notices Create a new notice Admin, Moderator
PUT /api/notices/:id Update a notice Admin, Moderator
PATCH /api/notices/:id/status Approve / reject a notice Admin only
DELETE /api/notices/:id Delete a notice Admin, Moderator

πŸ‘₯ User Roles

Role Permissions
Admin Full access β€” create, edit, delete, approve/reject notices, manage all content
Moderator Create, edit, and delete notices (subject to approval workflow)
Student View published notices only

User ID Format

User IDs follow the university registration pattern:

Year/Course/RegNo β€” e.g., 2021/ICT/075

πŸ—‚ Notice Categories

Category
Academic
Sports
Clubs & Societies
Welfare & Student Services
Marketplace
Lost & Found
Donations
Hostel & Accommodation

🌱 Database Seeding

Run the seed script to populate the database with test data:

cd server
npm run seed

This creates sample users (admin, moderator, student) and notices across various categories, useful for development and testing.


πŸ“Έ Screenshots

Student Dashboard

admin approveScreenshot 2026-02-10 124730

admin approve ad dashboard

πŸ“„ License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages