Vlad2030 / ranobe-saver

Service for download ranobes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RanobeSaver

Service for download your best ranobes for free from ranobelib

Roadmap

  • Backend
    • Create project arch
    • /users
      • Endpoints
      • CRUD
      • DB models
      • Schemas
    • /ranobes
      • Endpoints
      • CRUD
      • DB models
      • Schemas
    • Docker
      • Dockerfile
    • .env
  • Telegram Bot
    • Create project arch
    • Requests with backend
    • Celery broker
    • Message handlers
      • /start
      • /ranobe
      • /help
    • Callback handlers
      • ...
      • ...
      • ...
    • Inline mode
    • Ad and news mailing
    • Ranobe events
    • Docker
      • Dockerfile
    • .env
  • Docker-compose
  • Release MVP

Stack

Backend:

  • Python 3.10 (FastAPI, SQLAIchemy, Aiohttp)
  • Docker

Telegram Bot:

  • Python 3.10 (Aiogram 3.0, Aiohttp)
  • Docker

Dependencies

Telegram bot:

  • aiogram>=3.0.0b7
  • aiohttp==3.8.4
  • loguru>=0.6.0
  • orjson>=3.8.8
  • python-dotenv==1.0.0

Backend:

  • aiohttp==3.8.4
  • alembic==1.10.3
  • asyncio==3.4.3
  • asyncpg==0.27.0
  • fastapi==0.95.1
  • gunicorn==20.1.0
  • loguru==0.6.0
  • orjson==3.8.10
  • pydantic==1.10.7
  • python-dotenv==1.0.0
  • SQLAlchemy==2.0.9
  • uvicorn==0.21.1

Backend

REST API docs

/users endpoint

POST /users/

Create a new user

request body

{
    "user_id": "1840037832",
    "username": "vladdd00",
    "full_name": "влад",
    "admin": true
}

response body

{
    "created": true,
}

PATCH /users/{id}/

User edit

request body

{
    "admin": false (or null)
}

P.S. if the value is null it will not be changed

response body

{
    "success": true,
}

GET /users/

Get users list

query parameters

{
    "limit": 1 (optional, default=50) 
}

response body

{
    "users": [
        {
            "id": 1,
            "telegram": {
                "user_id": "1840037832",
                "username": "vladdd00",
                "full_name": "влад",
            },
            "admin": true
        }
    ]
}

GET /users/count/

Get users count

response body

{
    "count": 1,
    "admin_count": 1
}

GET /users/{id}/

Get user by id

response body

{
    "id": 1,
    "telegram": {
        "user_id": "1840037832",
        "username": "vladdd00",
        "full_name": "влад",
    },
    "admin": true
}

/telegram endpoint

GET /telegram/users/{user_id}/

Get telegram user by user_id

response body

{
    "user_id": "1840037832",
    "username": "vladdd00",
    "full_name": "влад",
    "admin": true
}

/ranobes endpoint

in development

About

Service for download ranobes


Languages

Language:Python 98.9%Language:Dockerfile 0.7%Language:Shell 0.4%