Skip to content

Repository files navigation

Telegram Services Marketplace

Production-ready Telegram Mini App for a services marketplace with full e-commerce functionality.

Features

  • Service Catalog: Browse, search, and filter services
  • Shopping Cart: Add services, apply promo codes
  • Multiple Payment Methods: YooKassa, Robokassa, Telegram Stars
  • Order Management: Track orders, update status
  • Reviews & Ratings: 5-star reviews with seller responses
  • Real-time Notifications: SignalR-powered updates
  • Seller Dashboard: Manage services, view analytics
  • Multilingual Support: Russian, English, German

Tech Stack

Backend

  • ASP.NET Core 8.0
  • PostgreSQL with Entity Framework Core
  • Redis for caching
  • SignalR for real-time features
  • JWT + Telegram authentication

Frontend

  • React 18 with TypeScript
  • Telegram Mini Apps SDK (@twa-dev/sdk)
  • TanStack Query for data fetching
  • Zustand for state management
  • Tailwind CSS for styling
  • Framer Motion for animations

Testing

  • Playwright for E2E tests
  • xUnit for backend unit tests

Quick Start

Prerequisites

  • Docker & Docker Compose
  • Node.js 20+
  • .NET 8 SDK (for local development)

Environment Setup

  1. Copy the environment template:
cp .env.example .env
  1. Configure the required variables:
TELEGRAM_BOT_TOKEN=your_bot_token
JWT_SECRET=your_super_secret_key_at_least_32_chars
YOOKASSA_SHOP_ID=your_shop_id
YOOKASSA_SECRET_KEY=your_secret_key
ROBOKASSA_LOGIN=your_login
ROBOKASSA_PASSWORD1=password1
ROBOKASSA_PASSWORD2=password2
DB_PASSWORD=your_db_password
WEBAPP_URL=https://your-webapp-url.com

Running with Docker

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

The application will be available at:

Local Development

Backend:

cd backend
dotnet restore
dotnet run --project src/WebAPI

Frontend:

cd frontend
npm install
npm run dev

Project Structure

TelegramMarketplace/
├── backend/
│   ├── src/
│   │   ├── Domain/          # Entities, interfaces, domain events
│   │   ├── Application/     # Use cases, DTOs, services
│   │   ├── Infrastructure/  # Persistence, payments, auth
│   │   └── WebAPI/          # Controllers, middleware, hubs
│   └── tests/
├── frontend/
│   ├── src/
│   │   ├── components/      # React components
│   │   ├── pages/           # Page components
│   │   ├── hooks/           # Custom hooks
│   │   ├── services/        # API services
│   │   ├── store/           # Zustand stores
│   │   └── types/           # TypeScript types
│   └── e2e/                 # Playwright tests
├── docker-compose.yml
├── nginx.conf
└── README.md

API Documentation

Swagger documentation is available at /swagger when running the backend.

Key Endpoints

  • POST /api/auth/telegram - Authenticate with Telegram
  • GET /api/services - List services with filters
  • GET /api/services/{id} - Get service details
  • POST /api/cart/items - Add to cart
  • POST /api/orders - Create order
  • POST /api/payments/{provider}/create - Create payment

Testing

E2E Tests (Playwright)

cd frontend
npm run test:e2e
npm run test:e2e:ui  # With UI

Backend Tests

cd backend
dotnet test

Deployment

See DEPLOYMENT.md for detailed deployment instructions.

Production Checklist

  • Set strong JWT secret (32+ characters)
  • Configure HTTPS with valid SSL certificate
  • Set up payment provider webhooks
  • Configure Telegram bot menu button
  • Enable database backups
  • Set up monitoring (health checks)
  • Configure CORS for production domain

Documentation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE for details.


Built with Telegram Mini Apps SDK. Learn more at core.telegram.org/bots/webapps

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages