How erfanmola/dpxwallet works
Project Overview
• DPXWallet is a dummy wallet application built as a Telegram mini app. It integrates a feature-rich backend API (built with Laravel) with a modern VueJS-based frontend (leveraging TeleVue for Telegram UI components). The system is meant to work as a Telegram WebApp accessible via @DPXWalletBot.
• Main use cases include wallet transactions, displaying wallet/transaction information, and interacting with a Telegram bot interface.
Main Components
a. Frontend (webApp):
• Built in VueJS with components, views (e.g., Home, Wallet, Transaction).
• Uses TeleVue library for Telegram-specific UI components.
• Organized with a router (Vue Router) and state management (stores) plus assets for styling and media.
• Vite is used as the build tool (note the vite.config.js files).
b. Backend (api):
• Built using Laravel (reveal by its typical directory structure: app, bootstrap, config, routes, migrations).
• Contains controllers (including API endpoints for wallet operations), models (Transaction, Wallet), middleware, and providers.
• Exposes RESTful endpoints (as seen in api/routes, including api.php which likely handles JSON API endpoints for frontend consumption).
• Integrated database migrations and seeders for creating tables such as transactions and wallets.
c. External Interfaces:
• Telegram Bot Integration: the WebApp is accessed via Telegram’s interface (DPXWalletBot), meaning Telegram acts as the host for the frontend.
• CI/CD/Deployment: GitHub workflows are configured for deployment automation (check .github/workflows/deploy.yml).
d. Supporting Components:
• Database: implied via Laravel migrations and configurations.
• Documentation and Deployment: comprehensive docs in the docs folder that guide setup and technology use.
• Configuration and environment management via files like .env.example, composer.json, package.json.
Relationships and Interactions
• The WebApp (frontend) communicates with the API (backend) through RESTful calls over HTTP.
• The Telegram mini app acts as a container/set of instructions that load the WebApp, meaning that Telegram is an external dependency.
• The backend uses an MVC pattern:
• Controllers expose API endpoints.
• Models represent domain entities (Wallet, Transaction).
• Routes define the interaction points.
• When users interact with the Telegram bot (either through commands or clicking the WebApp link), data flows into the backend API, which then communicates with the database.
• The CI/CD pipeline (GitHub workflows) automates deployment for both backend and frontend as needed.
Architectural Patterns and Design Principles
• Use of the MVC pattern in the Laravel backend, separating concerns among controllers, models, views (if any), and middleware.
• Clear separation of concerns between frontend and backend, typical of a modern full-stack approach.
• Modularization: The project is divided into distinct directories for frontend (webApp) and backend (api), with documentation and deployment scripts clearly separated.
• External integration: The system architecture considers Telegram as a hosting and interaction layer, influencing how the components interact.