A modern, full-stack project management application built with Next.js, Express.js, Node.js, and MongoDB. TaskTrek helps teams organize projects, manage tasks, and collaborate effectively with real-time updates and intuitive user interfaces.
- User Authentication & Authorization - Secure JWT-based authentication
- Workspace Management - Multi-workspace support for different teams/organizations
- Project Organization - Create and manage projects within workspaces
- Task Management - Comprehensive task creation, assignment, and tracking
- Real-time Notifications - Stay updated with project activities and online status tracking
- Activity Tracking - Monitor task and project changes
- Responsive Design - Works seamlessly on desktop and mobile
- Dark/Light Theme - Toggle between themes for better user experience
- Interactive Dashboard - Visual analytics and progress tracking
- Intuitive Navigation - Easy-to-use sidebar and workspace switching
- Real-time Updates - Live notifications and activity feeds
- TypeScript - Full type safety across the entire stack
- Modern React - Built with React 18 and Next.js 14
- RESTful API - Well-structured Express.js backend
- MongoDB Integration - Robust data persistence with Mongoose
- Docker Support - Containerized development environment
TaskTrek/
βββ apps/
β βββ api/ # Express.js Backend API
β β βββ src/
β β β βββ models/ # MongoDB Models (User, Project, Task, etc.)
β β β βββ routes/ # API Routes (auth, projects, tasks, etc.)
β β β βββ middleware/ # Authentication & validation middleware
β β β βββ services/ # Business logic services
β β βββ package.json
β βββ web/ # Next.js Frontend
β βββ src/
β β βββ app/ # Next.js 14 App Router
β β βββ components/ # React Components
β β βββ contexts/ # React Context providers
β β βββ lib/ # Utility functions and API client
β βββ package.json
βββ packages/ # Shared packages (future expansion)
βββ docker-compose.yml # Development database setup
βββ package.json # Root package.json with workspace scripts
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Material-UI (MUI)
- HTTP Client: Axios
- Theme Management: next-themes
- Framework: Express.js
- Language: TypeScript
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Security: bcryptjs for password hashing
- Package Manager: npm (with workspaces)
- Development: Nodemon, ts-node
- Database Management: MongoDB Express (Web UI)
- Containerization: Docker & Docker Compose
Before you begin, ensure you have the following installed:
- Node.js (v18.17.0 or higher) - Download
- npm (comes with Node.js)
- Docker and Docker Compose - Download
- Git - Download
git clone https://github.com/tasktrek-io/TaskTrek.git
cd TaskTrek
# Install root dependencies and all workspace dependencies
npm install
# Start MongoDB and Mongo Express using Docker
docker-compose up -d
This will start:
- MongoDB on
localhost:27017
- Mongo Express (Database UI) on
localhost:8081
Create environment files for the API:
# Create API environment file
touch apps/api/.env
Add the following to apps/api/.env
:
# Database
MONGO_URI=mongodb://localhost:27017/project_mgmt
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRES_IN=7d
# Server Configuration
PORT=4000
NODE_ENV=development
# CORS Configuration
WEB_ORIGIN=http://localhost:3000
# Start both frontend and backend in development mode
npm run dev
This will start:
- Backend API on
http://localhost:4000
- Frontend Web App on
http://localhost:3000
- Web Application: http://localhost:3000
- API Documentation: http://localhost:4000/health
- Database UI: http://localhost:8081
src/
βββ index.ts # Application entry point
βββ middleware/
β βββ auth.ts # JWT authentication middleware
βββ models/ # MongoDB Mongoose models
β βββ User.ts # User model
β βββ Workspace.ts # Workspace model
β βββ Project.ts # Project model
β βββ Task.ts # Task model
β βββ Notification.ts # Notification model
β βββ TaskActivity.ts # Activity tracking model
βββ routes/ # Express.js route handlers
β βββ auth.ts # Authentication routes
β βββ users.ts # User management routes
β βββ workspaces.ts # Workspace routes
β βββ projects.ts # Project routes
β βββ tasks.ts # Task routes
β βββ notifications.ts # Notification routes
βββ services/ # Business logic services
βββ NotificationService.ts
βββ TaskActivityService.ts
βββ WorkspaceService.ts
src/
βββ app/ # Next.js 14 App Router
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
β βββ auth/ # Authentication pages
β β βββ login/
β β βββ register/
β βββ dashboard/ # Dashboard page
β βββ workspaces/ # Workspace management
β βββ projects/ # Project pages
β βββ tasks/ # Task management
βββ components/ # Reusable React components
β βββ AuthGuard.tsx # Route protection component
β βββ Sidebar.tsx # Navigation sidebar
β βββ NotificationBell.tsx
β βββ TaskActivity.tsx
β βββ ThemeToggle.tsx
βββ contexts/ # React Context providers
β βββ WorkspaceContext.tsx
βββ lib/ # Utilities and configurations
βββ api.ts # Axios API client configuration
From the root directory:
# Development
npm run dev # Start both frontend and backend in development mode
# Production Build
npm run build # Build both applications for production
npm run start # Start both applications in production mode
# Code Quality
npm run lint # Lint both applications
npm run lint:fix # Lint and auto-fix issues in both applications
npm run format # Format all code with Prettier
npm run format:check # Check if code is formatted correctly
npm run type-check # Type check both applications
npm run pre-commit # Run all checks (format, lint, type-check, build)
# Individual Applications
npm run dev --workspace api # Start only the backend API
npm run dev --workspace web # Start only the frontend app
This project enforces code quality through automated tools:
- Prettier: Automatically formats code on commit
- ESLint: Checks for code quality issues and enforces best practices
- Type Checking: Ensures TypeScript types are correct
- Build Validation: Confirms both applications build successfully
- Complete Validation: Runs format check, linting, type checking, and builds before pushing
# Format all files
npm run format
# Check formatting without changing files
npm run format:check
# Lint all workspaces
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Type check all workspaces
npm run type-check
# Run all quality checks
npm run pre-commit
.prettierrc
- Prettier configuration.eslintrc.json
- Root ESLint configurationapps/api/.eslintrc.json
- API-specific ESLint rulesapps/web/.eslintrc.json
- Web app ESLint rules (includes Next.js rules).lintstagedrc.json
- Lint-staged configuration for pre-commit hooks
cd apps/api
# Development with hot reload
npm run dev
# Build TypeScript
npm run build
# Start production server
npm run start
# Lint API code
npm run lint
# Type check API code
npm run type-check
cd apps/web
# Development with hot reload
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Lint web app code
npm run lint
# Type check web app code
npm run type-check
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutGET /api/auth/me
- Get current user
GET /api/workspaces
- Get user workspacesPOST /api/workspaces
- Create workspacePUT /api/workspaces/:id
- Update workspaceDELETE /api/workspaces/:id
- Delete workspace
GET /api/projects
- Get user projectsGET /api/projects/workspace/:workspaceId
- Get workspace projectsPOST /api/projects
- Create projectPUT /api/projects/:id
- Update projectDELETE /api/projects/:id
- Delete project
GET /api/tasks
- Get all tasksGET /api/tasks/assigned
- Get assigned tasksGET /api/tasks/project/:projectId
- Get project tasksPOST /api/tasks
- Create taskPUT /api/tasks/:id
- Update taskDELETE /api/tasks/:id
- Delete task
GET /api/users
- Get usersGET /api/users/:id
- Get user by ID
GET /api/notifications
- Get user notificationsPUT /api/notifications/:id/read
- Mark notification as read
The application supports dark and light themes. Modify theme settings in:
apps/web/tailwind.config.ts
- Tailwind CSS configurationapps/web/src/app/globals.css
- Global CSS variables
Add or modify database models in apps/api/src/models/
. Each model uses Mongoose with TypeScript interfaces.
- Backend: Add routes in
apps/api/src/routes/
- Frontend: Add pages in
apps/web/src/app/
- Components: Add reusable components in
apps/web/src/components/
# Start database services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Create a production docker-compose.prod.yml
:
version: '3.8'
services:
mongo:
image: mongo:6
ports:
- '27017:27017'
volumes:
- mongo_data:/data/db
environment:
MONGO_INITDB_DATABASE: project_mgmt
networks:
- tasktrek-network
api:
build:
context: ./apps/api
dockerfile: Dockerfile
ports:
- '4000:4000'
environment:
- MONGO_URI=mongodb://mongo:27017/project_mgmt
- NODE_ENV=production
depends_on:
- mongo
networks:
- tasktrek-network
web:
build:
context: ./apps/web
dockerfile: Dockerfile
ports:
- '3000:3000'
environment:
- NEXT_PUBLIC_API_URL=http://api:4000
depends_on:
- api
networks:
- tasktrek-network
volumes:
mongo_data:
networks:
tasktrek-network:
driver: bridge
# Run all tests
npm test
# Run tests for specific workspace
npm test --workspace api
npm test --workspace web
# Run tests in watch mode
npm run test:watch
- API Tests: Located in
apps/api/src/__tests__/
- Web Tests: Located in
apps/web/src/__tests__/
- Connect your GitHub repository to Vercel
- Configure build settings:
- Framework Preset: Next.js
- Build Command:
npm run build --workspace web
- Output Directory:
apps/web/.next
- Create a new app on Railway or Heroku
- Connect your GitHub repository
- Set environment variables
- Configure build settings:
- Build Command:
npm run build --workspace api
- Start Command:
npm run start --workspace api
- Build Command:
- Create a MongoDB Atlas account
- Create a new cluster
- Update
MONGO_URI
environment variable
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Use TypeScript for all new code
- Follow ESLint and Prettier configurations
- Write meaningful commit messages
- Add tests for new features
- Next.js - React framework
- Express.js - Backend framework
- MongoDB - Database
- Tailwind CSS - CSS framework
- Material-UI - React components
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the maintainers
- User authentication and authorization
- Workspace and project management
- Task creation and assignment
- Real-time notifications
- Responsive dashboard with analytics
- Dark/light theme support
- List view
Built with β€οΈ by the TaskTrek Team