A comprehensive welfare management system designed specifically for armed forces personnel and their families. This system provides digital solutions for welfare schemes, emergency alerts, grievance handling, and community marketplace features.
- RESTful API with comprehensive endpoints
- Real-time communication using Socket.io
- MongoDB for data persistence
- Firebase integration for authentication and storage
- Comprehensive middleware for security and validation
- Modern React-based user interface
- Real-time updates and notifications
- Responsive design for all devices
- Progressive Web App capabilities
- Integrated authentication system
- Node.js (β₯18.0.0)
- npm (β₯8.0.0)
- MongoDB (local or cloud)
- Firebase project (for authentication and storage)
git clone <repository-url>
cd quantum-skill-sangam25
# Install dependencies for both frontend and backend
npm run setupCreate backend/.env file:
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/armed_forces_welfare
DB_NAME=armed_forces_welfare
# Firebase Configuration
FIREBASE_API_KEY=your_firebase_api_key
FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
FIREBASE_MESSAGING_SENDER_ID=your_sender_id
FIREBASE_APP_ID=your_app_id
# Firebase Admin SDK
FIREBASE_PRIVATE_KEY=your_private_key
FIREBASE_CLIENT_EMAIL=your_client_email
# API Configuration
PORT=3001
NODE_ENV=development
JWT_SECRET=your_jwt_secret# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_SOCKET_URL=http://localhost:3001
# Firebase Configuration (same as backend)
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id# Seed initial data
npm run seed
# Create database indexes
cd backend && npm run indexes# Start both backend and frontend in development mode
npm run devThis will start:
- Backend API: http://localhost:3001
- Frontend App: http://localhost:3000
- API Documentation: http://localhost:3001/api/docs
- Health Check: http://localhost:3001/health
# Build and start in production mode
npm start- Multi-role authentication (Officer, Family, Admin)
- Firebase integration for social login
- JWT-based session management
- Role-based access control
- Browse available welfare schemes
- Online application submission
- Document upload and verification
- Application status tracking
- Admin approval workflow
- Real-time emergency notifications
- GPS-based location sharing
- Severity-based alert classification
- Response coordination
- Emergency contact management
- Online grievance submission
- Category-based classification
- Priority-based handling
- Real-time status updates
- Resolution tracking
- Peer-to-peer item exchange
- Category-based browsing
- Inquiry system
- Location-based filtering
- Transaction management
- Role-specific dashboards
- Real-time statistics
- Activity monitoring
- System health indicators
- Notification center
- Socket.io integration for live updates
- Real-time notifications
- Emergency alert broadcasting
- Chat functionality for marketplace
- Secure file upload/download
- Multiple file format support
- File size validation
- Cloud storage integration
- Rate limiting
- Input validation and sanitization
- CORS configuration
- Helmet.js security headers
- Error handling and logging
quantum-skill-sangam25/
βββ backend/ # Node.js/Express API
β βββ config/ # Configuration files
β βββ middleware/ # Express middleware
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ utils/ # Utility functions
β βββ __tests__/ # Test files
βββ frontend/ # Next.js application
β βββ app/ # Next.js 13+ app directory
β βββ components/ # React components
β βββ contexts/ # React contexts
β βββ hooks/ # Custom hooks
β βββ lib/ # Utility libraries
β βββ public/ # Static assets
βββ docs/ # Documentation
npm run dev- Start development serversnpm start- Start production serversnpm run build- Build both applicationsnpm test- Run all testsnpm run setup- Install all dependencies
npm run dev- Development server with hot reloadnpm run seed- Populate database with sample datanpm run indexes- Create database indexesnpm run backup- Backup database
npm run dev- Development servernpm run build- Production buildnpm run start- Production server
# Run all tests
npm test
# Backend integration tests
npm run test:integration
# Backend unit tests
cd backend && npm run test:unit
# Frontend tests
cd frontend && npm testVisit http://localhost:3001/api/docs when the server is running to access interactive API documentation.
The system uses MongoDB for data persistence. Configure the connection in backend/config/database.js.
Firebase is used for:
- Authentication services
- File storage
- Real-time database features
Configure Firebase in backend/config/firebase.js and frontend/lib/firebase.ts.
Real-time features are powered by Socket.io. Configuration is in backend/utils/socket.js.
# Kill processes on default ports
npx kill-port 3000 3001- Ensure MongoDB is running
- Check connection string in environment variables
- Verify network connectivity
- Verify Firebase configuration
- Check API keys and project settings
- Ensure proper domain configuration
- Verify frontend URL in backend CORS configuration
- Check environment variables
- Backend: http://localhost:3001/health
- Real-time status monitoring
- Database connectivity checks
- Winston logging for backend
- Console logging for development
- File logging for production
- Input validation and sanitization
- Rate limiting
- CORS configuration
- Helmet.js security headers
- JWT token authentication
- Role-based access control
- File upload restrictions
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new features
- Run the test suite
- Submit a pull request
This project is licensed under the ISC License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Contact the development team
- Check the documentation
- v1.0.0 - Initial release with core functionality
- User authentication and authorization
- Welfare schemes management
- Emergency alert system
- Grievance management
- Community marketplace
- Real-time notifications
Note: This system is designed specifically for armed forces welfare management and contains sensitive features. Ensure proper security measures are in place before deployment.