A full-stack MERN (MongoDB, Express.js, React, Node.js) application for tracking and managing issues/bugs with user authentication and authorization.
- Features
- Demo Screenshots
- Live Demo
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Usage
- Deployment
- API Endpoints
- Project Structure
- Contributing
- License
- User registration and login with JWT tokens
- Protected routes for authenticated users
- Role-based access control (Admin/User)
- Automatic token validation and refresh
- Create, read, update, and delete issues
- Issue prioritization (High, Medium, Low)
- Issue status tracking (Open, In Progress, Closed)
- Detailed issue descriptions and timestamps
- User ownership and permission-based editing
- Responsive design with Tailwind CSS
- Clean and intuitive user interface
- Real-time feedback and loading states
- Search and filter capabilities
- Mobile-friendly design
User login with email and password validation
New user registration with form validation
Main dashboard showing all issues with search and filter options
Detailed view of individual issue
Form to update existing issues
Note: Screenshots are located in the
screenshots/folder.
The application is successfully deployed and accessible online:
- Frontend (Vercel): https://issue-tracker-ivory-omega.vercel.app
- Backend API (Railway): https://issue-tracker-production-87cf.up.railway.app
- β Frontend: Successfully deployed on Vercel
- β Backend: Successfully deployed on Railway
- β Database: MongoDB Atlas (Cloud)
- React 19.1.0 - User interface library
- React Router DOM 7.7.0 - Client-side routing
- Axios 1.11.0 - HTTP client for API requests
- Tailwind CSS 4.1.11 - Utility-first CSS framework
- Lucide React 0.525.0 - Beautiful icon library
- Vite - Fast build tool and development server
- Node.js - JavaScript runtime
- Express.js 5.1.0 - Web application framework
- MongoDB - NoSQL database
- Mongoose 8.16.4 - MongoDB object modeling
- JWT (jsonwebtoken 9.0.2) - Authentication tokens
- bcryptjs 3.0.2 - Password hashing
- CORS 2.8.5 - Cross-origin resource sharing
Before running this application, make sure you have the following installed:
- Node.js (v16 or higher) - Download here
- MongoDB - Download here or use MongoDB Atlas
- Git - Download here
- npm or yarn package manager
git clone https://github.com/SajiniWeerasinghe/Issue-Tracker.git
cd Issue-Trackercd server
npm installcd ../frontend
npm install- Create a
.envfile in theserverdirectory:
cd server
touch .env- Add the following environment variables to the
.envfile:
# Database Configuration
MONGODB_URI=mongodb://localhost:27017/issue-tracker
# For MongoDB Atlas: mongodb+srv://<username>:<password>@<cluster>.mongodb.net/issue-tracker
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRES_IN=7d
# Server Configuration
PORT=5000
NODE_ENV=development
# CORS Configuration
CLIENT_URL=http://localhost:5173The frontend is configured to connect to the backend at http://localhost:5000. If you need to change this:
- Update the API base URL in the frontend authentication context and components
- The default Vite development server runs on
http://localhost:5173
- Start the Backend Server:
cd server
npm run devThe server will start on http://localhost:5000 with nodemon for auto-restart.
- Start the Frontend Development Server:
cd frontend
npm run devThe frontend will start on http://localhost:5173.
- Access the Application:
Open your browser and navigate to http://localhost:5173
- When you first access the application, you'll be redirected to the login page
- Click "Create an account" to register a new user
- After registration/login, you'll be redirected to the issue list
- Click "Create Issue" to add first issue
This application has been successfully deployed using modern cloud platforms:
- Platform: Vercel
- Build Command:
npm run build - Output Directory:
dist - Environment Variables: None required (API URL configured)
- Platform: Railway
- Start Command:
npm start - Environment Variables:
MONGO_URI- MongoDB Atlas connection stringJWT_SECRET- JWT signing secretPORT- Auto-assigned by RailwayNODE_ENV=production
- MongoDB Atlas - Cloud-hosted MongoDB database
- Configured for production with proper connection pooling
- Secured with IP whitelisting and authentication
- β Automatic deployments on push to main branch
- β HTTPS enabled for both frontend and backend
- β Environment-specific configurations
- β CORS properly configured for cross-origin requests
- β Production-optimized builds
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /register |
Register a new user | No |
| POST | /login |
Login user | No |
| GET | /profile |
Get user profile | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | / |
Get all issues | No |
| GET | /:id |
Get single issue | No |
| POST | / |
Create new issue | Yes |
| PUT | /:id |
Update issue | Yes |
| DELETE | /:id |
Delete issue | Yes (Owner/Admin) |
All API endpoints have been tested using Postman for proper functionality, authentication, and error handling.
Base URL: http://localhost:5000/api
Authentication:
POST /auth/register
POST /auth/login
GET /auth/profile (Protected)Issues:
GET /issues
POST /issues (Protected)
PUT /issues/:id (Protected)
DELETE /issues/:id (Owner/Admin only)Issue-Tracker/
βββ frontend/ # React frontend application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # React components
β β β βββ IssueList.jsx
β β β βββ IssueDetails.jsx
β β β βββ IssueCreate.jsx
β β β βββ IssueEdit.jsx
β β β βββ Login.jsx
β β β βββ Register.jsx
β β β βββ Navbar.jsx
β β β βββ ProtectedRoute.jsx
β β βββ context/ # React Context providers
β β β βββ AuthContext.jsx
β β βββ assets/ # Images and icons
β β βββ App.jsx # Main App component
β β βββ main.jsx # Entry point
β β βββ index.css # Global styles
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
βββ server/ # Express backend application
β βββ models/ # Mongoose models
β β βββ Issue.js
β β βββ User.js
β βββ routes/ # API routes
β β βββ issues.js
β β βββ auth.js
β βββ middleware/ # Custom middleware
β β βββ auth.js
β βββ server.js # Main server file
β βββ package.json # Backend dependencies
βββ README.md # Project documentation
- Registration/Login: Users register or login with email and password
- JWT Token: Server returns a JWT token valid for 7 days
- Token Storage: Frontend stores token in localStorage
- Auto-Login: Token is automatically included in API requests
- Route Protection: Protected routes redirect to login if no valid token
- Auto-Logout: Invalid/expired tokens trigger automatic logout
- Any User: View issues, register, login
- Authenticated Users: Create issues, edit any issue
- Issue Owner/Admin: Delete issues (only their own or if admin)
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
npm start- Start production servernpm run dev- Start development server with nodemon
Sajini Weerasinghe
- GitHub: @SajiniWeerasinghe