mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
feat(core): consolidate auth service into backend and implement stripe billing
This commit performs a major architectural refactor by migrating the standalone `auth-service` into the main `backend` application, enabling a unified codebase and simplified deployment. It also introduces comprehensive Stripe billing support and a new administrative dashboard.
Key changes:
- **Architecture**: Deleted `apps/auth-service` and integrated its functionality (JWT, magic links, OAuth, user management) into `apps/backend`.
- **Billing**: Added Stripe integration to `backend`, supporting both monthly and yearly subscription cycles with automatic plan entitlement enforcement (e.g., location limits).
- **Admin Dashboard**: Implemented a new administrative service and API endpoints to manage tenants, users, and view platform-wide statistics.
- **Frontend**:
- Added a new pricing page with monthly/yearly toggle and comparison table.
- Integrated Stripe and Sentry for payments and error tracking.
- Improved dashboard UX/UI and added i18n support for new features.
- Enhanced the public booking flow with better validation and contact form integration.
- **Database**: Added migrations for users, magic links, password resets, OAuth states, admin audit logs, and refresh tokens.
- **DevOps**: Updated environment configurations for Railway and Vercel, and streamlined the project's `package.json` scripts.
This commit is contained in:
@@ -11,14 +11,37 @@ import (
|
||||
"bookra/apps/backend/internal/api"
|
||||
"bookra/apps/backend/internal/config"
|
||||
"bookra/apps/backend/internal/db"
|
||||
|
||||
sentry "github.com/getsentry/sentry-go"
|
||||
)
|
||||
|
||||
func initSentry(cfg config.Config) {
|
||||
if cfg.SentryDSN == "" {
|
||||
log.Println("Sentry DSN not configured - skipping initialization")
|
||||
return
|
||||
}
|
||||
|
||||
err := sentry.Init(sentry.ClientOptions{
|
||||
Dsn: cfg.SentryDSN,
|
||||
Environment: cfg.Environment,
|
||||
Release: "bookra@1.0.0",
|
||||
// Set TracesSampleRate to 1.0 to capture 100% of transactions for testing
|
||||
TracesSampleRate: 1.0,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Sentry initialization failed: %v", err)
|
||||
}
|
||||
log.Println("Sentry initialized")
|
||||
}
|
||||
|
||||
func main() {
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
log.Fatalf("load config: %v", err)
|
||||
}
|
||||
|
||||
initSentry(cfg)
|
||||
|
||||
pools, err := db.NewPools(cfg)
|
||||
if err != nil {
|
||||
log.Fatalf("create database pools: %v", err)
|
||||
@@ -31,6 +54,9 @@ func main() {
|
||||
}
|
||||
defer server.Close()
|
||||
|
||||
// Start background job for trial ending emails
|
||||
go server.StartBackgroundJobs()
|
||||
|
||||
httpServer := &http.Server{
|
||||
Addr: ":" + cfg.Port,
|
||||
Handler: server.Handler(),
|
||||
|
||||
Reference in New Issue
Block a user