Skip to content

team management website with daily and weekly reporting features, plus admin controls

Notifications You must be signed in to change notification settings

mirkashi/ReportHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReportHub

A highly professional and fully functional team management web application built with the MERN stack (MongoDB, Express, React, Node.js).

Features

πŸ” User Authentication and Authorization

  • Secure user login and registration using JSON Web Tokens (JWT)
  • Password hashing with bcrypt for enhanced security
  • Role-based access control (Admin/User)

πŸ“Š Daily and Weekly Reports

  • 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

πŸ‘¨β€πŸ’Ό Admin Dashboard

  • 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

πŸ“ˆ Progress Tracking

  • Visual progress bars for individual tasks
  • Real-time analytics for team performance
  • Interactive charts for data visualization
  • Task completion tracking

πŸ“± Responsive and Intuitive UI/UX

  • Mobile-friendly design
  • Seamless user experience across all devices
  • Modern and clean interface
  • Accessible navigation

πŸ”” Real-Time Notifications

  • WebSocket integration for instant updates
  • Notifications for task assignments
  • Alerts for new announcements
  • Live updates for report submissions

Tech Stack

Backend

  • 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

Frontend

  • React - UI library
  • React Router - Client-side routing
  • Axios - HTTP client
  • Socket.io-client - Real-time updates
  • Recharts - Data visualization
  • Vite - Build tool

Installation and Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local installation or MongoDB Atlas account)
  • npm or yarn

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
npm install
  1. Create a .env file in the backend directory:
cp .env.example .env
  1. Update the .env file 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
  1. Start the backend server:
# Development mode with auto-restart
npm run dev

# Production mode
npm start

The backend server will run on http://localhost:5000

  1. (Optional) Seed the database with sample data:
npm run seed

This will create:

  • An admin user: admin@reporthub.com / admin123
  • Sample users: john@reporthub.com, jane@reporthub.com, bob@reporthub.com / user123

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Create a .env file in the frontend directory:
cp .env.example .env
  1. Update the .env file:
VITE_API_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000
  1. Start the frontend development server:
npm run dev

The frontend will run on http://localhost:5173

Usage

First Time Setup

  1. Open your browser and navigate to http://localhost:5173
  2. Click on "Register" to create a new account
  3. Fill in your details and submit
  4. You'll be automatically logged in and redirected to the dashboard

Creating an Admin User

Option 1: Using the seed script (Recommended)

cd backend
npm run seed

This 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" } }
)

User Features

  • 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 Features

  • 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

API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user

Users

  • GET /api/users - Get all users (Admin only)
  • GET /api/users/me - Get current user profile
  • GET /api/users/:id - Get user by ID (Admin only)
  • PUT /api/users/:id - Update user (Admin only)
  • PUT /api/users/me/profile - Update own profile
  • GET /api/users/stats/dashboard - Get user statistics
  • DELETE /api/users/:id - Delete user (Admin only)

Reports

  • POST /api/reports - Create daily report
  • GET /api/reports - Get reports (with filters)
  • GET /api/reports/:id - Get single report
  • PUT /api/reports/:id - Update report
  • DELETE /api/reports/:id - Delete report
  • GET /api/reports/weekly/summary - Get weekly summary
  • PUT /api/reports/:id/status - Update report status (Admin only)

Tasks

  • POST /api/tasks - Create task (Admin only)
  • GET /api/tasks - Get tasks
  • GET /api/tasks/:id - Get single task
  • PUT /api/tasks/:id - Update task
  • DELETE /api/tasks/:id - Delete task (Admin only)

Announcements

  • POST /api/announcements - Create announcement (Admin only)
  • GET /api/announcements - Get all active announcements
  • GET /api/announcements/:id - Get single announcement
  • PUT /api/announcements/:id - Update announcement (Admin only)
  • DELETE /api/announcements/:id - Delete announcement (Admin only)
  • PUT /api/announcements/:id/read - Mark announcement as read

Security Features

  • 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

Project Structure

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Support

For support, please open an issue in the GitHub repository.

About

team management website with daily and weekly reporting features, plus admin controls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •