Skip to content

clarkmyfancy/thrivemind-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

175 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thrivemind API

Django + Django REST Framework backend for Thrivemind.

Stack

  • Python 3.11+
  • Django 4.0.6
  • Django REST Framework
  • JWT auth (djangorestframework-simplejwt)
  • PostgreSQL in deployed environments

Local Setup

  1. Create and activate a virtual environment.
  2. Install dependencies:
python3 -m pip install -r requirements.txt
  1. Create a .env file (or export env vars) with at least:
DJANGO_SECRET_KEY=your-secret
OPENAI_API_SECRET_KEY=your-openai-key
APNS_KEY_ID=your-apns-key-id
APNS_TEAM_ID=your-apns-team-id
APNS_BUNDLE_ID=your-apns-bundle-id
APNS_P8_SECRET=your-apns-p8-content
DATABASE_URL=postgres://...   # or sqlite:////tmp/thrivemind_local.sqlite3
  1. Run migrations:
python3 manage.py migrate
  1. Start the API:
python3 manage.py runserver

Running Tests Locally

Use sqlite for local test isolation:

DATABASE_URL=sqlite:////tmp/thrivemind_pytest.sqlite3 \
python3 -m pytest -q

Run a single pytest module:

DATABASE_URL=sqlite:////tmp/thrivemind_pytest.sqlite3 \
python3 -m pytest tests/api/test_auth_and_ownership.py -q

Run existing Django tests directly:

DATABASE_URL=sqlite:////tmp/thrivemind_test.sqlite3 \
python3 manage.py test -v 2

Run contract-focused compatibility checks (frontend-critical endpoints/DTO keys):

DATABASE_URL=sqlite:////tmp/thrivemind_pytest.sqlite3 \
python3 -m pytest tests/api/test_frontend_contract_compat.py -q

CI and Deployment Workflow

  • Open a PR into main; Heroku CI runs contract tests + full pytest suite.
  • Merge only after required checks pass.
  • main auto-deploys to staging (with "wait for CI" enabled in Heroku pipeline).
  • Promote staging to production after smoke checks pass.
  • Release phase runs python manage.py migrate --noinput (committed migrations only).

Project Notes

  • Global DRF default permission is IsAuthenticated.
  • Auth routes are under /auth/.
  • Core API viewsets are registered in thrivemindbackend/urls.py.
  • Additional testing notes are in TESTING.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages