Corp/backend/README_EUSRR.md
Игорь Надеин 4d04aafdb9 refactor: Replace inline CSS with components (Phase 3)
- Replaced feed-* inline styles in base.html with feed-cards.css component (~60 lines)
- Replaced ios-search inline styles in 3 templates with ios-search.css component
  * employees/employees_list.html
  * search/results.html
  * employees/department_list.html
- Eliminated ~150 lines of duplicate CSS across templates
- All 17 tests passing
2025-10-28 08:54:38 +03:00

1.6 KiB
Raw Blame History

EUSRR Backend — Quickstart

What’s inside

  • Django 5.2, DRF, SimpleJWT
  • Apps: employees, requests_app (HR requests), calendar_app, feed (news), communications (chat via Channels), bots (Telegram via aiogram), documents, search, hikcentral (read-only models to external DB)
  • ASGI via Channels; Redis required for websockets

Local run (SQLite, no websockets)

python -m venv .venv && source .venv/bin/activate    # Windows: .venv\Scripts\activate
pip install -r backend/requirements.txt
cp backend/.env backend/.env.local || true
# Edit backend/.env.local if needed (USE_SQLITE=True by default)
python backend/manage.py migrate
python backend/manage.py createsuperuser
python backend/manage.py runserver 0.0.0.0:9000

Open http://127.0.0.1:9000/

Full stack with Docker (Postgres + Redis)

  1. Put your secrets into backend/.env (use .env.example as a template). Never commit real secrets.
  2. Ensure the Dockerfile uses eusrr_backend.asgi (or use the provided Dockerfile.fixed).
  3. Launch:
docker compose up --build

The app will be available at http://127.0.0.1:9000/

Useful commands

# Start Telegram bot
python backend/manage.py start_telegram_bot

# Run tests
pytest -q backend

Notes

  • Set API_BASE_URL to match where the app is served (default: http://127.0.0.1:9000/api).
  • For Channels websockets, ensure Redis is reachable at ${REDIS_HOST}:${REDIS_PORT}.
  • The hikcentral DB is configured as a secondary Postgres. Externalize its DSN via environment variables if you plan to use it.