A comprehensive manpower supply company website built with MERN stack (MongoDB, Express.js, React.js, Node.js).
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local or MongoDB Atlas)
# Make the script executable and run
chmod +x scripts/quick-start.sh
./scripts/quick-start.sh# Install all dependencies (backend + frontend)
npm run install-all
# Or install separately:
cd backend && npm install
cd frontend && npm installOption A: Local MongoDB
# Install MongoDB (macOS with Homebrew)
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb/brew/mongodb-communityOption B: MongoDB Atlas (Cloud)
- Go to MongoDB Atlas
- Create a free account and cluster
- Get your connection string
- Update
backend/.envwith your MongoDB URI
cd backend
cp env.example .env
# Edit .env file with your configurationsFull Stack Application (Recommended):
# Start both frontend and backend together
npm start
# Or use the dev command
npm run devIndividual Servers:
# Backend Server only
npm run backend
# Frontend Server only
npm run frontend
# Or from individual directories
cd backend && npm run dev
cd frontend && npm startControl Scripts:
# Stop all servers
npm run stop
# Restart all servers
npm run restart
# View logs
npm run logs:backend # Backend logs
npm run logs:frontend # Frontend logscompany/
βββ backend/ # Node.js/Express API server
β βββ config/ # Configuration files
β βββ controllers/ # Route controllers
β βββ middleware/ # Express middleware
β βββ models/ # MongoDB/Mongoose models
β βββ routes/ # API routes
β βββ services/ # Business logic services
β βββ utils/ # Utility functions
β βββ uploads/ # File uploads
β βββ scripts/ # Database scripts
β βββ tests/ # Test files
β βββ server.js # Server entry point
βββ frontend/ # React.js frontend application
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ hooks/ # Custom React hooks
β β βββ context/ # React context providers
β β βββ utils/ # Utility functions
β βββ public/ # Static assets
βββ scripts/ # Setup and utility scripts
npm start # Start full-stack application (frontend + backend)
npm run dev # Start full-stack application (frontend + backend)
npm run stop # Stop all servers
npm run restart # Restart all servers
npm run backend # Start backend server only
npm run frontend # Start frontend server only
npm run backend:watch # Start backend with auto-restart
npm run backend:debug # Start backend in debug mode
npm run install-all # Install all dependencies
npm run test # Run backend tests
npm run test:api # Test API endpoints
npm run seed # Seed database with sample data
npm run backup # Backup database
npm run cleanup # Clean up old files
npm run logs:backend # View backend logs
npm run logs:frontend # View frontend logs
npm run setup # Quick setup scriptnpm run dev # Start development server
npm run dev:watch # Start with Node.js watch mode
npm run dev:debug # Start in debug mode
npm start # Start production server
npm test # Run tests
npm run seed # Seed database
npm run backup # Backup database
npm run migrate # Run database migrations
npm run cleanup # Clean up old filesGET /api/v1/company- Get company informationGET /api/v1/jobs- Get job listingsPOST /api/v1/jobs/:id/apply- Submit job applicationGET /api/v1/services- Get servicesGET /api/v1/clients- Get clientsGET /api/v1/gallery/images- Get gallery imagesPOST /api/v1/contact- Submit contact formGET /api/health- Health check
POST /api/admin/v1/auth/login- Admin loginGET /api/admin/v1/dashboard/stats- Dashboard analyticsGET /api/admin/v1/jobs/postings- Manage job postingsGET /api/admin/v1/jobs/applications- Manage job applicationsGET /api/admin/v1/contacts- Manage contact inquiriesPOST /api/admin/v1/gallery/upload- Upload gallery imagesGET /api/admin/v1/company- Manage company informationGET /api/admin/v1/users- Manage admin users
The application uses JWT-based authentication for admin users.
POST /api/admin/v1/auth/login
Content-Type: application/json
{
"email": "admin@manpowercompany.com",
"password": "admin123"
}- Email: admin@manpowercompany.com
- Password: admin123
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001/api
- API Health Check: http://localhost:5001/api/health
# Test API endpoints
npm run test:api
# Test full-stack integration
./test-integration.sh
# Test individual components
curl http://localhost:3000/api/v1/company
curl http://localhost:5001/api/healthcompanies- Company informationservices- Service offeringsclients- Client portfoliocontracts- Contracts and achievementsjobpostings- Job postingsjobapplications- Job applicationsgalleryimages- Gallery imagescontactinquiries- Contact form submissionsadminusers- Admin usersauditlogs- Admin activity logs
Copy backend/env.example to backend/.env and configure:
# Database
MONGODB_URI=mongodb://localhost:27017/manpower_db
# JWT
JWT_SECRET=your-secret-key
# Email
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
# Cloudinary (for file uploads)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secretcd backend
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage- Set
NODE_ENV=productionin environment - Configure production MongoDB URI
- Set secure JWT secrets
- Configure email service
- Set up file upload service (Cloudinary)
- Build the React app:
npm run build - Deploy to hosting service (Vercel, Netlify, etc.)
- Update API endpoints for production
- Dashboard with analytics
- Job posting management
- Application management
- Contact inquiry management
- Gallery image management
- User management
- Audit logging
- Company information
- Service listings
- Client portfolio
- Job listings and applications
- Contact form
- Gallery
- Multi-language support (English/Arabic)
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
This project is licensed under the ISC License.
MongoDB Connection Error:
# Install and start MongoDB
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb/brew/mongodb-communityPort 5001 Already in Use:
# Kill process using port 5001
lsof -ti:5001 | xargs kill -9Permission Denied:
# Make scripts executable
chmod +x scripts/*.shFor support and questions:
- Email: info@manpowercompany.com
- Phone: +966-XX-XXXXXXX