Modern link management system with Telegram bot, REST API, and web interface support
LinkKeeper is a full-featured system for saving, organizing, and managing links with support for multiple interfaces: Telegram bot, REST API, and modern web interface.
- β Save links with categories (resources)
- β View view statistics
- β Get random links
- β Filter by resources
- β Search links
- β Interactive menu with buttons
- β Save links via commands
- β Get random links
- β Filter by resource types (articles, videos)
- β Automatic user registration
- β Full CRUD for links
- β View statistics
- β RESTful architecture
- β CORS support
- β Automatic registration on first use
- β Personalization via Telegram ID
- β User existence check
- β Modern React Native interface
- β Dark theme in GitHub/Cursor style
- β Responsive design
- β Statistics and analytics
- β Multiple UI variants
LinkKeeper is built on a microservices architecture:
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β Frontend ββββββΆβ API Service ββββββΆβ PostgreSQL β
β (React/Expo)β β (Go) β β Database β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
β
βββββββββ΄βββββββββ
β β
βββββββββΌβββββββ ββββββββΌβββββββββ
β Bot Service β β User Service β
β (Go) β β (Go) β
ββββββββββββββββ βββββββββββββββββ
- API Service (
:8080) β main REST API for link management - User Service (
:8081) β Telegram user management - Bot Service β Telegram bot for interactive management
- Frontend β web interface on React Native/Expo
- Go 1.23+
- Node.js 18+
- PostgreSQL 16+
- Docker and Docker Compose (optional)
- Telegram Bot Token (for bot)
- Clone the repository:
git clone https://github.com/danilovid/linkkeeper.git
cd linkkeeper- Install dependencies:
# Go dependencies
go mod download
go mod vendor
# Frontend dependencies
cd frontend && npm install && cd ..- Set up the database:
# Start PostgreSQL via Docker
task db:up
# Apply migrations
task db:migrate- Configure environment variables:
export POSTGRES_DSN="postgres://postgres:postgres@localhost:5432/linkkeeper?sslmode=disable"
export TELEGRAM_TOKEN="your_telegram_bot_token"
export API_BASE_URL="http://localhost:8080"
export USER_SERVICE_URL="http://localhost:8081"# Start all services
task start
# Or directly
docker-compose up -d# Terminal 1: API Service
task api:run
# Terminal 2: User Service
task user:run
# Terminal 3: Bot Service
export TELEGRAM_TOKEN="your_token"
task bot:run
# Terminal 4: Frontend
task frontend:startPOST /api/v1/linksβ create linkGET /api/v1/linksβ list linksGET /api/v1/links/{id}β get linkGET /api/v1/links/randomβ random linkPOST /api/v1/links/{id}/viewedβ mark as viewedDELETE /api/v1/links/{id}β delete linkGET /api/v1/statsβ view statistics
POST /api/v1/usersβ create/get userGET /api/v1/users/{id}β get userGET /api/v1/users/telegram/{telegram_id}β get by Telegram IDGET /api/v1/users/telegram/{telegram_id}/existsβ check existence
Commands:
/startβ start working with bot/save <url>β save link/viewed <id>β mark link as viewed/random [resource]β get random link
Buttons:
- πΎ Save link β save link
- β Mark viewed β mark as viewed
- π² Random β random link
- π° Random article β random article
- π¬ Random video β random video
Open http://localhost:19006 (or port specified by Expo)
Features:
- View all links
- Add new links
- Search and filter
- View statistics
- Modern interface
# All tests
task test
# With coverage
task test:coverage
# Unit tests only
task test:unit
# Integration tests
task test:integration| Component | Coverage |
|---|---|
| User Service (Usecase) | 100% β |
| User Service (Repository) | 86.4% β |
| API Service (Usecase) | 52.2% |
| User Service (HTTP) | 50.7% |
| Overall | ~70% |
Total tests: 38 unit + 3 integration
For more details: Testing Guide
LinkKeeper/
βββ cmd/ # Service entry points
β βββ api-service/
β βββ bot-service/
β βββ user-service/
βββ internal/ # Internal packages
β βββ api-service/ # API service
β βββ bot-service/ # Telegram bot
β βββ user-service/ # User service
βββ pkg/ # Shared packages
β βββ config/ # Configuration
β βββ database/ # Database
β βββ httpclient/ # HTTP client
β βββ logger/ # Logging
βββ frontend/ # React Native application
βββ migrations/ # SQL migrations
βββ build/ # Dockerfiles
βββ tests/ # Integration tests
βββ .github/workflows/ # CI/CD
# Show all available commands
task
# Code formatting
task fmt
# Linting
task lint
# Run CI checks locally
task ci:local
# Install pre-commit hooks
task hooks:installAutomatically before each commit:
- β Code formatting
- β go vet
- β go mod tidy
- β Unit tests
Installation:
task hooks:installAutomatically runs on:
- Push to
mainanddevelop - Pull requests
Pipeline includes:
- β Tests (with race detector)
- β Linting (golangci-lint)
- β Formatting (go fmt)
- β Build all services
- β Docker images (main branch)
For more details: CI/CD Documentation
All documentation is located in the docs/ directory:
- Testing Guide β comprehensive testing documentation
- CI/CD Documentation β CI/CD pipeline details
- Test Coverage Summary β coverage statistics
- Testing & CI Quick Start β quick start guide
- User Service Documentation β User Service details
- Documentation Index β complete documentation index
- Frontend Documentation β Frontend documentation
- Go 1.23+ β main language
- PostgreSQL 16+ β database
- GORM β ORM
- Gorilla Mux β HTTP routing
- Zerolog β logging
- Telebot β Telegram Bot API
- React Native β mobile framework
- Expo β development tools
- TypeScript β typing
- Docker & Docker Compose β containerization
- GitHub Actions β CI/CD
- golangci-lint β linter
- pre-commit β git hooks
HTTP_ADDRβ HTTP server address (default::8080)POSTGRES_DSNβ PostgreSQL connection string
HTTP_ADDRβ HTTP server address (default::8081)POSTGRES_DSNβ PostgreSQL connection string
TELEGRAM_TOKENβ Telegram bot token (required)API_BASE_URLβ API service URL (default:http://localhost:8080)USER_SERVICE_URLβ User service URL (default:http://localhost:8081)BOT_TIMEOUT_SECONDSβ request timeout (default: 10)
- Fork the project
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- β Follow Go code style
- β Add tests for new features
- β Update documentation
- β Use Conventional Commits
MIT License β see LICENSE file
Danilovid
- GitHub: @danilovid
- Telebot β excellent library for Telegram bots
- GORM β powerful ORM for Go
- Expo β tools for React Native development
- β API Service β ready
- β User Service β ready
- β Bot Service β ready
- β Frontend β ready
- β Tests β 38 unit + 3 integration
- β CI/CD β configured
β οΈ Test coverage β 70% (target: 85%)
Made with β€οΈ for convenient link management