added frontend and updated backend with docker, wrote some initial instructions

This commit is contained in:
Elmar Kresse
2023-09-19 21:34:29 +02:00
parent b8a638a5fe
commit c051995823
87 changed files with 4987 additions and 1574 deletions

30
backend/main.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/plugins/migratecmd"
_ "htwk-planner/migrations"
"htwk-planner/service"
"log"
"os"
"strings"
)
func main() {
app := pocketbase.New()
// loosely check if it was executed using "go run"
isGoRun := strings.HasPrefix(os.Args[0], os.TempDir())
migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{
// enable auto creation of migration files when making collection changes in the Admin UI
// (the isGoRun check is to enable it only during development)
Automigrate: isGoRun,
})
service.AddRoutes(app)
if err := app.Start(); err != nil {
log.Fatal(err)
}
}