How rguziy/billcore works
BillCore is a role-based billing system for utility and telecom operations. Users sign in, manage clients and service locations, configure services and tariffs, maintain subscriptions, and enter or review period calculations; managers and admins also manage periods and view statistics. The Go API routes requests through authorization and feature handlers to business logic and SQL repositories backed by PostgreSQL, while the Next.js frontend provides the corresponding workspaces. The frontend-to-API wiring and several unsampled handler/repository links are not shown, so those connections are omitted or marked unverified.
Main entry points: router.go HTTP router · period_service.go Period generation · calculation_handler.go Calculation and reports API · auth_service.go Login and language
Components 33
Web workspaces
- Billing screens
web/app/calculations/page.tsx - Client workspace
web/app/clients/page.tsx - Client profile
web/app/clients/detail/page.tsx - Location workspace
web/app/locations/page.tsx - Services tariffs
web/app/services/page.tsx - Subscriptions
web/app/subscriptions/page.tsx - Periods
web/app/periods/page.tsx - Statistics
web/app/statistics/page.tsx - User administration
web/app/users/page.tsx - Sign in
web/app/login/page.tsx - API client
web/lib/api.ts - Session handling
web/lib/auth.ts
API and access
- HTTP router
internal/api/router.go - Authentication
internal/api/handler/auth_handler.go - JWT access control
internal/api/middleware/auth.go - Client and location API
internal/api/handler/client_handler.go - Calculation and reports API
internal/api/handler/calculation_handler.go - Services API
internal/api/handler/service_handler.go - Subscription API
internal/api/handler/subscription_handler.go - User administration API
internal/api/handler/user_handler.go - Period API
internal/api/handler/period_handler.go - Login and language
internal/service/auth_service.go - BillCore server
cmd/server/main.go
Billing operations
- Period generation
internal/service/period_service.go - Financial reporting
internal/service/report_service.go
Persistence
- Client and location data
internal/repository/client_repo.go - Calculation data
internal/repository/calculation_repo.go - Service and tariff data
internal/repository/service_repo.go - Subscription data
internal/repository/subscription_repo.go - User data
internal/repository/user_repo.go - Period data
internal/repository/period_repo.go - PostgreSQL
Other components
- Billing user
Connections 42
- Billing user → Sign in: signs in
README.md - Billing user → Billing screens: uses billing UI
README.md - Billing user → Client workspace: manages clients
README.md - Billing user → Location workspace: manages locations
README.md - Billing user → Services tariffs: manages tariffs
README.md - Billing user → Subscriptions: manages subscriptions
README.md - Billing user → Periods: views periods
README.md - Billing user → Statistics: reviews statistics
README.md - Billing user → User administration: administers users
README.md - Client workspace → Client profile: opens profile
- Sign in → API client: uses API
- Billing screens → API client: uses API
- Session handling → API client: uses API
- BillCore server → HTTP router: mounts routes
cmd/server/main.go - HTTP router → Authentication: routes login
internal/api/router.go - HTTP router → JWT access control: guards routes
internal/api/router.go - HTTP router → Client and location API: routes clients
internal/api/router.go - HTTP router → Calculation and reports API: routes calculations
internal/api/router.go - HTTP router → Services API: routes services
internal/api/router.go - HTTP router → Subscription API: routes subscriptions
internal/api/router.go - HTTP router → Period API: routes periods
internal/api/router.go - HTTP router → User administration API: routes users
internal/api/router.go - Authentication → Login and language: authenticates
internal/api/handler/auth_handler.go - JWT access control → Login and language: validates token
internal/api/middleware/auth.go - Login and language → User data: reads and updates
internal/service/auth_service.go - Client and location API → Client and location data: reads and writes
internal/api/handler/client_handler.go - Calculation and reports API → Calculation data: reads and writes
internal/api/handler/calculation_handler.go - Calculation and reports API → Financial reporting: requests reports
- Services API → Service and tariff data: reads and writes
internal/api/handler/service_handler.go - Subscription API → Subscription data: reads and writes
internal/api/handler/subscription_handler.go - User administration API → User data: reads and writes
internal/api/handler/user_handler.go - Period API → Period generation: delegates period work
- Period generation → Period data: uses period data
- Period generation → Service and tariff data: uses tariff data
- Period generation → PostgreSQL: generates calculations
internal/service/period_service.go - Financial reporting → PostgreSQL: queries report views
internal/service/report_service.go - Client and location data → PostgreSQL: queries and mutates
internal/repository/client_repo.go - Calculation data → PostgreSQL: queries and mutates
- Service and tariff data → PostgreSQL: queries and mutates
internal/repository/service_repo.go - Subscription data → PostgreSQL: queries and mutates
- User data → PostgreSQL: queries and mutates
- Period data → PostgreSQL: queries and mutates