Skip to content

Engineered a robust full-stack bug reporting and tracking application featuring role-based access control, real-time data synchronization, and secure JWT authentication, leveraging the MERN stack and Tailwind CSS to deliver a responsive, user-centric interface and efficient bug management workflow.

Notifications You must be signed in to change notification settings

CodeWithAshafak/-Bug-Reporting-Tracking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Bug Reporting & Tracking System

A full-stack web application for reporting, tracking, and managing software bugs with role-based access control.

Features

Core Functionality

  • Bug Reporting: Users can report bugs with title, description, and severity levels
  • Bug Tracking: Track bug status through Open β†’ In Progress β†’ Closed workflow
  • Search & Filter: Filter bugs by status, severity, and search by title
  • Role-based Access:
    • Reporter: Can submit bugs and view/update only their own bugs
    • Admin: Can view and update all bugs, access admin dashboard with statistics

Technical Features

  • JWT-based authentication
  • RESTful API with Express.js
  • MongoDB database with Mongoose ODM
  • React frontend with Tailwind CSS
  • Responsive design
  • Real-time updates

Tech Stack

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • MongoDB - Database
  • Mongoose - ODM for MongoDB
  • JWT - Authentication
  • bcryptjs - Password hashing
  • express-validator - Input validation

Frontend

  • React - UI library
  • React Router - Client-side routing
  • Tailwind CSS - Styling
  • Axios - HTTP client
  • Context API - State management

Relationships

  • One-to-Many: User β†’ Bugs (A user can report multiple bugs)
  • One-to-Many: User β†’ Comments (A user can make multiple comments)
  • One-to-Many: Bug β†’ Comments (A bug can have multiple comments)
  • Many-to-One: Bug β†’ User (A bug is reported by one user, can be assigned to one user)

Setup Instructions

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or cloud instance)
  • npm or yarn

Backend Setup

  1. Navigate to server directory

    cd server
  2. Install dependencies

    npm install
  3. Environment Configuration Create a .env file in the server directory:

    MONGODB_URI=mongodb://localhost:27017/bug_tracking
    JWT_SECRET=your_super_secret_jwt_key_here_change_in_production
    PORT=5000
    NODE_ENV=development
  4. Start the server

    # Development mode with auto-restart
    npm run dev
    
    # Production mode
    npm start

Frontend Setup

  1. Navigate to client directory

    cd client
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Build for production

    npm run build

Database Setup

  1. Local MongoDB

    • Install MongoDB locally
    • Start MongoDB service
    • Update MONGODB_URI in .env file
  2. MongoDB Atlas (Cloud)

    • Create a free account at MongoDB Atlas
    • Create a new cluster
    • Get connection string and update MONGODB_URI in .env file

API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user

Bugs

  • POST /api/bugs - Create new bug (authenticated)

  • GET /api/bugs - Get bugs with filters (authenticated)

  • GET /api/bugs/:id - Get specific bug (authenticated)

  • PUT /api/bugs/:id - Update bug (authenticated)

  • POST /api/bugs/:id/comments - Add comment to bug (authenticated)

Users

  • GET /api/users - Get all users (admin only)
  • GET /api/users/:id - Get user by ID (authenticated)

Usage

For Reporters

  1. Register as a new user (automatically gets reporter role)
  2. Use "Report New Bug" button to create bug reports
  3. View and update status of your own bugs
  4. Add comments to your bugs

For Admins

  1. Login with admin credentials:
    • Email: ashafak04@gmail.com
    • Password: ashafak123
  2. View dashboard with bug statistics
  3. View and manage all bugs in the system
  4. Update bug status and assign bugs to users
  5. Add comments to any bug

Note: Admin account is pre-configured and cannot be registered through the normal registration process for security reasons.

AI Usage Documentation

Where AI was used:

  • Database Schema Design: AI helped design the MongoDB schema with proper relationships and validation

  • UI/UX Design: AI helped create responsive layouts and component structures

Why AI was used:

  • Efficiency: Accelerated development by generating standard CRUD operations and authentication flows
  • Best Practices: AI helped implement security best practices for authentication and data validation
  • Code Quality: Ensured consistent code structure and error handling patterns

What was learned:

  • Modern React Patterns: Context API for state management, custom hooks, and component composition
  • Security Implementation: JWT token handling, password hashing, and input validation
  • Database Design: MongoDB schema design with proper indexing and relationships
  • API Design: RESTful API design with proper error handling and status codes
  • Deployment: Understanding of full-stack deployment processes and environment configuration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

About

Engineered a robust full-stack bug reporting and tracking application featuring role-based access control, real-time data synchronization, and secure JWT authentication, leveraging the MERN stack and Tailwind CSS to deliver a responsive, user-centric interface and efficient bug management workflow.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages