Skip to content
husnainhashmi5Public

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prism Copilot

Prism Copilot is a Django REST Framework backend for AI-assisted visual diagnostics, ML dataset management, and maintenance workflows. It combines authenticated APIs, asynchronous processing, cloud adapter boundaries, and a small ML operations surface for uploading datasets, registering models, and running inference jobs.

This repository demonstrates backend engineering work around API design, Django architecture, background processing, cloud integration boundaries, and testable service structure. It is not a generic Django starter template.

Key Features

  • Token-based authentication with a custom email-first user model.
  • Django REST Framework APIs for health checks, user workflows, ML datasets, model records, inference jobs, and chatbot interactions.
  • Celery and Redis integration for asynchronous and scheduled work.
  • PostgreSQL-backed persistence with Django migrations.
  • Cloud adapter layer for local and Azure-backed storage, search, ML endpoints, and OpenAI-compatible model calls.
  • drf-spectacular OpenAPI schema and Swagger UI in development.
  • Structured logging, request tracing, security headers, throttling, and production-oriented settings.
  • Pytest coverage for authentication, user profile behavior, and core API endpoints.
  • GitHub Actions workflow that runs the Django test suite against PostgreSQL and Redis.

Tech Stack

  • Python 3.13
  • Django 5
  • Django REST Framework
  • PostgreSQL
  • Redis
  • Celery and django-celery-beat
  • Knox authentication
  • drf-spectacular
  • Poetry
  • Docker dev container
  • Azure SDKs and OpenAI-compatible integrations
  • Pytest and pytest-django

Architecture Overview

The project is organized as a modular Django backend:

  • conf/ contains Django settings, URL routing, ASGI/WSGI entry points, Celery setup, and test settings.
  • apps/users/ owns authentication, token login/logout, profile APIs, user serializers, and throttling.
  • apps/core/ contains shared endpoints, middleware, logging helpers, and reusable task classes.
  • apps/ml_ops/ owns dataset, model, inference, and chatbot API resources.
  • apps/cloud_adapters/ provides the boundary between application code and cloud-specific providers.
  • test_images/ contains small demo fixtures for visual-analysis workflows.

More detail is available in docs/architecture.md.

Screenshots And Demo

The project is primarily an API backend. A browser demo is available through:

  • Swagger UI: http://localhost:8000/api/schema/swagger-ui/
  • Django admin: http://localhost:8000/admin-panel/
  • Landing page: http://localhost:8000/

Generated media and uploaded dataset artifacts are intentionally excluded from version control. Use test_images/ only as local demo fixtures.

Local Setup

Prerequisites

  • Python 3.13
  • Poetry 1.8+
  • PostgreSQL
  • Redis

Install Dependencies

poetry install

Configure Environment

cp .env.example .env

Update at least:

  • DJANGO_SECRET_KEY
  • DATABASE_URL
  • REDIS_URL
  • CELERY_BROKER_URL
  • CELERY_RESULT_BACKEND

Cloud variables such as Azure Search, Azure ML, and Azure OpenAI can remain empty when using local-only development paths.

Run Database Migrations

poetry run python manage.py migrate

Start The API

poetry run python manage.py runserver

The API will be available at http://localhost:8000.

Docker Usage

This repository includes a VS Code dev container under .devcontainer/.

docker compose -f .devcontainer/docker-compose.yml up --build

The dev container starts PostgreSQL, Redis, and an application container that can run Django commands inside the workspace.

Testing

poetry run pytest

With coverage:

poetry run pytest --cov

The GitHub Actions workflow in .github/workflows/test.yml runs the test suite with PostgreSQL and Redis services.

API Documentation

Development schema endpoints:

  • OpenAPI schema: /api/schema/
  • Swagger UI: /api/schema/swagger-ui/

Main API groups:

  • auth/ - user creation, login, logout, token revocation, profile
  • core/ - health checks and task examples
  • api/ml/ - datasets, ML models, inference, chatbot resources

See docs/api.md for endpoint groups and authentication notes.

Deployment Notes

Production deployment should provide PostgreSQL, Redis, object storage, and secure environment variables. Run migrations before release and keep generated media outside the repository.

See docs/deployment.md.

What This Project Demonstrates

  • Designing a modular Django/DRF backend with clear app boundaries.
  • Using Celery and Redis for asynchronous processing.
  • Building API documentation through OpenAPI tooling.
  • Separating cloud integrations behind adapter modules.
  • Writing backend tests for authentication and API behavior.
  • Preparing a backend service for CI and containerized development.

Future Improvements

  • Add a production Dockerfile alongside the existing dev container.
  • Expand tests around apps/ml_ops viewsets and cloud adapter fallbacks.
  • Add object-storage lifecycle policies for inference artifacts.
  • Add example API requests for the ML dataset and inference workflows.
  • Replace the temporary landing page with a project-specific API landing page.

Security

Do not commit real .env files, uploaded media, cloud credentials, dataset dumps, or generated inference output. Use .env.example for configuration documentation and rotate any exposed secret immediately.

See SECURITY.md.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages