-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(app): set services placeholder * fix(query): path column is not exist * chore(app): gitignore generated db * feat(app): add ui
- Loading branch information
Showing
24 changed files
with
375 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.env | ||
assets/css/dist.css | ||
node_modules | ||
gen/db/db.go | ||
gen/db/models.go | ||
gen/db/users.sql.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
-- name: CreateUser :exec | ||
insert into users ( | ||
name, path | ||
) values ( | ||
$1, $2 | ||
); | ||
insert into users (name) values ($1); | ||
|
||
-- name: ListUsers :many | ||
select * from users; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package admin | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/gofiber/fiber/v2" | ||
) | ||
|
||
func LoginPage(c *fiber.Ctx) error { | ||
return c.Render("login", fiber.Map{ | ||
"AppName": os.Getenv("APP_NAME"), | ||
"Title": "Login", | ||
}, "layouts/auth") | ||
} | ||
|
||
// func RegisterPage(c *fiber.Ctx) error { | ||
// return c.Render("register", fiber.Map{ | ||
// "AppName": os.Getenv("APP_NAME"), | ||
// "Title": "Register", | ||
// }, "layouts/auth") | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package admin | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/gofiber/fiber/v2" | ||
) | ||
|
||
func DashboardPage(c *fiber.Ctx) error { | ||
return c.Render("dashboard", fiber.Map{ | ||
"AppName": os.Getenv("APP_NAME"), | ||
"Title": "Hello, Dashboard!", | ||
}, "layouts/admin") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package api | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func Ping(c *fiber.Ctx) error { | ||
return c.Status(fiber.StatusOK).JSON(fiber.Map{ | ||
"message": "PONG", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package web | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/gofiber/fiber/v2" | ||
) | ||
|
||
func HomePage(c *fiber.Ctx) error { | ||
return c.Render("home", fiber.Map{ | ||
"AppName": os.Getenv("APP_NAME"), | ||
"Title": "Hello, World!", | ||
}, "layouts/web") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"devDependencies": { | ||
"@tailwindcss/forms": "^0.5.7", | ||
"daisyui": "^4.12.10", | ||
"tailwindcss": "^3.4.10" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<h1 class="text-3xl font-bold underline">{{.Title}}</h1> | ||
<div class="my-4"> | ||
{{template "partials/hero"}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>{{.AppName}}</title> | ||
<link href="assets/css/dist.css" rel="stylesheet"> | ||
<script src="assets/js/htmx.min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="flex"> | ||
<div class="flex-none"> | ||
{{template "partials/drawer"}} | ||
</div> | ||
<div class="flex-1 bg-slate-200 p-4">{{embed}}</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>{{.AppName}}</title> | ||
<link href="assets/css/dist.css" rel="stylesheet"> | ||
<script src="assets/js/htmx.min.js"></script> | ||
</head> | ||
|
||
<body class="bg-slate-200"> | ||
{{template "partials/navbar" .}} | ||
<div class="container mx-auto min-h-screen"> | ||
{{embed}} | ||
</div> | ||
{{template "partials/footer"}} | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<div class="card bg-base-100 w-96 shadow-xl"> | ||
<div class="card-body items-center text-center"> | ||
<h2 class="card-title">{{.Title}}</h2> | ||
|
||
<form hx-post="/admin/login" hx-target="#form-login" hx-swap="outerHTML"> | ||
<div class="form-control my-4"> | ||
<label class="input input-bordered flex items-center gap-2"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" | ||
class="h-4 w-4 opacity-70"> | ||
<path | ||
d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12.735 14c.618 0 1.093-.561.872-1.139a6.002 6.002 0 0 0-11.215 0c-.22.578.254 1.139.872 1.139h9.47Z" /> | ||
</svg> | ||
<input type="text" name="username" class="grow border-none focus:outline-none" | ||
placeholder="Username" /> | ||
</label> | ||
|
||
</div> | ||
<div class="form-control my-4"> | ||
<label class="input input-bordered flex items-center gap-2"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" | ||
class="h-4 w-4 opacity-70"> | ||
<path fill-rule="evenodd" | ||
d="M14 6a4 4 0 0 1-4.899 3.899l-1.955 1.955a.5.5 0 0 1-.353.146H5v1.5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2.293a.5.5 0 0 1 .146-.353l3.955-3.955A4 4 0 1 1 14 6Zm-4-2a.75.75 0 0 0 0 1.5.5.5 0 0 1 .5.5.75.75 0 0 0 1.5 0 2 2 0 0 0-2-2Z" | ||
clip-rule="evenodd" /> | ||
</svg> | ||
<input type="password" name="password" | ||
class="grow border-none focus:outline-none" value="password" /> | ||
</label> | ||
|
||
</div> | ||
|
||
<div class="form-control my-4"> | ||
<button class="btn btn-block" type="submit">Login</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="drawer lg:drawer-open bg-slate-200"> | ||
<input id="my-drawer" type="checkbox" class="drawer-toggle" /> | ||
<div class="drawer-content"> | ||
<label for="my-drawer" class="btn btn-primary drawer-button lg:hidden">Open drawer</label> | ||
</div> | ||
<div class="drawer-side"> | ||
<label for="my-drawer" aria-label="close sidebar" class="drawer-overlay"></label> | ||
<ul class="menu bg-base-200 text-base-content min-h-full w-40 p-4"> | ||
<!-- Sidebar content here --> | ||
<li><a>Sidebar Item 1</a></li> | ||
<li><a>Sidebar Item 2</a></li> | ||
</ul> | ||
</div> | ||
</div> |
Oops, something went wrong.