SplitCore is a Telegram bot designed to automate shared expense tracking for groups of friends, travelers, or event organizers. No more messy Excel sheets or "who owes whom" arguments.
Users create "Funds" (events), invite friends via unique deep-links, and record their expenses. The bot automatically calculates the balance: who overpaid and who needs to settle their debt.
- Language: Go (Golang) 1.26.2
- Framework: telebot.v4 (Telegram Bot API)
- Database: PostgreSQL
- Driver: pgx/v5 (Connection Pool)
- In-memory storage: FSM (Finite State Machine) for user dialog management.
- Infrastructure: Docker, Docker Compose, Makefile.
- Migrations: golang-migrate.
The project is built with a strict separation of concerns, ensuring high testability and scalability:
cmd/bot/— Entry point, initialization, and Dependency Injection.internal/domain/— Business entities and Repository interfaces.internal/repository/— Database access layer (PostgreSQL implementation).internal/delivery/telegram/— Bot-specific logic (handlers, middleware, router).internal/pkg/— Internal utilities (random generators, etc.).
- +- (In work) Bot skeleton and Inline-button navigation.
- Finite State Machine (FSM) for user input handling.
- Database: migrations, user, and fund storage.
- Fund creation and unique Deep-Link generation.
- Automatic "Creator-to-Member" enrollment (Transactions).
- Expense logging (Purchases) — In Progress.
- Debt calculation math module — Next Step.
- Clone the repository:
git clone https://github.com/GanFay/new-project.git
- Set up environment variables in a
.envfile (Bot token, DB credentials). - Start the database using Docker:
docker-compose up -d
- Run migrations:
make migrate-up
- Run the bot:
go run cmd/bot/main.go