# 1. Clone the repo
git clone https://github.com/aparsoft/django-nextjs-chatbot.git
cd django-nextjs-chatbot
# 2. Setup environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# 3. Start everything with watch mode (auto-reload on code changes)
./start.shThat's it! 🎉
💡 Pro Tip: The
./start.shscript starts Docker with watch mode enabled - your code changes automatically sync without rebuilding! Perfect for development.
When you run ./start.sh, the system automatically:
- Checks for Backups - Offers to restore from previous backup (if available)
- Builds Images - Installs all dependencies
- Waits for PostgreSQL - Ensures database is ready
- Runs Migrations - Creates all database tables
- Creates Superuser - Admin account ready to use (
admin/admin123) - Collects Static Files - Prepares assets
- Starts with Watch Mode - Auto-reloads on code changes:
- Backend: Python files sync + Django auto-reload
- Frontend: Source files sync + Next.js hot-reload
- Celery: Changes sync + worker restart
| Service | URL | Credentials |
|---|---|---|
| Frontend | http://localhost:3000 | - |
| Backend API | http://localhost:8000 | - |
| Django Admin | http://localhost:8000/chatbot-admin/ | admin / admin123 |
| PostgreSQL | localhost:5433 | chatbot_user / chatbot_pass |
| Redis | localhost:6380 | - |
- Username:
admin - Password:
admin123 - Email:
admin@aparsoft.com
To change the password:
docker-compose exec backend python manage.py changepassword admin- Clone repository
- Copy
.env.exampleto.env - Add your
OPENAI_API_KEYto.env - Make scripts executable:
chmod +x *.sh(already done in repo) - Run
./start.sh - Wait for all services to start (watch the logs)
- Open http://localhost:3000
- Login to admin at http://localhost:8000/chatbot-admin/
- Start building your chatbot! 🤖
# Start with watch mode (recommended for development)
./start.sh
# Stop services (Ctrl+C when running, or:)
docker compose down
# Clean up everything (interactive - backs up database first!)
./cleanup.sh# Create manual backup anytime
./backup.sh
# Restore from backup (prompted during ./start.sh)
./start.sh
# Choose 'y' when asked about restore, select backup from list🔒 Safety Feature: The
cleanup.shscript automatically backs up your database before removing volumes - no data loss!
# All services
docker compose logs -f
# Specific service
docker compose logs -f backend
docker compose logs -f frontend
docker compose logs -f celerydocker compose exec backend python manage.py shelldocker compose exec backend python manage.py createsuperuserdocker compose exec backend python manage.py migratedocker compose restart backend
docker compose restart frontendIf you see port conflicts, edit docker-compose.yml:
- PostgreSQL: Change
5433:5432 - Redis: Change
6380:6379 - Backend: Change
8000:8000 - Frontend: Change
3000:3000
The entrypoint script waits for PostgreSQL. If issues persist:
docker compose restart backendCheck if all environment variables are set:
docker compose exec frontend env | grep NEXT_PUBLICDocker Compose Watch should auto-sync changes. If not working:
- Stop with Ctrl+C
- Restart:
./start.sh - For dependency changes (package.json, requirements.txt), rebuild is required
# Stop current containers
Ctrl+C
# Start (automatically rebuilds images)
./start.sh# Interactive cleanup (backs up database first!)
./cleanup.sh
# Then start fresh
./start.sh- YouTube Tutorials: @aparsoft-ai
- GitHub Issues: Report a bug
- Discord: Ask in our community (link in YouTube description)
Happy coding! 🚀
Built with ❤️ by Aparsoft Team