A comprehensive full-stack web application template designed for rapid development of modern web applications with a Django backend and React frontend.
BaseBuild is a template that provides a complete development environment with:
- Backend: Django 5.1 with Django REST Framework
- Frontend: React 18 with Vite
- Database: PostgreSQL 15
- Asynchronous Processing: Celery with Redis
- Documentation: Dedicated documentation site
- Testing: Comprehensive testing setup for both frontend and backend
- Containerization: Docker and Docker Compose for easy development and deployment
This template is designed to help you quickly start new projects with a solid foundation, following best practices for modern web development.
- Authentication System: JWT-based authentication with Django REST Framework Simple JWT
- API Documentation: Automatic API documentation with DRF Spectacular
- Payment Integration: Stripe payment processing integration
- Task Queue: Background task processing with Celery and Redis
- Monitoring: Celery task monitoring with Flower
- Testing: Pytest for backend and Cypress/Vitest for frontend
- Code Quality: Pre-commit hooks, Black, Flake8, and ESLint
DEBUG: Enable/disable debug modeSECRET_KEY: Django secret keyDJANGO_ALLOWED_HOSTS: Allowed hosts for DjangoSQL_ENGINE: Database engineSQL_DATABASE: Database nameSQL_USER: Database userSQL_PASSWORD: Database passwordSQL_HOST: Database hostSQL_PORT: Database portDATABASE: Database type
POSTGRES_USER: PostgreSQL userPOSTGRES_PASSWORD: PostgreSQL passwordPOSTGRES_DB: PostgreSQL database name
CHOKIDAR_USEPOLLING: Enable polling for file changesREACT_APP_API_BASE_URL: Backend API base URLREACT_APP_NAME: Application nameREACT_APP_URL: Frontend application URL
/backend: Django backend application/client: React frontend application/docs: Project documentation/celeryworker: Independent Celery workerdocker-compose.yml: Docker Compose configurationbb.sh: Utility script for project managementdev_setup.sh: Development environment setup script
BaseBuild comes with powerful utility scripts to streamline development workflows:
The dev_setup.sh script automates the setup of your development environment. When executed, it performs the following tasks:
- Installs system dependencies using Homebrew (jpeg, zlib, freetype, etc.)
- Installs or updates pip and npm if needed
- Creates and configures a Python virtual environment (
bb-dev) - Installs Python dependencies from
backend/requirements.txt - Installs Node.js dependencies for the frontend
- Sets up pre-commit hooks for code quality
- Creates necessary environment files
- Installs the
bbcommand-line utility globally
To use it, simply run:
./dev_setup.shThe bb.sh script (installed as bb command) is a comprehensive project management tool that provides numerous commands to streamline development workflows:
bb test: Run the full test suite (Django, Cypress E2E, Cypress Component, Vitest)bb test -b: Run only Django backend testsbb test -c: Run only client testsbb test --e2e: Run only Cypress end-to-end testsbb test --component: Run only Cypress component testsbb test -v: Run only Vitest tests
bb clean: Rebuild Docker containers and reset the databasebb flush-db: Flush the databasebb db: Enter PostgreSQL shellbb dumpdata [filename]: Dump database data to YAML filebb loaddata <filepath>: Load data from fixture filebb makemigrations: Create database migrationsbb migrate: Apply database migrations
bb shell: Enter Django shellbb app <name>: Create a new Django appbb manage <command>: Run Django management commandsbb coverage: Generate test coverage reportsbb quality: Run code quality checks (flake8, black, isort)
For detailed help on any command, use:
bb <command> --helpThese utility scripts significantly reduce development friction and enforce consistent practices across the project.
-
Make sure you're in your new project directory: Navigate to the directory of your new project that was created based on the template.
-
Fetch the latest changes from the original template repository (upstream): Your new project should already have the original template repo set as an upstream remote (from the script we ran earlier). To fetch the changes from the original template repo, use the following command:
git fetch upstream
-
Review changes (optional): If you want to see what changes have been made in the original repository, you can check the difference (diff) between your
mainbranch and theupstream/mainbranch:git diff main..upstream/main
-
Merge the changes from the upstream repository: Now, you can merge the changes from the original template repository into your new project’s
mainbranch:git merge upstream/main
If there are no conflicts, this will successfully merge the changes from the original template into your new project.
-
Resolve conflicts (if any): If there are any conflicts between your changes and the changes in the original template, Git will flag those as conflicts, and you'll need to manually resolve them.
After resolving the conflicts, mark the conflicts as resolved:
git add <resolved-file>
Then, commit the resolved changes:
git commit
-
Push the changes to your repository: After merging the changes from the upstream repository, push the merged changes to your new repository (on GitHub):
git push origin main
# Fetch changes from the upstream (original template repo)
git fetch upstream
# Optionally, check the differences between your branch and upstream/main
git diff main..upstream/main
# Merge changes from upstream/main into your current branch
git merge upstream/main
# Resolve any conflicts if they arise and commit them
# Push the merged changes to your remote repository
git push origin main