Go to file
Artem Kashaev 9a2a2f6adc feat: add static file serving and frontend asset handling to FastAPI application 2025-12-01 14:25:11 +05:00
.gitea/workflows fix: restrict build workflow to trigger only on master branch 2025-11-30 09:46:58 +05:00
app feat: add static file serving and frontend asset handling to FastAPI application 2025-12-01 14:25:11 +05:00
frontend feat: enhance forms with improved select components and data handling for contacts and deals 2025-12-01 14:16:24 +05:00
migrations fix: update Dockerfile to set correct working directory for migrations 2025-11-30 00:30:44 +05:00
tests feat: implement Redis caching for analytics endpoints with fallback to database 2025-11-29 09:45:27 +05:00
.dockerignore feat: add Docker support and database migrations 2025-11-22 14:51:20 +05:00
.gitignore feat: add initial implementation of Kitchen CRM with authentication and dashboard features 2025-12-01 12:29:02 +05:00
.python-version fix: update Python version to 3.14.0 2025-11-27 11:02:15 +05:00
LICENSE Initial commit 2025-11-22 07:35:06 +00:00
README.md feat: implement Redis caching for analytics endpoints with fallback to database 2025-11-29 09:45:27 +05:00
alembic.ini fix: update database URL to use 0.0.0.0 and adjust Alembic migration configurations 2025-11-27 12:36:49 +05:00
docker-compose-ci.yml fix: add healthcheck configurations for app, postgres, and redis services in docker-compose 2025-11-30 00:33:50 +05:00
docker-compose-dev.yml feat: add CI/CD workflow for building and deploying application with Docker 2025-11-29 12:19:44 +05:00
pyproject.toml feat: implement Redis caching for analytics endpoints with fallback to database 2025-11-29 09:45:27 +05:00
test_db_filling.sql feat: enhance organization management; add member registration and validation, update user registration flow, and improve enum handling 2025-11-29 08:50:11 +05:00
uv.lock feat: implement Redis caching for analytics endpoints with fallback to database 2025-11-29 09:45:27 +05:00

README.md

Test Task CRM

FastAPI backend template that follows the architecture described in the system prompt: async SQLAlchemy ORM, Alembic-ready models, service/repository layers, JWT auth helpers, and Pydantic v2 schemas.

Quick start

  1. Create a .env file based on variables in app/core/config.py.
  2. Install dependencies:
    uv sync
    
  3. Run the development server:
    uv run python main.py
    

Project layout

app/
  api/            # FastAPI routers and dependencies
  core/           # Settings, database, security helpers
  models/         # SQLAlchemy models and Pydantic schemas
  repositories/   # Data access layer (SQLAlchemy ORM usage)
  services/       # Business logic (auth, users, etc.)

Add new routers under app/api/v1, repositories under app/repositories, and keep business rules inside app/services.

Redis analytics cache

Analytics endpoints can use a Redis cache (TTL 120 seconds). The cache is disabled by default, so the service falls back to the database.

  1. Start Redis and set the following variables:
  • REDIS_ENABLED=true
  • REDIS_URL=redis://localhost:6379/0
  • ANALYTICS_CACHE_TTL_SECONDS (optional, defaults to 120)
  • ANALYTICS_CACHE_BACKOFF_MS (max delay for write/delete retries, defaults to 200)
  1. When Redis becomes unavailable, middleware logs the degradation and responses transparently fall back to database queries until connectivity is restored.