cd backend
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"Copy the output - you'll need it in the next step.
cp .env.example .envEdit .env and update these REQUIRED fields:
# Paste your generated JWT secret here
JWT_SECRET=<paste_the_long_string_from_step_1>
# Your MongoDB connection string
MONGO_URI=mongodb://localhost:27017/freelancerflow
# Your frontend URL (update when deploying)
FRONTEND_URL=http://localhost:5173npm installnpm testYou should see tests passing! ✅
npm run devServer will start on http://localhost:5000
Open browser or use curl:
curl http://localhost:5000/healthExpected response:
{
"success": true,
"status": "healthy",
"environment": "development",
"timestamp": "2025-12-22T...",
"uptime": 5.123
}Open in browser:
http://localhost:5000/api-docs
You should see interactive Swagger documentation! 📚
curl -X POST http://localhost:5000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"fullName": "Test User",
"email": "test@example.com",
"password": "password123"
}'Expected response:
{
"success": true,
"data": {
"user": { ... },
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}- Start building features
- Write tests as you go
- Check logs in
logs/directory - Use
npm run test:watchfor TDD
- Read
PRODUCTION_UPGRADE_SUMMARY.md - Review
DEPLOYMENT.md - Run
npm run lintto check code quality - Ensure test coverage is good
- Set up monitoring (Sentry, etc.)
- Make sure you created
.envfile - Check that
MONGO_URIandJWT_SECRETare set
- Make sure MongoDB is running
- Check your
MONGO_URIis correct - Try:
mongodorbrew services start mongodb-community
- Make sure all dependencies installed:
npm install - Check Node version:
node --version(should be 18+ or 20+)
- Change
PORTin.envfile - Or kill process:
lsof -ti:5000 | xargs kill
# Development
npm run dev # Start with auto-reload
npm run test:watch # Run tests in watch mode
# Testing
npm test # Run all tests with coverage
npm run test:ci # CI-optimized testing
# Code Quality
npm run lint # Check code quality
npm run lint:fix # Auto-fix issues
# Production
npm start # Start production serverYour FreelancerFlow backend is now:
- ✅ Secure
- ✅ Tested
- ✅ Documented
- ✅ Production-ready
Happy coding! 🚀
Need Help?
- Check
README.mdfor detailed docs - Review
PRODUCTION_UPGRADE_SUMMARY.mdfor what changed - See
DEPLOYMENT.mdfor deployment guides