How artemchuban/telegram-test-birthday works
A VueJS-based frontend using Pinia for state management.
2. A FastAPI-powered backend (run by Uvicorn) using Turtle ORM to interact with a PostgreSQL database.
3. A Telegram Bot component that currently uses long-polling for updates (with a note that a TLS-encrypted server/w/webhook would be used in production).
Main Components
• Frontend:
• Represents the client-side application built with VueJS.
• Includes directories for assets, components, views, router, and state (Pinia).
• Communicates with the backend via API calls.
• Backend:
• Contains the FastAPI application (organized with routers, models, schemas, settings, etc.).
• Responsible for serving API endpoints and business logic.
• Utilizes a PostgreSQL database via the Turtle ORM.
• Bot:
• The Telegram Bot module that handles messaging – currently implemented with long-polling.
• Will eventually integrate with the Telegram API using webhooks.
• May also interact with the backend for user data and scheduling tasks.
• Database:
• PostgreSQL database container.
• The backend’s ORM (Turtle ORM) handles migrations and model interactions.
• External Services:
• Telegram Bot API (external to your infrastructure).
• Docker (and docker-compose) managing the overall container orchestration.
Relationships and Interactions
• Frontend ↔ Backend:
• The frontend makes HTTP/API requests to the FastAPI backend.
• Backend ↔ Database:
• FastAPI interacts with PostgreSQL for persistent storage.
• Bot ↔ Telegram API:
• The Bot communicates with Telegram servers using long-polling (or later, webhooks).
• This external connection clearly.
• Bot ↔ Backend (if applicable):
• The Bot might pull additional data from or push updates to the backend.
• This interaction if the integration exists in your design.
Architectural Patterns and Technologies
• Microservices/Containerization:
• Each component (frontend, backend, bot, database) is containerized using Docker.
• docker-compose orchestrates the containers, connecting them as per defined environment variables.
• Separation of Concerns:
• Frontend handles user interaction.
• Backend encapsulates core business logic and API endpoint definitions.
• Bot handles real-time interaction with Telegram.
• Technology Stack:
• Frontend: VueJS, Pinia, Vite, and supporting tools (ESLint, Prettier, TypeScript configurations).
• Backend: FastAPI running on Uvicorn, Docker, and Turtle ORM for database interactions.
• Bot: Python-based, with a similar structure to the backend, operated via Docker.
• Database: PostgreSQL hosted as a separate service/container.
• CI/CD: GitHub workflows for frontend, backend, and bot deployments.