A highly professional and fully functional team management web application built with the MERN stack (MongoDB, Express, React, Node.js).
- Secure user login and registration using JSON Web Tokens (JWT)
- Password hashing with bcrypt for enhanced security
- Role-based access control (Admin/User)
- Easy-to-use forms for submitting daily work reports
- Automatic compilation into weekly summaries
- Track tasks completed, hours worked, blockers, and notes
- Admin approval workflow
- Comprehensive overview of team performance
- User management (activate/deactivate, assign roles)
- View and manage all reports
- Assign tasks to team members
- Send announcements to the team
- Visual analytics and statistics
- Visual progress bars for individual tasks
- Real-time analytics for team performance
- Interactive charts for data visualization
- Task completion tracking
- Mobile-friendly design
- Seamless user experience across all devices
- Modern and clean interface
- Accessible navigation
- WebSocket integration for instant updates
- Notifications for task assignments
- Alerts for new announcements
- Live updates for report submissions
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- Socket.io - Real-time communication
- Helmet - Security headers
- express-rate-limit - Rate limiting
- React - UI library
- React Router - Client-side routing
- Axios - HTTP client
- Socket.io-client - Real-time updates
- Recharts - Data visualization
- Vite - Build tool
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- npm or yarn
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
cp .env.example .env- Update the
.envfile with your configuration:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/reporthub
JWT_SECRET=your_super_secret_jwt_key_change_this
JWT_EXPIRE=7d
NODE_ENV=development
CLIENT_URL=http://localhost:5173- Start the backend server:
# Development mode with auto-restart
npm run dev
# Production mode
npm startThe backend server will run on http://localhost:5000
- (Optional) Seed the database with sample data:
npm run seedThis will create:
- An admin user:
admin@reporthub.com/admin123 - Sample users:
john@reporthub.com,jane@reporthub.com,bob@reporthub.com/user123
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile in the frontend directory:
cp .env.example .env- Update the
.envfile:
VITE_API_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000- Start the frontend development server:
npm run devThe frontend will run on http://localhost:5173
- Open your browser and navigate to
http://localhost:5173 - Click on "Register" to create a new account
- Fill in your details and submit
- You'll be automatically logged in and redirected to the dashboard
Option 1: Using the seed script (Recommended)
cd backend
npm run seedThis will create an admin user with credentials:
- Email:
admin@reporthub.com - Password:
admin123
Option 2: Manual database update
To manually create an admin user, update the user role in MongoDB:
// Connect to MongoDB and run:
db.users.updateOne(
{ email: "your-email@example.com" },
{ $set: { role: "admin" } }
)- Dashboard: View your tasks, recent reports, and statistics
- Submit Reports: Create daily work reports with tasks, hours, and notes
- View Reports: Access all your submitted reports
- Manage Tasks: Update task progress and status
- View Announcements: Stay updated with team announcements
- Admin Dashboard: Comprehensive overview of team metrics
- User Management: Activate/deactivate users, manage roles
- Task Assignment: Assign tasks to team members with priorities and due dates
- Report Review: Review and approve team member reports
- Announcements: Create and manage team-wide announcements
- Analytics: View team performance with interactive charts
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/users- Get all users (Admin only)GET /api/users/me- Get current user profileGET /api/users/:id- Get user by ID (Admin only)PUT /api/users/:id- Update user (Admin only)PUT /api/users/me/profile- Update own profileGET /api/users/stats/dashboard- Get user statisticsDELETE /api/users/:id- Delete user (Admin only)
POST /api/reports- Create daily reportGET /api/reports- Get reports (with filters)GET /api/reports/:id- Get single reportPUT /api/reports/:id- Update reportDELETE /api/reports/:id- Delete reportGET /api/reports/weekly/summary- Get weekly summaryPUT /api/reports/:id/status- Update report status (Admin only)
POST /api/tasks- Create task (Admin only)GET /api/tasks- Get tasksGET /api/tasks/:id- Get single taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task (Admin only)
POST /api/announcements- Create announcement (Admin only)GET /api/announcements- Get all active announcementsGET /api/announcements/:id- Get single announcementPUT /api/announcements/:id- Update announcement (Admin only)DELETE /api/announcements/:id- Delete announcement (Admin only)PUT /api/announcements/:id/read- Mark announcement as read
- JWT-based authentication
- Password hashing with bcrypt
- Role-based access control
- Rate limiting to prevent abuse
- Security headers with Helmet
- Input validation
- Protected routes
- XSS prevention
- CORS configuration
ReportHub/
βββ backend/
β βββ config/
β β βββ db.js
β βββ models/
β β βββ User.js
β β βββ Report.js
β β βββ Task.js
β β βββ Announcement.js
β βββ routes/
β β βββ auth.js
β β βββ users.js
β β βββ reports.js
β β βββ tasks.js
β β βββ announcements.js
β βββ middleware/
β β βββ auth.js
β β βββ error.js
β βββ utils/
β β βββ helpers.js
β βββ server.js
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.jsx
β β β βββ Notifications.jsx
β β βββ pages/
β β β βββ Login.jsx
β β β βββ Register.jsx
β β β βββ Dashboard.jsx
β β β βββ AdminDashboard.jsx
β β β βββ Reports.jsx
β β β βββ CreateReport.jsx
β β β βββ Tasks.jsx
β β β βββ Announcements.jsx
β β βββ context/
β β β βββ AuthContext.jsx
β β β βββ SocketContext.jsx
β β βββ services/
β β β βββ api.js
β β β βββ index.js
β β βββ App.jsx
β β βββ main.jsx
β β βββ index.css
β βββ index.html
β βββ vite.config.js
β βββ package.json
βββ README.md
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
For support, please open an issue in the GitHub repository.