A fullβscale, productionβgrade backend architecture made public - because my real projects are private. ππ₯
As developers, we constantly:
- Jump between tasks β‘οΈ lose flow
- Forget why we contextβswitched
- Scatter links (PRs, Issues, Docs, Research) everywhere
- Have no metrics on real focus time
- Work inside private repos where our best architecture never sees daylight
- Have no unified view of productivity, behavior, or workflow patterns
π DevFocus was created to break this invisible wall.
To show the level of engineering I apply daily in my private projects β but in a fully open, clean, wellβarchitected system anyone can inspect.
DevFocus is a Context Intelligence Engine that blends:
- β±οΈ Session tracking
- π Context switching
- π§± Task management (Bug / Feature / Refactor)
- π Resource linking
- Teams (Owner / Admin / Member / Viewer)
- Scoped sessions + scoped tasks
- Permissionβsafe domain logic
- Daily / Weekly reports
- Programmatic summaries
- Insight generation
Automatic analytics detecting:
- π¨ High context switching
- π€ Low focus time
- π Fragile workflow patterns
- π Room for deepβwork improvements
- Nonβblocking report generation
- Insight analysis
- Scalable async architecture
- Fetch GitHub issues
- Autoβcreate Tasks
- Detect + ignore PRs
- Store external URLs + IDs
- API Request Logging Middleware
- Duration, status, userβagent, IP
- Full traceability of API usage
- Live reports
- Live insights
- Zero WebSocket overhead
- CSV
- JSON
- For tasks, sessions, reports, insights
- Unit tests
- Integration tests
- Signals tests
- Celery task pipeline tests
- GitHub importer tests (mocked async)
- SSE + middleware tests
devfocus/
βββ core/
β βββ models.py # Domain entities
β βββ services.py # SOLID service layer
β βββ signals.py # Reactive event handling
β βββ tasks.py # Celery jobs
β βββ integrations.py # GitHub importer
β βββ ...
β
βββ api/
β βββ serializers.py
β βββ views.py
β βββ urls.py
β βββ ...
β
βββ devfocus/
β βββ settings.py
β βββ celery.py
β βββ middleware.py
β βββ ...
β
βββ tests/
βββ README.md
- π Python 3.11+
- π¦ Django 5
- π Django REST Framework
- π§± Clean Architecture
- π§© SOLID Principles
- 𧬠DomainβDriven Components
- π§² Signals for reactive updates
- β‘ httpx (async)
- π GitHub API integration
- π SSE eventβstreaming
- π³ Celery 5
- π΄ Redis (Broker + Result backend)
- π§΅ Background report generation
- βοΈ Long-running async workflows
- πΎ SQLite (dev)
- β Ready for PostgreSQL
- π ORM optimization (annotate, select_related, prefetch)
- π Structured API logs
- π΅οΈ Request duration tracking
- π Perβuser analytics
- π§ͺ pytest / Django TestCase
- β‘ async test support
- π§± full coverage on:
- core domain
- services
- insights
- Celery tasks
- GitHub importer
- SSE
- permissions + teams
This document contains only the two requested sections:
- How to Run the Project\
- Full API Endpoint Reference
python3 -m venv venv
source venv/bin/activatepython -m venv venv
.\venv\Scripts\activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverYour API will be served at:
http://127.0.0.1:8000/api/
In a second terminal:
celery -A devfocus worker -l infoEnsure Redis is running:
redis-serverpip freeze > requirements.txt(Using default Django session authentication or token if enabled)
GET /api/tasks/
GET /api/tasks/?type=BUG
GET /api/tasks/?priority=HIGH
GET /api/tasks/?search=login
GET /api/tasks/?ordering=-created_at
POST /api/tasks/
GET /api/tasks/{id}/
PATCH /api/tasks/{id}/
DELETE /api/tasks/{id}/
GET /api/tasks/export/?format=csv
GET /api/tasks/export/?format=json
POST /api/tasks/import_github/
Body:
{
"owner": "django",
"repo": "django",
"team_id": 1
}GET /api/sessions/
GET /api/sessions/?status=OPEN
GET /api/sessions/?date_from=2025-01-01
GET /api/sessions/?ordering=-switch_count
POST /api/sessions/
GET /api/sessions/{id}/
POST /api/sessions/{id}/close/
POST /api/sessions/{id}/attach_task/
Body:
{
"task_id": 5,
"role": "MAIN"
}GET /api/sessions/export/?format=csv
GET /api/sessions/export/?format=json
GET /api/context-switches/
POST /api/context-switches/
Body:
{
"dev_session": 1,
"from_task": 2,
"to_task": 3,
"reason": "INTERRUPT"
}GET /api/resources/
POST /api/resources/
GET /api/reports/
POST /api/reports/daily/
Body (optional):
{
"date": "2025-01-30"
}POST /api/reports/daily-async/
POST /api/report-requests/
Body:
{
"type": "DAILY",
"day": "2025-01-30"
}GET /api/report-requests/
GET /api/insights/
GET /api/teams/
POST /api/teams/
GET /api/teams/{id}/members/
GET /api/events/stream/
Returns: - latest reports\
- latest insights
astext/event-stream.
All API calls generate an ApiRequestLog entry locally.
Most of my engineering work happens inside private, enterpriseβgrade repositories
β where I build:
- structured clean architectures
- highβscale backends
- domainβdriven systems
- async microservices
- data pipelines
- CI/CD workflows
β¦but none of that can be shown publicly.
So I created DevFocus to expose the quality, architecture, principles, and engineering depth
I actually use daily.
This project is not a toy it is a public representation of how I design real systems.
π€ I build systems that keep developers sharp, teams aligned, and architectures clean.
DevFocus is just a glimpse - the real power lives in private repos.-- Soroosh Morshedi (https://sorooshmorshedi.ir)
π₯π¬π»π€
βββββ ββ ββ βββββ ββββββ βββββ ββ ββ βββββββ βββββββ ββ ββ
ββ ββ ββ ββ ββ ββ ββ ββ βββ ββ βββ βββ ββ ββ
ββ βββ βββββ βββββ βββββ ββ β ββ βββ βββ βββββββ
ββ β ββ ββ ββ ββ ββ ββ βββ βββ βββ ββ ββ
ββ β ββ ββ ββ ββ ββ ββ ββ βββ βββ ββ ββ
βββββ β βββββ ββββββ ββ ββ ββ ββ βββββββ βββ ββ ββ
C Y B E R N I T H
> β‘ Crafted & unleashed by Soroosh morshedi ~ ( Cybernith ) ~
> π https://sorooshmorshedi.ir
> β€οΈ Built with passion