Developer Setup and Git Workflow - gcivil-nyu-org/team3-mon-fall26 GitHub Wiki
This page contains instructions for setting up the local development environment, resolving port conflicts, and our team's standard operating procedures (SOPs) for branching, code review, and automatic AWS deployment.
-
Python 3.12 (
python --versionorpython3.12 --version) -
Git (
git --version) - A personal fork of
gcivil-nyu-org/team3-mon-fall26under your GitHub account (remember to uncheck "Copy themainbranch only" when creating your fork).
We follow the standard Fork-and-Pull convention:
-
originpoints to your personal fork (where you push your feature branches). -
upstreampoints to the main team repository (gcivil-nyu-org/team3-mon-fall26, where everyone pullsdevelopfrom and opens PRs into).
git clone https://github.com/<YOUR-GITHUB-USERNAME>/team3-mon-fall26.git
cd team3-mon-fall26
git remote add upstream https://github.com/gcivil-nyu-org/team3-mon-fall26.git
git fetch upstream
git checkout developIf your local origin currently points to gcivil-nyu-org/team3-mon-fall26, run these two commands inside your project folder:
git remote rename origin upstream
git remote add origin https://github.com/<YOUR-GITHUB-USERNAME>/team3-mon-fall26.gitVerify your remotes with git remote -v:
origin https://github.com/<YOUR-GITHUB-USERNAME>/team3-mon-fall26.git (fetch)
origin https://github.com/<YOUR-GITHUB-USERNAME>/team3-mon-fall26.git (push)
upstream https://github.com/gcivil-nyu-org/team3-mon-fall26.git (fetch)
upstream https://github.com/gcivil-nyu-org/team3-mon-fall26.git (push)
Always use an isolated virtual environment (.venv) so packages do not conflict with your system Python.
macOS / Linux:
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtWindows (PowerShell):
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt(Note for Windows: If PowerShell blocks script execution, run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once.)
Local development uses config/settings.py by default, which stores data in a local SQLite file (db.sqlite3).
-
Apply database migrations:
python manage.py migrate
-
(Optional) Create a local admin superuser:
python manage.py createsuperuser
-
Start the local development server:
python manage.py runserver
- Open
http://127.0.0.1:8000/in your browser.-
/— Landing page -
/login/&/register/— Authentication flows -
/health/— Liveness probe ({"status": "ok"}) -
/ready/— Database readiness probe ({"status": "ok"})
-
If port 8000 is occupied by a previous terminal session or another service:
-
Quickest fix (run on an alternate port):
python manage.py runserver 8001
-
Stop the process occupying port
8000:-
macOS / Linux:
lsof -ti:8000 | xargs kill -9
-
Windows (PowerShell):
Get-NetTCPConnection -LocalPort 8000 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
-
macOS / Linux:
Before pushing any branch, run the same checks that GitHub Actions runs in CI:
# 1. Verify package dependencies and Django system checks
python -m pip check
python manage.py check
# 2. Ensure no model changes are missing migrations
python manage.py makemigrations --check --dry-run
# 3. Run Django application tests
python manage.py test
# 4. Run infrastructure & deployment safeguard unit tests
python -m unittest discover -s infra -p "test_*.py"-
No local AWS keys are needed for normal development: Automatic deployments from
developto AWS Elastic Beanstalk authenticate using keyless GitHub OIDC (nyc-active-github-deployIAM role). -
Never commit secrets or local state:
.env*,db.sqlite3,.venv/,.pem, and.keyfiles are strictly excluded via.gitignoreand blocked by our CI bundler check (infra/deploy_ci.py). -
Production vs. Local Settings:
-
Local: Uses
config.settingswithdb.sqlite3. -
AWS Production (
https://dgaeptdmd25z5.cloudfront.net/): Usesconfig.productionwith PostgreSQL 16 (127.0.0.1:5432over TLS) and hourly encrypted S3 backups. Seedocs/deployment.mdanddocs/cost-controls.mdfor full details.
-
Local: Uses
| Branch | Purpose | Deployment Behavior |
|---|---|---|
main |
Stable milestone / release branch | Updated from develop at sprint milestones |
develop |
Primary integration branch | Every push / merged PR runs tests and auto-deploys to AWS |
| Feature branches | Individual task work (on your personal fork) | Runs CI test suite on PRs; does not deploy until merged into develop
|
Always branch off the latest upstream/develop and use a descriptive name:
-
feature/<short-description>(e.g.,feature/event-creation-form) -
fix/<short-description>(e.g.,fix/login-redirect) -
docs/<short-description>(e.g.,docs/epic3-sequence-diagrams) -
<name>-<feature>(e.g.,derah-login,ivan-parks-ingestion)
git checkout develop
git pull upstream develop(Optional: run git push origin develop to keep your fork's develop branch on GitHub synced as well.)
git checkout -b feature/your-task-nameKeep commits focused and write clear, imperative commit messages:
python manage.py test
git status
git add <files>
git commit -m "Add event creation view and form validation"(Double-check git status before committing to ensure you never stage db.sqlite3, .env, or temporary scratch files.)
git push -u origin feature/your-task-name- Go to
https://github.com/gcivil-nyu-org/team3-mon-fall26/pullsand click New pull request (or click the Compare & pull request banner on your fork). - Verify the branch selectors at the top:
-
base repository:
gcivil-nyu-org/team3-mon-fall26| base:develop(⚠️ Make sure this isdevelop, NOTmain!) -
head repository:
<YOUR-GITHUB-USERNAME>/team3-mon-fall26| compare:feature/your-task-name
-
base repository:
- Link the relevant ZenHub / GitHub Issue in your PR description and summarize what changed and how to test it.
-
Automated CI Gate (
Test and deploy develop):- Every PR targeting
developtriggers.github/workflows/deploy-develop.yml. - All checks (
pip check,manage.py check,makemigrations --check,manage.py test,infraunit tests, and hook syntax checks) must be green before merging.
- Every PR targeting
-
Database Migration Safety:
- Because AWS auto-rollback restores the previous code version without reversing schema migrations, ensure any new database migrations are backwards-compatible.
-
Peer Review:
- At least 1 teammate should review and approve the PR before merging into
develop.
- At least 1 teammate should review and approve the PR before merging into
-
Automatic AWS Deployment After Merge:
- Once merged into
develop, thedeployjob in GitHub Actions automatically packages the commit, checks the team's $15 monthly AWS budget guard, deploys to Elastic Beanstalk, runsmigrate+collectstatic(with automatic pre/post-migration S3 PostgreSQL backups), and verifies that/,/health/, and/ready/returnHTTP 200over HTTPS athttps://dgaeptdmd25z5.cloudfront.net/.
- Once merged into
-
Post-Merge Cleanup:
After your PR is merged, clean up your local feature branch:
git checkout develop git pull upstream develop git branch -d feature/your-task-name