https://github.com/spy16/forge
Where the apps are forged! 🔥
https://github.com/spy16/forge
authentication fullstack golang saas-boilerplate
Last synced: 5 months ago
JSON representation
Where the apps are forged! 🔥
- Host: GitHub
- URL: https://github.com/spy16/forge
- Owner: spy16
- License: mit
- Created: 2023-02-23T13:44:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T18:54:51.000Z (over 2 years ago)
- Last Synced: 2025-04-06T19:39:03.392Z (10 months ago)
- Topics: authentication, fullstack, golang, saas-boilerplate
- Language: Go
- Homepage:
- Size: 156 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> WIP
# 🔥 Forge
A Go library/tool for building backend for fullstack apps.
## Usage
Forge can be used either directly as a tool or as a library.
### As a tool
1. Download & unpack a Go release from [releases](https://github.com/spy16/forge/releases) section.
2. Tune the `forge.yml` file as per your needs.
3. Run `./forge serve -c forge.yml`
> If you have frontend build, use `--static=./ui` to serve as static files.
### As a library [Goal]
```golang
package main
import (
"github.com/gin-gonic/gin"
"github.com/spy16/forge"
"github.com/spy16/forge/builtins/firebase"
"github.com/spy16/forge/core"
)
func main() {
cli := forge.CLI("myapp",
forge.WithAuth(&firebase.Auth{
ProjectID: "foo",
}),
forge.WithPostHook(func(app core.App, conf core.ConfigLoader) error {
r := app.Chi()
r.Use(app.Authenticate())
r.Get("/api/my-endpoint", func(w http.ResponseWriter, r *http.Request) {
// Only accessible with firebase auth token
})
return nil
}),
)
_ = cli.Execute()
}
```