This guide will help you avoid all the common development headaches and get your Persian poetry app running smoothly.
# Just run this one command and everything will be set up automatically!
./start-dev.sh# Clean setup with automatic dependency management
npm run dev:setup# Start development server (with automatic checks)
npm run dev
# Clean development setup (removes cache, reinstalls deps)
npm run dev:clean
# Complete reset (removes everything and starts fresh)
npm run dev:reset
# Automated development setup with error handling
npm run dev:setup# Build the project
npm run build
# Check if build is successful
npm run build:check
# Verify production readiness
npm run build:verify
# Start production server
npm start# Run TypeScript type checking
npm run type-check
# Run ESLint
npm run lint
# Fix ESLint errors automatically
npm run lint:fixSolution:
# Clean and reinstall dependencies
npm run dev:cleanSolution:
# Check TypeScript errors
npm run type-check
# If errors persist, try a complete reset
npm run dev:resetSolution:
# Check what's causing the build to fail
npm run build:check
# If issues persist, try a clean build
npm run dev:clean && npm run buildSolution:
# Kill processes using port 3000
lsof -ti:3000 | xargs kill -9
# Or use a different port
PORT=3001 npm run devSolution:
# Clear all caches
npm run dev:clean
# Or complete reset
npm run dev:reset-
Start your day:
./start-dev.sh
-
Make your changes in the code
-
Check for issues:
npm run type-check npm run lint
-
Build before committing:
npm run build:check
- First try:
npm run dev:clean - If that fails:
npm run dev:reset - If still failing: Check the error messages and fix the specific issues
# 1. Run all checks
npm run build:verify
# 2. Build the project
npm run build
# 3. Test production build locally
npm start# Build for production
npm run build
# Start production server
npm start├── scripts/
│ ├── dev-setup.js # Automated development setup
│ └── build-check.js # Build verification
├── start-dev.sh # One-click development launcher
├── src/
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ └── data/ # Static data
└── package.json # Enhanced with new scripts
- Checks Node.js version compatibility
- Cleans project cache and build files
- Installs dependencies with error handling
- Runs TypeScript type checking
- Runs ESLint
- Starts development server
- JavaScript version of the launcher
- Cross-platform compatibility
- Detailed error reporting
- Automatic dependency management
- Verifies build process
- Checks TypeScript compilation
- Runs ESLint
- Reports production readiness
- Always use the automated scripts - they handle 90% of common issues
- Run
npm run build:verifybefore committing - catches issues early - Use
npm run dev:resetif you're stuck - nuclear option that fixes most problems - Check the console output - the scripts provide detailed error information
- Keep your Node.js updated - the scripts check for compatibility
If everything is broken:
# Nuclear option - complete reset
rm -rf node_modules package-lock.json .next
npm install
npm run devThe scripts provide detailed error messages and suggestions. If you're still stuck:
- Check the console output for specific error messages
- Try the troubleshooting steps above
- Use
npm run dev:resetas a last resort - Check that you're using Node.js 18 or higher
Happy coding! 🎉 Your Persian poetry app should now be headache-free to develop!