A comprehensive freelancing platform built with the MERN stack (MongoDB, Express.js, React.js, Node.js) and TypeScript.
- Three User Roles: Admin, Freelancer, and Client with role-based access control
- Project Management: Complete project lifecycle from posting to completion
- Proposal System: Freelancers can submit proposals with custom pricing
- Secure Payments: Stripe integration with escrow system
- Real-time Messaging: Socket.io powered communication
- Review System: Rating and feedback for completed projects
- Responsive Design: Mobile-first approach with Material-UI
- Time Tracking: Integrated productivity monitoring
- Organization Support: Team accounts with budget controls
- Node.js with Express.js
- TypeScript
- MongoDB with Mongoose
- Redis for caching
- Socket.io for real-time features
- JWT authentication
- Stripe for payments
- SendGrid for emails
- Cloudinary for file storage
- React 18 with TypeScript
- Vite for build tooling
- Redux Toolkit for state management
- Material-UI (MUI) v5 for components
- React Router v6
- TanStack Query (React Query) for server state
- Socket.io client for real-time features
- Formik + Yup for forms and validation
- Vitest for testing
- Node.js 18+
- MongoDB
- Redis
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/talenthive-platform.git
cd talenthive-platform- Install dependencies:
# Install root dependencies
npm install
# Install server dependencies
cd server && npm install
# Install client dependencies
cd ../client && npm install
cd ..- Set up environment variables:
# Copy example files
cp server/.env.example server/.env
cp client/.env.example client/.env
# Edit the .env files with your configuration
# Make sure to update:
# - Database connection strings
# - JWT secrets (use strong, unique keys)
# - Stripe API keys
# - SendGrid API key
# - Cloudinary credentials- Start the development servers:
# Start both frontend and backend
npm run dev
# Or start individually
npm run server:dev # Backend only
npm run client:dev # Frontend only- Start with Docker Compose:
docker-compose up -dThis will start:
- MongoDB on port 27017
- Redis on port 6379
- Backend API on port 5000
- Frontend app on port 3000
npm run dev- Start both frontend and backend in development modenpm run build- Build both applications for productionnpm run test- Run tests for both applicationsnpm run lint- Lint both applicationsnpm run format- Format code with Prettiernpm run seed- Seed database with sample datanpm run validate-data- Validate database data integritynpm run server:dev- Start backend onlynpm run client:dev- Start frontend onlynpm run server:build- Build backend onlynpm run client:build- Build frontend onlynpm run server:test- Run backend tests onlynpm run client:test- Run frontend tests onlynpm run server:lint- Lint backend onlynpm run client:lint- Lint frontend only
npm run dev- Start development server with hot reloadnpm run build- Build TypeScript to JavaScriptnpm run start- Start production servernpm run test- Run Jest testsnpm run test:watch- Run Jest tests in watch modenpm run test:coverage- Run tests with coverage reportnpm run lint- Run ESLintnpm run lint:fix- Run ESLint with auto-fixnpm run seed- Seed database with sample datanpm run validate-data- Validate database data integrity
npm run dev- Start Vite development servernpm run build- Build for productionnpm run build:check- Build with TypeScript type checkingnpm run preview- Preview production buildnpm run test- Run Vitest testsnpm run test:ui- Run Vitest with UI interfacenpm run test:coverage- Run tests with coverage reportnpm run lint- Run ESLintnpm run lint:fix- Run ESLint with auto-fix
talenthive-platform/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── ui/ # Generic UI components
│ │ │ ├── auth/ # Authentication components
│ │ │ ├── layout/ # Layout components
│ │ │ └── ... # Feature-specific components
│ │ ├── pages/ # Page components
│ │ ├── store/ # Redux store and slices
│ │ ├── services/ # API services
│ │ ├── hooks/ # Custom React hooks
│ │ ├── utils/ # Utility functions
│ │ ├── types/ # TypeScript type definitions
│ │ ├── theme/ # Material-UI theme
│ │ └── test/ # Vitest test files
│ └── package.json
├── server/ # Node.js backend
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── models/ # Mongoose models
│ │ ├── routes/ # Express routes
│ │ ├── middleware/ # Custom middleware
│ │ ├── utils/ # Utility functions
│ │ ├── config/ # Configuration files
│ │ ├── types/ # TypeScript type definitions
│ │ ├── scripts/ # Database seeding and utilities
│ │ └── test/ # Jest test files
│ └── package.json
├── scripts/ # Database and deployment scripts
├── docker-compose.yml # Docker configuration
└── package.json # Root package.json
- Linting: ESLint with TypeScript rules
- Formatting: Prettier with 2-space indentation, single quotes
- Git Hooks: Husky with lint-staged for pre-commit checks
- Type Safety: Strict TypeScript configuration
- Backend: Jest with Supertest for API testing
- Frontend: Vitest with Testing Library for component testing
- Coverage: Aim for >80% test coverage
- E2E: Manual testing workflow documented in
/test automation
Both frontend and backend use path aliases for cleaner imports:
// Instead of: import { User } from '../../../types/user'
import { User } from '@/types/user'The API follows RESTful conventions and is available at /api/v1/. Key endpoints include:
/auth- Authentication (login, register, logout, refresh)/users- User management and profiles/projects- Project CRUD operations/proposals- Proposal management/contracts- Contract and milestone management/payments- Payment processing with Stripe/messages- Real-time messaging/reviews- Rating and review system/notifications- User notifications/admin- Administrative functions/upload- File upload to Cloudinary
Complete API documentation is available in /docs/API-DOCUMENTATION.md.