ядро платформы
Go to file
2025-01-21 15:57:22 +03:00
.gitea/workflows debug: Sigil back to map with only discours.io domain 2024-12-20 14:35:59 -03:00
.github/workflows deployfix 2024-11-01 14:33:34 +03:00
alembic merged-hub 2024-11-01 15:06:21 +03:00
auth .. 2024-11-14 14:00:33 +03:00
cache fmt 2025-01-21 10:09:28 +03:00
docs corsfix4 2024-12-17 20:06:15 +03:00
orm merged-hub 2024-11-01 15:06:21 +03:00
resolvers published_at-fix3 2025-01-21 15:57:22 +03:00
schema last_commented_at 2024-12-04 17:40:45 +03:00
services fmt 2025-01-21 10:09:28 +03:00
utils sqlite-support 2024-10-14 02:05:20 +03:00
__init__.py buildsystemver-fix-2 2024-02-19 16:29:05 +03:00
.cursorignore .. 2024-11-14 14:00:33 +03:00
.editorconfig migration, auth, refactoring, formatting 2022-09-17 21:12:14 +03:00
.gitignore fmt+debug 2024-12-12 01:04:11 +03:00
.pre-commit-config.yaml ruff-update 2024-06-04 09:10:52 +03:00
app.json 1sec-delay 2024-02-21 23:12:47 +03:00
CHANGELOG.md v0.4.7 2024-11-20 23:59:11 +03:00
Dockerfile 312 2024-10-13 00:49:06 +03:00
main.py fmt+debug 2024-12-12 01:04:11 +03:00
nginx.conf.sigil debug-update-shout 2025-01-16 05:34:43 +03:00
Procfile configured isort, black, flake8 2023-10-30 22:00:55 +01:00
pyproject.toml v0.4.7 2024-11-20 23:59:11 +03:00
README.md fmt+debug 2024-12-12 01:04:11 +03:00
server.py fmt+debug 2024-12-12 01:04:11 +03:00
settings.py authdev 2024-12-16 18:57:10 +03:00

GraphQL API Backend

Backend service providing GraphQL API for content management system with reactions, ratings and comments.

Core Features

Shouts (Posts)

  • CRUD operations via GraphQL mutations
  • Rich filtering and sorting options
  • Support for multiple authors and topics
  • Rating system with likes/dislikes
  • Comments and nested replies
  • Bookmarks and following

Reactions System

  • ReactionKind types: LIKE, DISLIKE, COMMENT
  • Rating calculation for shouts and comments
  • User-specific reaction tracking
  • Reaction stats and aggregations
  • Nested comments support

Authors & Topics

  • Author profiles with stats
  • Topic categorization and hierarchy
  • Following system for authors/topics
  • Activity tracking and stats
  • Community features

Tech Stack

Development

Setup

Start API server with dev keyword added and mkcert installed:

mkdir .venv
python3.12 -m venv .venv
poetry env use .venv/bin/python3.12
poetry update

mkcert -install
mkcert localhost
poetry run server.py dev

Useful Commands

# Linting and import sorting
poetry run ruff check . --fix --select I 

# Code formatting
poetry run ruff format . --line-length=120 

# Run tests
poetry run pytest

# Type checking
poetry run mypy .

Code Style

We use:

  • Ruff for linting and import sorting
  • Line length: 120 characters
  • Python type hints
  • Docstrings for public methods

GraphQL Development

Test queries in GraphQL Playground at http://localhost:8000:

# Example query
query GetShout($slug: String) {
  get_shout(slug: $slug) {
    id
    title
    main_author {
      name
    }
  }
}