This repository contains X Crewter / TA_AI_SaaS, a Django-based Talent Acquisition platform with server-rendered UI (DTL), REST APIs, real-time updates over WebSockets, background work via Celery, and an optional standalone AI analysis service that runs LangGraph workloads (often on a separate GPU host) and talks to the web app over HTTP.
| Path | Purpose |
|---|---|
TI_AI_SaaS_Project/ |
Main Django project (manage.py, x_crewter/, apps/). This is where you install dependencies and run the app. |
TI_AI_SaaS_Project/services/ |
Standalone AI service (Django + DRF, Redis, LangGraph/Ollama). See TI_AI_SaaS_Project/services/README.md. |
docs/ |
Additional API and user documentation (bulk upload, analysis API, guides). |
specs/, .specify/ |
Specification and planning assets. |
The Git root folder name is TA_AI_SaaS; the runnable application code lives under TI_AI_SaaS_Project/.
- Accounts: Registration, activation, login, password reset, JWT in HTTP-only cookies (with optional header-based JWT for migration), session timeout, RBAC middleware, Google / LinkedIn / Microsoft social auth (env-driven).
- Jobs: Job listings, dashboard for subscribers, screening questions, application links.
- Applications: Public apply flow, resume upload, bulk upload, duplication detection, throttles.
- Analysis: Initiate/cancel/rerun bulk AI analysis, results and progress; integrates with the standalone service and Channels for live updates.
- Subscription: Landing and subscription-oriented routes for non-subscribed users.
flowchart LR
subgraph web["Django web app :8000"]
UI[DTL + shadcn_django UI]
API[REST APIs]
WS[Channels WebSockets]
end
Redis[(Redis)]
subgraph ai["AI service :9000 optional"]
LG[LangGraph / Ollama]
end
UI --> API
API --> Redis
WS --> Redis
API -->|"REST + API key"| ai
ai -->|"HMAC webhooks"| API
ai --> Redis
For local development, run the web app and (if you need real analysis runs) the AI service and Ollama on the same machine; Redis URLs must stay aligned between x_crewter/settings.py and services/config/settings.py.
Versions are pinned in TI_AI_SaaS_Project/requirements.txt.
- Runtime: Python 3.11+ (see project constraints in code; LangChain notes exist for newer Python).
- Web: Django 5.2.x, Django REST Framework, Django Channels (ASGI WebSockets),
django-cors-headers,django-csp. - Auth:
djangorestframework-simplejwt, Djoser,social-auth-app-django, Argon2 password hashing. - Async / tasks: Celery 5.4, Redis 7.x (broker, Channels layer, shared analysis progress helpers).
- AI (in-app client + graphs): LangChain 1.x, LangGraph 1.x; document parsing uses pypdf, python-docx.
- UI: Django templates, Tailwind CSS (Play CDN in templates), shadcn-django; optional local Tailwind tooling via
package.json/tailwind.config.mjs. - Storage: Local filesystem by default; Amazon S3 or Google Cloud Storage via
django-storageswhen configured. - Testing: Python
unittestvia Django’s test runner; Selenium + Chrome for E2E flows;webdriver-manageris listed for driver management.
- Python 3.11+
- Redis (same URL for Celery, Channels, and analysis-related Redis usage)
- Mail: Default settings in
x_crewter/settings.pypoint SMTP to127.0.0.1:1025(typical for MailHog or similar); adjust for your environment. - AI service path: Ollama (or compatible) for the standalone service — defaults in settings use
http://localhost:11434and aphi4-mini-style model name. - E2E tests: Google Chrome (or Chromium) available on the machine running Selenium tests.
From the repository root:
cd TI_AI_SaaS_Project
python -m venv .venv
# Windows PowerShell:
.\.venv\Scripts\Activate.ps1
# Linux/macOS:
# source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Windows (PowerShell): Copy-Item .env.example .env
# Edit .env: SECRET_KEY, ALLOWED_HOSTS, REDIS_URL, STORAGE_BACKEND, OAuth secrets if used, etc.
python manage.py migrate
python manage.py runserver 0.0.0.0:8000runserver is extended by Channels for ASGI, so WebSockets work in development without a separate process.
Celery uses the same REDIS_URL as the rest of the app. On Windows the project sets CELERY_WORKER_POOL = 'solo'. Example:
cd TI_AI_SaaS_Project
celery -A x_crewter worker -l info
celery -A x_crewter beat -l infoUse this when exercising bulk analysis end-to-end or developing the GPU-side worker.
cd TI_AI_SaaS_Project
pip install -r services/requirements.txt
cp services/.env.example services/.env
# Windows: Copy-Item services\.env.example services\.env
# Align API_KEYS / WEBHOOK_SECRET with Django's AI_SERVICE_* settings; see services/README.md
python services/manage.py runserver 0.0.0.0:9000Full detail: TI_AI_SaaS_Project/services/README.md.
Copy TI_AI_SaaS_Project/.env.example to .env. Commonly adjusted values:
SECRET_KEY,DEBUG,ALLOWED_HOSTSREDIS_URL— shared with Celery, Channels, and AI progressCORS_ALLOWED_ORIGINS,CSRF_TRUSTED_ORIGINS— especially if you use a LAN IP or a separate originSTORAGE_BACKEND—local(default),s3, orgcs, plus cloud credentials when not local- Social auth:
GOOGLE_OAUTH2_*,LINKEDIN_OAUTH2_*,MICROSOFT_GRAPH_* - AI integration:
AI_SERVICE_BASE_URL,AI_SERVICE_API_KEY,AI_SERVICE_WEBHOOK_SECRET,AI_SERVICE_WEBHOOK_TOLERANCE_SECONDS, timeouts and circuit breaker thresholds (seex_crewter/settings.py) - LLM defaults:
OLLAMA_BASE_URL,OLLAMA_MODEL
Optional attributes such as FRONTEND_URL / BACKEND_URL are referenced in account flows for absolute links; add them in settings if you need non-default URLs in emails or redirects.
- Health:
GET /api/health/ - Accounts API: under
/api/accounts/ - Applications API: under
/api/applications/ - Analysis API: under
/api/analysis/; analysis UI under/analysis/ - Dashboard:
/dashboard/(jobs) - Public apply routes:
/apply/,/application/(see URL conf inx_crewter/urls.py)
Run the full suite from TI_AI_SaaS_Project:
python manage.py test- Selenium E2E tests under
apps/*/tests/e2e/require Chrome and may be slower; run a subset when iterating, e.g.python manage.py test apps.accounts.tests.e2e. - Coverage: A helper script exists at
apps/accounts/tests/test_coverage.py; it expects thecoveragepackage (pip install coverage). Project rules target high line coverage for new work.
Service-only tests:
python services/manage.py test services.testsdocs/api/analysis_api.mddocs/api/bulk_upload.mddocs/applications-api.mddocs/user/ai_analysis_guide.md- AI service:
TI_AI_SaaS_Project/services/README.md
MIT License — Copyright (c) 2025 MadsGit-98
git clone https://github.com/MadsGit-98/TA_AI_SaaS.git
cd TA_AI_SaaSAll application commands assume the working directory is TA_AI_SaaS/TI_AI_SaaS_Project unless noted.