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, ้ฎ้ข, 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