Run this command from the project root:
npm run setupThis creates:
server/.env.localclient/.env.local
Open the file and replace the placeholder values:
# Minimum required for local development:
NODE_ENV=development
PORT=8080
MONGO_URI=mongodb://localhost:27017/taskstars
JWT_SECRET=any-random-string-for-development
CLIENT_URL=http://localhost:3000
SERVER_URL=http://localhost:8080
# Optional (for OAuth features):
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# Optional (for AI features):
OPENAI_API_KEY=your-openai-keyDon't have MongoDB installed?
- Install locally:
brew install mongodb-community(Mac) - Or use MongoDB Atlas (free cloud)
NEXT_PUBLIC_API_URL=http://localhost:8080
NEXT_PUBLIC_SOCKET_URL=http://localhost:8080npm run devVisit: http://localhost:3000 🎉
Your app is now running with proper environment configuration.
- ✅ All hardcoded URLs removed
- ✅ Environment-based configuration enabled
- ✅ Easy switching between dev and production
- ✅ Secrets kept safe in
.envfiles - ✅ 13 client files updated
- ✅ 4 server files updated
Solution: Install and start MongoDB:
brew services start mongodb-communitySolution: OAuth features are optional. The app works without them! To enable:
- Create Google/GitHub OAuth apps
- Add credentials to
.env.local - See
ENVIRONMENT_SETUP.mdfor detailed steps
Solution: Change the port in server/.env.local:
PORT=3001 # or any available port- Google OAuth Setup
- GitHub OAuth Setup
- See
ENVIRONMENT_SETUP.mdfor step-by-step guide
- Create
server/.env.productionandclient/.env.production - Use your production URLs
- See
SETUP_SUMMARY.mdfor production setup
- See
HOW_IT_WORKS.mdfor architecture diagram - See
QUICK_REFERENCE.mdfor command cheat sheet
| Command | What it does |
|---|---|
npm run dev |
Start development mode |
npm run build |
Build for production |
npm start |
Run production mode |
npm run setup |
Create env files from templates |
- START_HERE.md ← You are here! Quick setup
- QUICK_REFERENCE.md - Command cheat sheet
- SETUP_SUMMARY.md - What was changed
- ENVIRONMENT_SETUP.md - Complete documentation
- HOW_IT_WORKS.md - Architecture and flow
If something's not working:
- Check that
.env.localfiles exist in bothserver/andclient/ - Verify MongoDB is running (if using local)
- Restart the app: Stop with Ctrl+C, then
npm run devagain - Check the console for error messages
TaskStars/
├── server/
│ ├── .env.local ← YOU CREATE THIS
│ └── .env.production ← CREATE LATER FOR PRODUCTION
└── client/
├── .env.local ← YOU CREATE THIS
└── .env.production ← CREATE LATER FOR PRODUCTION
These files are in .gitignore - they won't be committed to git (that's good! keeps secrets safe)
After setup, verify everything works:
# Terminal 1: Check server started
# Should see: "Server running on port 8080"
# Should see: "MongoDB Connected"
# Terminal 2: Open browser
# Visit: http://localhost:3000
# Should see: TaskStars app loadingIf you see the app at http://localhost:3000, you're all set!
Now you can:
- ✅ Develop locally
- ✅ Switch to production easily
- ✅ Keep credentials safe
- ✅ Share code without exposing secrets
Happy coding! 🚀
Don't forget to:
- Create your
.env.localfiles (Step 2) - Start MongoDB (if using local)
- Add real credentials for features you want
- Never commit
.envfiles to git - Use different secrets for dev vs production
Questions? Check the other docs in this folder! 📖