A comprehensive web application for managing NGO volunteers, events, tasks, and more with a PostgreSQL database backend.
- User authentication (Login/Register)
- Dynamic user profiles based on login
- Dashboard with key statistics and visualizations
- Volunteer management
- Event organization
- Task assignment
- Idea submission and voting
- Certificate management
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
- Install PostgreSQL if you don't have it already
- Create a new database:
CREATE DATABASE ngo_management;
- The application will automatically create the necessary tables when it starts
- Clone the repository
- Install dependencies:
npm install - Update the database configuration in server.js if needed:
const pool = new Pool({ user: 'postgres', // Replace with your PostgreSQL username host: 'localhost', // Replace with your PostgreSQL host database: 'ngo_management', // Replace with your database name password: 'YOUR_PASSWORD_HERE', // Replace with your PostgreSQL password port: 5432, });
-
Start the server:
npm startFor development with auto-reload:
npm run dev -
Open your browser and navigate to:
http://localhost:3000
The system automatically creates an admin user on first run:
- Admin User:
- Email: admin@example.com
- Password: admin123
The application provides the following API endpoints:
-
Authentication:
- POST /api/auth/register - Register a new user
- POST /api/auth/login - Login and get token
-
Users:
- GET /api/users/me - Get current user info
- GET /api/users/:id/profile - Get user profile
-
Dashboard:
- GET /api/dashboard - Get dashboard statistics
-
Certificates:
- GET /api/certificates/:id/download - Download certificate
For production environments:
- Update the JWT_SECRET in server.js to a strong, unique key
- Enable HTTPS
- Implement more robust password hashing
- Set up proper CORS restrictions
- Add rate limiting