A full-stack MERN application that provides a multi-tenant task management system with role-based access control.
- Multi-Tenancy: Data isolation per organization
- Role-Based Access Control (RBAC): Admin, Manager, Member roles
- Authentication: JWT-based session handling
- Registration & Onboarding: Create or join organizations
- Invitation System: Invite users via email or invite link
- CRUD Operations: Create, read, update, and delete tasks
- Task Assignment: Assign tasks to organization members
- Task Properties: Categories, priorities, due dates
- Status Automation: Auto-expire overdue tasks
- In-app Notifications: For overdue tasks and other events
- Backend: Node.js, Express.js, MongoDB (Mongoose)
- Frontend: React.js, Tailwind CSS
- Authentication: JWT
- Docker: Containerized services
- Task Scheduling: node-cron
.
βββ client/ # React frontend
β βββ public/ # Static files
β βββ src/ # Source files
β β βββ components/ # Reusable components
β β βββ context/ # React context for state management
β β βββ pages/ # Page components
β β βββ ...
β βββ Dockerfile # Client Docker configuration
β βββ nginx.conf # Nginx configuration for client
βββ server/ # Express.js backend
β βββ config/ # Configuration files
β βββ controllers/ # Route controllers
β βββ middleware/ # Custom middleware
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ services/ # Business logic
β βββ utils/ # Utility functions
β βββ .env # Environment variables
β βββ Dockerfile # Server Docker configuration
β βββ server.js # Entry point
βββ docker-compose.yml # Docker Compose configuration
- Node.js (v14+ recommended)
- MongoDB
- Docker and Docker Compose (for containerized deployment)
- Clone the repository:
git clone <repository-url>
cd MultiTenant-TaskManager- Install dependencies:
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm install- Set up environment variables:
# In server directory
cp .env.example .env
# Edit .env with your configuration- Run the development servers:
# Start MongoDB (if not using Docker)
mongod
# Start server (from server directory)
npm run dev
# Start client (from client directory)
npm start-
Make sure Docker and Docker Compose are installed.
-
Build and run containers:
docker-compose up -d --build- Access the application:
- Frontend: http://localhost
- Backend API: http://localhost/api
- Stop containers:
docker-compose down- Update environment variables for production in
.envfile:
NODE_ENV=production
JWT_SECRET=<strong-secret-key>
- Build the client for production:
cd client
npm run build- Deploy using Docker:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -dFor continuous integration and deployment:
-
Set up a CI pipeline (e.g., GitHub Actions, Jenkins) to:
- Run tests
- Build Docker images
- Push to container registry
-
Configure CD to:
- Pull latest images
- Update services
- Run migrations
- Monitor deployment
Run tests:
# Server tests
cd server
npm test
# Client tests
cd client
npm test