A comprehensive project management application built with React + TypeScript, Node.js + Express, and PostgreSQL. Features include multi-tenant data isolation, analytics dashboard, file ingestion, and background job processing.
- Backend API: https://project-tracker-public.onrender.com
- Frontend: https://project-tracker-public-dqlrlmhsr-yazanbaker94s-projects.vercel.app
- JWT-based authentication (sign-up, login, logout)
- Multi-tenant data isolation with organizations
- Users can only access their organization's data
- Create, read, update, delete projects
- Project status tracking (active/completed)
- Automatic completion time tracking
- Organization-wide project visibility
- Real-time project statistics
- User and organization-wide metrics
- Average completion time calculations
- Top contributors leaderboard
- Recent activity tracking
- Background job recalculation with progress tracking
- Asynchronous file upload processing
- Job status tracking with real-time updates
- Mock file processing simulation
- Support for multiple file types (CSV, JSON, XML, PDF, etc.)
- Analytics recalculation with progress tracking
- Webhook-style callback system
- Job status monitoring
- Step-by-step processing feedback
- React 18 with TypeScript
- TailwindCSS for styling
- Axios for API communication
- Context API for state management
- Node.js with Express
- TypeScript for type safety
- PostgreSQL database
- JWT authentication
- bcryptjs for password hashing
- Helmet.js for security headers
- CORS configuration
- Morgan for request logging
- Environment-based configuration
- Node.js 16+ and npm
- PostgreSQL 12+
- Git
git clone <your-repo-url>
cd project-trackercd backend
npm installCreate a .env file in the backend directory:
# Database Configuration (Choose one option)
# Option 1: Full Database URL (Recommended for production)
DATABASE_URL=postgresql://username:password@host:port/database
# Option 2: Individual Database Variables (for local development)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=project_tracker
DB_USER=postgres
DB_PASSWORD=your_password
# JWT Secret (REQUIRED - Generate a strong secret)
JWT_SECRET=your_super_secret_jwt_key_here_make_it_long_and_random
# Server Configuration
NODE_ENV=development
PORT=5000
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:3000For Local Development:
# Create database
createdb project_tracker
# Initialize database with all tables and features
npm run init-dbFor Production (with DATABASE_URL):
# Initialize production database
npm run init-production-db# Development mode (with auto-restart)
npm run dev
# Production mode
npm run build
npm startBackend will be available at: http://localhost:5000
cd frontend
npm installCreate a .env file in the frontend directory:
# API Base URL
REACT_APP_API_URL=http://localhost:5000/api
# For production, use your deployed backend URL:
# REACT_APP_API_URL=https://project-tracker-public.onrender.com/apinpm startFrontend will be available at: http://localhost:3000
The application uses PostgreSQL with the following tables:
users- User accounts with organization associationorganizations- Multi-tenant organization dataprojects- Project data with completion tracking
ingestion_jobs- File upload job trackingbackground_jobs- Background task processing
- Triggers for automatic timestamp updates
- Indexes for optimized queries
- Foreign key constraints for data integrity
- Multi-tenant data isolation
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/projects- List projects (organization-scoped)POST /api/projects- Create projectGET /api/projects/:id- Get specific projectPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete projectGET /api/projects/stats- Get project statistics
GET /api/analytics/dashboard- Complete analytics dashboardGET /api/analytics/organization- Organization analyticsGET /api/analytics/user- User-specific analyticsGET /api/analytics/completion-time- Average completion time
POST /api/ingest/init- Initialize file uploadGET /api/ingest/status/:jobId- Check job statusGET /api/ingest/jobs- List user's jobsGET /api/ingest/stats- Ingestion statistics
POST /api/jobs/recompute-metrics- Trigger analytics recalculationGET /api/jobs/status/:jobId- Check job statusGET /api/jobs- List background jobsGET /api/jobs/stats- Job statistics
GET /- API documentationGET /health- Health check
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run init-db # Initialize local database
npm run init-production-db # Initialize production databasenpm start # Start development server
npm run build # Build for production
npm test # Run testsThe application includes several migration scripts:
# Individual migrations (if needed)
npm run migrate:organizations # Add multi-tenant support
npm run migrate:analytics # Add completion time tracking
npm run migrate:ingestion # Add file ingestion features
npm run migrate:background-jobs # Add background job processing- Set Environment Variables:
DATABASE_URL=postgresql://user:pass@host:port/db
JWT_SECRET=your_super_secret_jwt_key
NODE_ENV=production
PORT=5000
FRONTEND_URL=https://project-tracker-public-dqlrlmhsr-yazanbaker94s-projects.vercel.app-
Deploy:
- Connect your Git repository
- Set build command:
npm install && npm run build - Set start command:
npm start - Add environment variables in dashboard
-
Initialize Database:
- Run
npm run init-production-dbvia dashboard shell - Or add to build command:
npm run build && npm run init-production-db
- Run
- Set Environment Variables:
REACT_APP_API_URL=https://your-backend-domain.com/api- Deploy:
- Connect your Git repository
- Set build command:
npm run build - Set publish directory:
build
# Register user
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"SecurePass123","first_name":"Test","last_name":"User"}'
# Login (copy token from response)
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"SecurePass123"}'
# Create project (use token)
curl -X POST http://localhost:5000/api/projects \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"title":"Test Project","description":"Testing API","status":"active"}'
# Get analytics
curl http://localhost:5000/api/analytics/dashboard \
-H "Authorization: Bearer YOUR_TOKEN"- Register a new account
- Create some projects
- Test project status updates
- View analytics dashboard
- Try file ingestion feature
- Test background job recalculation
- JWT Authentication with secure token handling
- Password Hashing with bcryptjs
- CORS Protection with configurable origins
- Security Headers with Helmet.js
- Multi-tenant Data Isolation - users can only access their organization's data
- Environment Variable Protection - sensitive data in .env files
- SQL Injection Prevention - parameterized queries
- Input Validation - request validation middleware
project-tracker/
βββ backend/ # Node.js + Express API
β βββ src/
β β βββ config/ # Database and configuration
β β βββ controllers/ # Route handlers
β β βββ middleware/ # Authentication, validation, errors
β β βββ models/ # Database models
β β βββ routes/ # API routes
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Database initialization scripts
β β βββ index.ts # Server entry point
β βββ .env.example # Environment variables template
β βββ package.json
βββ frontend/ # React + TypeScript UI
β βββ src/
β β βββ components/ # React components
β β βββ context/ # Context providers
β β βββ services/ # API service functions
β β βββ types/ # TypeScript type definitions
β β βββ App.tsx # Main app component
β βββ .env.example # Environment variables template
β βββ package.json
βββ .gitignore # Git ignore rules
βββ README.md # This file
- β React frontend with TypeScript
- β Node.js backend with Express
- β PostgreSQL database integration
- β RESTful API design
- β Multi-tenant architecture with data isolation
- β Asynchronous job processing with status tracking
- β Real-time updates with polling
- β File upload simulation with webhook callbacks
- β Background job processing with progress tracking
- β Environment-based configuration
- β Security best practices
- β Error handling and validation
- β Database migrations
- β Deployment documentation
- β Responsive design with TailwindCSS
- β Loading states and error handling
- β Real-time progress tracking
- β Intuitive navigation with tabs
- β Visual feedback with progress bars and notifications
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Database Connection Failed:
- Check PostgreSQL is running
- Verify DATABASE_URL or individual DB variables
- Ensure database exists and user has permissions
CORS Errors:
- Check FRONTEND_URL environment variable
- Ensure frontend URL matches CORS configuration
JWT Token Errors:
- Verify JWT_SECRET is set and consistent
- Check token expiration (7 days default)
Build Errors:
- Run
npm installin both frontend and backend - Check Node.js version (16+ required)
- Verify TypeScript compilation:
npm run build
- Check the console logs for detailed error messages
- Verify all environment variables are set correctly
- Test API endpoints individually with cURL
- Check database connectivity and table creation
You now have a fully functional, production-ready project management application with:
- π Secure authentication with multi-tenant support
- π Advanced analytics with real-time recalculation
- π€ File processing with job tracking
- βοΈ Background jobs with progress monitoring
- π¨ Modern UI with responsive design
- π Deployment ready with comprehensive documentation
Happy coding! π