ядро платформы
Go to file
2025-05-30 08:51:24 +03:00
.gitea/workflows debug: fixed workflows gitea 2025-03-05 20:17:34 +00:00
.github/workflows deployfix 2024-11-01 14:33:34 +03:00
alembic upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +03:00
auth linted+fmt 2025-05-29 12:37:39 +03:00
cache distinct-fix 2025-05-30 08:51:24 +03:00
docs shout-id-fox+test-imports-fix 2025-05-29 23:40:27 +03:00
orm linted+fmt 2025-05-29 12:37:39 +03:00
panel load_authors_by-debug 2025-05-26 20:34:51 +03:00
resolvers distinct-fix 2025-05-30 08:51:24 +03:00
schema auth fixes, search connected 2025-05-22 04:34:30 +03:00
services shout-id-fox+test-imports-fix 2025-05-29 23:40:27 +03:00
tests shout-id-fox+test-imports-fix 2025-05-29 23:40:27 +03:00
utils upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +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 feat: with author sorting by shouts, followers and names 2025-05-25 17:30:12 -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
biome.json upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +03:00
CHANGELOG.md shout-id-fox+test-imports-fix 2025-05-29 23:40:27 +03:00
dev.py linted+fmt 2025-05-29 12:37:39 +03:00
Dockerfile depfix-dockernode5 2025-05-26 10:47:33 +03:00
env.d.ts upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +03:00
index.html upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +03:00
main.py nonginx-cors 2025-05-29 18:26:10 +03:00
nginx.conf.sigil nonginx-cors 2025-05-29 18:26:10 +03:00
package-lock.json adminpanel login fix 2025-05-16 10:30:02 +03:00
package.json auth-wip 2025-05-21 01:34:02 +03:00
pylanceconfig.json auth fixes, search connected 2025-05-22 04:34:30 +03:00
pyproject.toml tests, maintainance fixes 2025-05-16 09:22:53 +03:00
README.md Merge branch 'fix/sv-authorSortingBy' of https://dev.dscrs.site/discours.io/core into feature/auth-internal 2025-05-26 12:42:47 +03:00
requirements.dev.txt comment-delete-handling-patch 2025-03-20 11:01:39 +03:00
requirements.txt depfix 2025-05-26 09:32:55 +03:00
settings.py linted+fmt 2025-05-29 12:37:39 +03:00
tsconfig.json adminpanel login fix 2025-05-16 10:30:02 +03:00
vite.config.ts adminpanel login fix 2025-05-16 10:30:02 +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

Prepare environment:

mkdir .venv
python3.12 -m venv venv
source venv/bin/activate

Run server

First, certifcates are required to run the server.

mkcert -install
mkcert localhost

Then, run the server:

python -m granian main:app --interface asgi --host 0.0.0.0 --port 8000

Useful Commands

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

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

# Run tests
pytest

# Type checking
mypy .

# dev run
python -m granian main:app --interface asgi

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
    }
  }
}