Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions cmd/fireback/app.go

This file was deleted.

69 changes: 69 additions & 0 deletions cmd/fireback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,77 @@ package main

import (
"os"

"github.com/gin-gonic/gin"
"github.com/torabian/fireback/modules/abac"

"github.com/torabian/fireback/modules/fireback"
FBManage "github.com/torabian/fireback/modules/fireback/codegen/fireback-manage"
FbSelfService "github.com/torabian/fireback/modules/fireback/codegen/selfservice"
"github.com/torabian/fireback/modules/payment"
"github.com/torabian/fireback/modules/suggestion"

"github.com/urfave/cli"
)

var PRODUCT_NAMESPACENAME = "fireback"
var PRODUCT_DESCRIPTION = "Fireback core microservice - v" + fireback.FIREBACK_VERSION
var PRODUCT_LANGUAGES = []string{"fa", "en"}

// Fireback doesn't come with default ui in the cmd anymore.
// Fireback itself has 2 uis: Manage and SelfService.
// Developer needs to build them if necessary and put the static files in workspaces
// Folder. Fireback serves them on /manage and /selfservice, similarly child projects
// Can serve those react projects if they wanted to.
// //go:embed all:ui
// var ui embed.FS

var xapp = &fireback.FirebackApp{
Title: PRODUCT_DESCRIPTION,
SupportedLanguages: PRODUCT_LANGUAGES,
SearchProviders: []fireback.SearchProviderFn{
abac.QueryMenusReact,
abac.QueryRolesReact,
},
SeedersSync: func() {
abac.PassportMethodSyncSeeders()
abac.AppMenuSyncSeeders()
},

InjectSearchEndpoint: fireback.InjectReactiveSearch,
PublicFolders: []fireback.PublicFolderInfo{
// You can set a series of static folders to be served along with fireback.
// This is only for static content. For advanced MVX render templates, you need to
// Bootstrap those themes
// Add these two lines on the top of the file
/////go:embed all:ui
// var ui embed.FS
// and then uncomment this, for example to serve static react or angular content

// //go:embed all:selfservice
// var selfservice embed.FS
{Fs: &FBManage.FirebackManageTmpl, Folder: ".", Prefix: "/manage"},
{Fs: &FbSelfService.FbSelfService, Folder: ".", Prefix: "/selfservice"},
},
SetupWebServerHook: func(e *gin.Engine, xs *fireback.FirebackApp) {

},
Modules: append([]*fireback.ModuleProvider{
// Add the very core module, such as capabilities
fireback.FirebackModuleSetup(nil),

// Add fireback payment module also
payment.PaymentModuleSetup(nil),

suggestion.SuggestionModuleSetup(nil),
{
CliHandlers: []cli.Command{
fireback.NewProjectCli(),
},
},
}, abac.AbacCompleteModules()...),
}

func main() {

// This is an important setting for some kind of app which will be installed
Expand Down
70 changes: 37 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module github.com/torabian/fireback

go 1.24.2

toolchain go1.24.3
go 1.25.0

require (
github.com/ClickHouse/clickhouse-go/v2 v2.34.0
github.com/ClickHouse/clickhouse-go/v2 v2.43.0
github.com/Rhymond/go-money v1.0.15
github.com/SherClockHolmes/webpush-go v1.4.0
github.com/alexeyco/simpletable v1.0.0
Expand All @@ -23,7 +21,7 @@ require (
github.com/gizak/termui/v3 v3.1.0
github.com/glebarez/sqlite v1.11.0
github.com/go-playground/validator/v10 v10.26.0
github.com/go-sql-driver/mysql v1.7.1
github.com/go-sql-driver/mysql v1.9.3
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-querystring v1.1.0
Expand All @@ -44,6 +42,7 @@ require (
github.com/microcosm-cc/bluemonday v1.0.23
github.com/pion/webrtc/v3 v3.3.5
github.com/pquerna/otp v1.4.0
github.com/pressly/goose/v3 v3.27.0
github.com/redis/go-redis/v9 v9.7.3
github.com/robfig/cron v1.2.0
github.com/schollz/progressbar/v3 v3.13.0
Expand All @@ -52,7 +51,7 @@ require (
github.com/sendgrid/sendgrid-go v3.12.0+incompatible
github.com/signintech/gopdf v0.19.0
github.com/stoewer/go-strcase v1.2.1
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/stripe/stripe-go/v82 v82.3.0
github.com/swaggest/openapi-go v0.2.51
github.com/tdewolff/minify v2.3.6+incompatible
Expand All @@ -65,11 +64,11 @@ require (
github.com/wk8/go-ordered-map/v2 v2.1.8
github.com/xeipuuv/gojsonschema v1.2.0
github.com/yaa110/go-persian-calendar v1.1.5
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.39.0
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792
golang.org/x/sync v0.16.0
golang.org/x/text v0.27.0
go.uber.org/zap v1.27.1
golang.org/x/crypto v0.48.0
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa
golang.org/x/sync v0.19.0
golang.org/x/text v0.34.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.5.2
Expand All @@ -79,8 +78,9 @@ require (
)

require (
github.com/ClickHouse/ch-go v0.65.1 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/ClickHouse/ch-go v0.71.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
Expand All @@ -96,12 +96,12 @@ require (
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/glebarez/go-sqlite v1.22.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-faster/city v1.0.1 // indirect
github.com/go-faster/errors v0.7.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
Expand All @@ -117,13 +117,13 @@ require (
github.com/invopop/yaml v0.3.1 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgx/v5 v5.5.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.8.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
Expand All @@ -132,7 +132,8 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -141,14 +142,14 @@ require (
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect
github.com/onsi/gomega v1.20.2 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/paulmach/orb v0.12.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pierrec/lz4/v4 v4.1.25 // indirect
github.com/pion/datachannel v1.5.10 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.37 // indirect
Expand All @@ -166,12 +167,13 @@ require (
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/sethvargo/go-retry v0.3.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/swaggest/jsonschema-go v0.3.70 // indirect
Expand All @@ -185,17 +187,19 @@ require (
github.com/wlynxg/anet v0.0.5 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.18.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
modernc.org/libc v1.66.3 // indirect
golang.org/x/net v0.50.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.40.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
modernc.org/libc v1.68.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.38.0 // indirect
modernc.org/sqlite v1.46.1 // indirect
)
Loading
Loading