A comprehensive web portal for managing National Service Scheme (NSS) activities, volunteers, and events. Built with Node.js, React, and MongoDB.
- Home Page: Hero section, features, statistics, and call-to-action
- About Us: NSS information, mission, vision, team, and achievements
- Events: Browse upcoming and past events with filtering
- Gallery: View approved images from community service activities
- Volunteer Registration: Join NSS as a volunteer
- Dashboard: Overview of activities and upcoming events
- Event Management: Register/unregister for events, view participation history
- Profile Management: Update personal information and profile picture
- Gallery Upload: Share images from completed activities (pending admin approval)
- Achievements: Track participation and earned certificates
- Dashboard: Statistics and overview of NSS activities
- Volunteer Management: Approve registrations, manage volunteer accounts
- Event Management: Create, edit, and manage events
- Gallery Management: Approve/reject volunteer uploads, add official images
- Announcements: Broadcast messages to volunteers
- Reports: Generate participation and activity reports
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- express-validator - Input validation
- helmet - Security headers
- express-rate-limit - Rate limiting
- multer - File uploads
- nodemailer - Email functionality
- React.js - UI library
- React Router - Navigation
- React Query - Data fetching and caching
- React Hook Form - Form management
- Tailwind CSS - Styling
- Framer Motion - Animations
- Lucide React - Icons
- React Toastify - Notifications
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
git clone <repository-url>
cd nss-portalnpm installcd client
npm install
cd ..Create a .env file in the root directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/nss-portal
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=7d
# Email Configuration (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
# File Upload Configuration
UPLOAD_PATH=./uploads
MAX_FILE_SIZE=5242880Make sure MongoDB is running on your system:
# Start MongoDB service
sudo systemctl start mongod
# Or start MongoDB manually
mongodnpm run dev:fullnpm run devnpm run clientnpm run build
npm start- Frontend: http://localhost:3000
- Backend API: http://localhost:5000/api
- MongoDB: mongodb://localhost:27017/nss-portal
The application will automatically create the necessary collections when it starts. However, you may want to create an admin user manually:
// In MongoDB shell or MongoDB Compass
use nss-portal
db.users.insertOne({
name: "Admin User",
email: "abc.com",
password: "6$28#0...", // Hashed password
role: "admin",
isApproved: true,
isActive: true,
college: "Your College",
department: "Computer Science",
year: 4,
createdAt: new Date(),
updatedAt: new Date()
})You can create an admin account through the registration process and then manually update the role in the database, or use the MongoDB command above.
nss-portal/
βββ client/ # React frontend
β βββ public/ # Static files
β βββ src/ # Source code
β β βββ components/ # Reusable components
β β βββ contexts/ # React contexts
β β βββ pages/ # Page components
β β βββ App.js # Main app component
β βββ package.json
βββ models/ # MongoDB schemas
βββ routes/ # API routes
βββ middleware/ # Custom middleware
βββ server.js # Main server file
βββ package.json
POST /api/auth/register- Volunteer registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user profilePOST /api/auth/change-password- Change password
GET /api/events- Get all eventsGET /api/events/:id- Get single eventPOST /api/events- Create event (Admin only)PUT /api/events/:id- Update event (Admin only)DELETE /api/events/:id- Delete event (Admin only)POST /api/events/:id/register- Register for event (Volunteer only)POST /api/events/:id/unregister- Unregister from event (Volunteer only)
GET /api/volunteers/profile- Get volunteer profilePUT /api/volunteers/profile- Update profileGET /api/volunteers/events/upcoming- Get upcoming eventsGET /api/volunteers/events/past- Get past eventsGET /api/volunteers/stats- Get volunteer statistics
GET /api/admin/dashboard- Get admin dashboard statsGET /api/admin/volunteers- Get all volunteersPUT /api/admin/volunteers/:id/approve- Approve volunteerGET /api/admin/gallery/pending- Get pending gallery approvalsPUT /api/admin/gallery/:id/approve- Approve gallery item
GET /api/gallery- Get approved gallery imagesPOST /api/gallery- Upload image (Volunteer only)PUT /api/gallery/:id/like- Like/unlike image
GET /api/announcements- Get all announcementsPOST /api/announcements- Create announcement (Admin only)PUT /api/announcements/:id- Update announcement (Admin only)
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting
- Security headers with helmet
- Input validation
- CORS configuration
- Protected routes
The application is fully responsive and works on:
- Desktop computers
- Tablets
- Mobile phones
# Run frontend tests
cd client
npm test
# Run backend tests (if implemented)
npm test- Set
NODE_ENV=productionin environment variables - Use a process manager like PM2
- Set up reverse proxy with Nginx
- Configure SSL certificates
- Build the application:
npm run build - Serve the build folder with a web server
- Configure environment variables for production
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
Stay updated with the latest features and bug fixes by regularly pulling from the main branch.
Note: This is a development version. For production use, ensure proper security measures, environment configuration, and testing are in place.