A comprehensive multi-tenant web application for managing cooperative societies. Each society that registers becomes a "tenant" and must be approved by the system administrator (developer/landlord).
CoopBase is a modern, secure, and efficient platform that allows cooperative societies to:
- Register and get approved by system administrators
- Manage their society operations
- Create and manage services (Savings, Share Capital, Monthly Deductions)
- Handle member registrations and transactions
- Maintain comprehensive audit trails
- Each society operates in its own isolated environment
- Secure data separation between tenants
- Scalable architecture for multiple societies
- Developer (Landlord): System administration and tenant management
- Society Admin: Manage society operations and services
- Members: Access their savings/share accounts (future feature)
- Document upload and verification system
- Approval workflow for new registrations
- Comprehensive society information management
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting and security headers
- File upload validation and security
- HTML5: Semantic markup and structure
- Tailwind CSS: Utility-first CSS framework for modern, responsive design
- JavaScript: Frontend interactivity and API communication
- Node.js: JavaScript runtime environment
- Express.js: Web application framework
- MySQL: Relational database management system
- JWT: JSON Web Tokens for authentication
- Multer: File upload handling
- bcryptjs: Password hashing
- Nodemon: Development server with auto-restart
- Helmet: Security middleware
- CORS: Cross-origin resource sharing
- Express Rate Limit: API rate limiting
CoopBase/
βββ frontend/
β βββ index.html # Landing page with login forms
β βββ society-register.html # Society registration page
β βββ css/
β βββ styles.css # Custom styles
βββ backend/
β βββ server.js # Main Express server
β βββ routes/
β β βββ auth.js # Authentication routes
β βββ controllers/
β β βββ authController.js # Authentication logic
β βββ models/
β β βββ societyModel.js # Society data model
β β βββ userModel.js # User data model
β βββ config/
β βββ db.js # Database configuration
βββ package.json # Node.js dependencies
βββ env.example # Environment variables template
βββ README.md # Project documentation
- Node.js (v16 or higher)
- MySQL (v8.0 or higher)
- XAMPP (for local development)
-
Clone the repository
git clone <repository-url> cd CoopBase
-
Install dependencies
npm install
-
Set up environment variables
cp env.example .env
Edit
.envfile with your database credentials and other settings. -
Set up MySQL database
- Create a new database named
coopbase - The application will automatically create tables on first run
- Create a new database named
-
Create initial developer account
# You'll need to manually insert a developer user in the database # or create a setup script
-
Start the development server
npm run dev
-
Access the application
- Frontend: http://localhost:3000
- API: http://localhost:3000/api
POST /api/auth/developer/login- Developer loginPOST /api/auth/society/login- Society loginPOST /api/auth/society/register- Society registrationPOST /api/auth/logout- Logout
GET /api/auth/pending-societies- Get pending society registrationsPUT /api/auth/society/:societyId/approval- Approve/reject societyGET /api/auth/society/:societyId- Get society details
GET /api/health- Server health status
- societies: Society information and status
- users: User accounts with role-based access
- society_documents: Uploaded documents for verification
- services: Society services (savings, loans, etc.)
- members: Society member information
- transactions: Financial transactions
- audit_logs: System audit trail
- JWT-based token authentication
- Role-based access control
- Password hashing with bcrypt
- Session management
- Input validation and sanitization
- SQL injection prevention
- XSS protection with Helmet
- File upload security
- Rate limiting
- CORS configuration
- Request size limits
- Error handling without sensitive data exposure
- Mobile-first approach
- Tailwind CSS for modern styling
- Cross-browser compatibility
- Clean, intuitive interface
- Form validation
- Loading states and error handling
- File upload with progress indication
- Semantic HTML structure
- ARIA labels and roles
- Keyboard navigation support
- Screen reader compatibility
- Society admin fills out registration form
- Uploads required documents (registration certificate, bylaws)
- System stores registration as "pending"
- Developer reviews application and documents
- Developer approves or rejects the society
- Society admin can login once approved
- View all registered societies
- Manage society approvals
- System statistics and reports
- User management
- Member management
- Service creation and management
- Transaction processing
- Financial reporting
npm test- Unit tests for models and controllers
- Integration tests for API endpoints
- Frontend functionality tests
- Member portal with individual accounts
- Advanced financial management
- Reporting and analytics
- Email notifications
- Mobile application
- API documentation with Swagger
- Advanced search and filtering
- Bulk operations
- Data export functionality
- Redis for caching
- WebSocket for real-time updates
- Docker containerization
- CI/CD pipeline
- Performance monitoring
- Automated backups
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- v1.0.0: Initial release with basic authentication and society registration
- Future versions will include member management and financial features
CoopBase - Empowering Cooperative Societies with Modern Technology