ядро платформы
Go to file
Untone 2ca2a7b256
All checks were successful
Deploy on push / deploy (push) Successful in 7s
readme
2025-07-03 12:47:54 +03:00
.gitea/workflows nochecks1 2025-06-03 01:14:51 +03:00
.github/workflows deply-fix 2025-06-03 00:58:07 +03:00
alembic Squashed new RBAC 2025-07-02 22:30:21 +03:00
auth 0.7.5-topicfix 2025-07-03 00:20:10 +03:00
cache 0.5.8-panel-upgrade-community-crud-fix 2025-06-30 21:25:26 +03:00
docs 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
orm 0.7.1-fix 2025-07-02 22:49:20 +03:00
panel 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
resolvers 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
schema 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
services 0.7.5-topicfix 2025-07-03 00:20:10 +03:00
tests 0.7.5-topicfix 2025-07-03 00:20:10 +03:00
utils Squashed new RBAC 2025-07-02 22:30:21 +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 0.5.8-panel-upgrade-community-crud-fix 2025-06-30 21:25:26 +03:00
.pre-commit-config.yaml 0.5.0-typesafety-begin 2025-06-02 03:00:40 +03:00
alembic.ini Improve topic sorting: add popular sorting by publications and authors count 2025-06-02 02:56:11 +03:00
app.json 1sec-delay 2024-02-21 23:12:47 +03:00
biome.json 0.5.8-panel-upgrade-community-crud-fix 2025-06-30 21:25:26 +03:00
CHANGELOG.md readme 2025-07-03 12:47:54 +03:00
CONTRIBUTING.md Squashed new RBAC 2025-07-02 22:30:21 +03:00
default_role_permissions.json 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
dev.py maintainance 2025-06-16 20:20:23 +03:00
Dockerfile Improve topic sorting: add popular sorting by publications and authors count 2025-06-02 02:56:11 +03:00
env.d.ts Squashed new RBAC 2025-07-02 22:30:21 +03:00
index.html Improve topic sorting: add popular sorting by publications and authors count 2025-06-02 02:56:11 +03:00
LICENSE docs+featured/unfeatured-upgrade 2025-06-19 11:28:48 +03:00
main.py Squashed new RBAC 2025-07-02 22:30:21 +03:00
mypy.ini Improve topic sorting: add popular sorting by publications and authors count 2025-06-02 02:56:11 +03:00
nginx.conf.sigil nginx-revert-fix 2025-06-03 01:53:19 +03:00
package-lock.json Squashed new RBAC 2025-07-02 22:30:21 +03:00
package.json vers 2025-07-03 12:25:26 +03:00
permissions_catalog.json 0.7.7-topics-editing 2025-07-03 12:15:10 +03:00
pylanceconfig.json 0.5.8-panel-upgrade-community-crud-fix 2025-06-30 21:25:26 +03:00
pyproject.toml Squashed new RBAC 2025-07-02 22:30:21 +03:00
README.md readme 2025-07-03 12:47:54 +03:00
requirements.dev.txt comment-delete-handling-patch 2025-03-20 11:01:39 +03:00
requirements.txt docs+featured/unfeatured-upgrade 2025-06-19 11:28:48 +03:00
settings.py schema-fix 2025-06-30 22:43:32 +03:00
tsconfig.json Squashed new RBAC 2025-07-02 22:30:21 +03:00
vite.config.ts Squashed new RBAC 2025-07-02 22:30:21 +03:00

GraphQL API Backend

Version Tests Python PostgreSQL Redis txtai GraphQL TypeScript SolidJS Vite Biome

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

📚 Documentation

🚀 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

RBAC & Permissions

  • RBAC with hierarchy using Redis

🛠️ Tech Stack

Core: Python 3.12 • GraphQL • PostgreSQL • SQLAlchemy • JWT • Redis • txtai Server: Starlette • Granian 1.8.0 • Nginx Frontend: SolidJS 1.9.1 • TypeScript 5.7.2 • Vite 5.4.11 GraphQL: Ariadne 0.23.0 Tools: Pytest • MyPy • Biome 2.0.6

🔧 Development

PRs Welcome Biome Mypy

📦 Prepare environment:

python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.dev.txt

🚀 Run server

First, certificates are required to run the server with HTTPS.

mkcert -install
mkcert localhost

Then, run the server:

python -m granian main:app --interface asgi

Useful Commands

# Linting and formatting with Biome
biome check . --write

# Lint only
biome lint .

# Format only
biome format . --write

# Run tests
pytest

# Type checking
mypy .

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

📝 Code Style

Line 120 Types Docs

Biome 2.0.6 for linting and formatting • 120 char lines • Type hints required • 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
    }
  }
}

📊 Project Stats

Lines Files Coverage MIT

🤝 Contributing

CHANGELOG.md

ContributingRead the guide

We welcome contributions! Please read our contributing guide before submitting PRs.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Website GitHubdiscours.ioSource Code


Made with ❤️ by the Discours Team

Made with Love Open Source