Compare commits

..

18 Commits

45 changed files with 263 additions and 107 deletions
+26 -15
View File
@@ -7,15 +7,13 @@ import (
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"time"
"github.com/alexedwards/scs/v2"
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )
func handler(writer http.ResponseWriter, request *http.Request) { var sessionManager *scs.SessionManager
templ := template.Must(template.ParseFiles("./web/dist/index.html"))
templ.Execute(writer, nil)
}
func main() { func main() {
err := godotenv.Load() err := godotenv.Load()
@@ -23,20 +21,27 @@ func main() {
log.Fatal("Error loading .env file") log.Fatal("Error loading .env file")
} }
// handle authentication
sessionManager = scs.New()
sessionManager.Lifetime = 24 * time.Hour
// handle frontend views
webDir := "./web/dist" webDir := "./web/dist"
fs := http.FileServer(http.Dir(webDir)) fs := http.FileServer(http.Dir(webDir))
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) { http.Handle("/", sessionManager.LoadAndSave(
if request.URL.Path != "/" { http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
path := filepath.Join(webDir, filepath.Clean(request.URL.Path)) if request.URL.Path != "/" {
_, err := os.Stat(path) path := filepath.Join(webDir, filepath.Clean(request.URL.Path))
if err == nil { _, err := os.Stat(path)
fs.ServeHTTP(writer, request) if err == nil {
return fs.ServeHTTP(writer, request)
return
}
} }
} handler(writer, request)
handler(writer, request) }),
}) ))
port := os.Getenv("HTTP_PORT") port := os.Getenv("HTTP_PORT")
if port == "" { if port == "" {
@@ -48,3 +53,9 @@ func main() {
log.Fatalf("server error: %v", err) log.Fatalf("server error: %v", err)
} }
} }
func handler(writer http.ResponseWriter, request *http.Request) {
templ := template.Must(template.ParseFiles("./web/dist/index.html"))
templ.Execute(writer, nil)
}
+5 -1
View File
@@ -2,4 +2,8 @@ module solopm.com/solopm-server
go 1.26.3 go 1.26.3
require github.com/joho/godotenv v1.5.1 // indirect require (
github.com/alexedwards/scs/v2 v2.9.0 // indirect
github.com/golang-migrate/migrate/v4 v4.19.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
)
+4
View File
@@ -1,2 +1,6 @@
github.com/alexedwards/scs/v2 v2.9.0 h1:xa05mVpwTBm1iLeTMNFfAWpKUm4fXAW7CeAViqBVS90=
github.com/alexedwards/scs/v2 v2.9.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
github.com/golang-migrate/migrate/v4 v4.19.1 h1:OCyb44lFuQfYXYLx1SCxPZQGU7mcaZ7gH9yH4jSFbBA=
github.com/golang-migrate/migrate/v4 v4.19.1/go.mod h1:CTcgfjxhaUtsLipnLoQRWCrjYXycRz/g5+RWDuYgPrE=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
+35
View File
@@ -0,0 +1,35 @@
package db
import (
"database/sql",
"log"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/sqlite3"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/mattn/go-sqlite3"
)
func main() {
db, err := sql.Open("sqlite3", "database.sqlite")
if err != nil {
log.Fatal(err)
}
defer db.Close()
driver, err := sqlite3.WithInstance(db, &sqlite3.Config{})
if err != nil {
log.Fatal(err)
}
migrator, err := migrate.NewWithDatabaseInstance(
"file://migrations/", "sqlite3", driver
)
if err != nil {
log.Fatal(err)
}
if err := migrator.Up(); err != nill && err != migrate.ErrNoChange {
log.Fatal(err)
}
}
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_00_00_000000_create_audit_log_table.sql.down.sql
-- DROP TABLE "audit_log" --------------------------------------
DROP TABLE IF EXISTS "audit_log";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_00_00_000000_create_audit_log_table.sql -- internal/db/migrations/2026_00_00_000000_create_audit_log_table.sql.up.sql
-- CREATE TABLE "audit_log" ------------------------------------ -- CREATE TABLE "audit_log" ------------------------------------
CREATE TABLE IF NOT EXISTS "audit_log" ( CREATE TABLE IF NOT EXISTS "audit_log" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000000_create_users_table.sql.down.sql
-- DROP TABLE "users" ------------------------------------------
DROP TABLE IF EXISTS "users";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000000_create_users_table.sql -- internal/db/migrations/2026_01_01_000000_create_users_table.sql.up.sql
-- CREATE TABLE "users" ---------------------------------------- -- CREATE TABLE "users" ----------------------------------------
CREATE TABLE IF NOT EXISTS "users" ( CREATE TABLE IF NOT EXISTS "users" (
@@ -15,25 +15,29 @@ CREATE TABLE IF NOT EXISTS "users" (
"updated_at" DateTime, "updated_at" DateTime,
"deleted_at" DateTime, "deleted_at" DateTime,
CONSTRAINT "unique_username" UNIQUE ( username ), CONSTRAINT "unique_username" UNIQUE ( username ),
CONSTRAINT "unique_email" UNIQUE ( email ) ); CONSTRAINT "unique_email" UNIQUE ( email )
);
-- ------------------------------------------------------------- -- -------------------------------------------------------------
-- CREATE INDEX "idx_users_provider" --------------------------- -- CREATE INDEX "idx_users_provider" ---------------------------
CREATE UNIQUE INDEX IF NOT EXISTS "idx_users_provider" CREATE UNIQUE INDEX IF NOT EXISTS "idx_users_provider"
ON "users"( "provider", "provider_id" ) ON "users"( "provider", "provider_id" )
WHERE "provider_id" IS NOT NULL; WHERE "provider_id" IS NOT NULL
;
-- ------------------------------------------------------------- -- -------------------------------------------------------------
-- INSERT "SYSTEM" USER ---------------------------------------- -- INSERT "SYSTEM" USER ----------------------------------------
INSERT INTO `users` INSERT INTO users
(`username`,`is_admin`,`name`,`email`,`avatar_url`) (username,is_admin,name,email,avatar_url)
VALUES VALUES
("system", true, "System User", "system@localhost", "") ('system', true, 'System User', 'system@localhost', '/uploads/avatars/system.png')
;
-- ------------------------------------------------------------- -- -------------------------------------------------------------
-- INSERT "ZOMBIE" USER ---------------------------------------- -- INSERT "ZOMBIE" USER ----------------------------------------
INSERT INTO `users` INSERT INTO users
(`username`,`is_admin`,`name`,`email`,`avatar_url`) (username,is_admin,name,email,avatar_url)
VALUES VALUES
("zombie", false, "Zombie", "zombie@localhost", "") ('zombie', false, 'Zombie', 'zombie@localhost', '/uploads/avatars/zombie.png')
;
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000010_create_projects_table.sql.down.sql
-- DROP TABLE "projects" ---------------------------------------
DROP TABLE IF EXISTS "projects";
-- -------------------------------------------------------------
@@ -1,6 +1,6 @@
-- internal/db/migrations/2026_01_01_000010_create_projects_table.sql -- internal/db/migrations/2026_01_01_000010_create_projects_table.sql.up.sql
-- CREATE TABLE "projects" ------------------------------------ -- CREATE TABLE "projects" -------------------------------------
CREATE TABLE IF NOT EXISTS "projects"( CREATE TABLE IF NOT EXISTS "projects"(
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT, "id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"creator_id" Integer NOT NULL REFERENCES "users"("id"), "creator_id" Integer NOT NULL REFERENCES "users"("id"),
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000011_create_project_user_table.sql.down.sql
-- DROP TABLE "project_user" -----------------------------------
DROP TABLE IF EXISTS "project_user";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000011_create_project_user_table.sql -- internal/db/migrations/2026_01_01_000011_create_project_user_table.sql.up.sql
-- CREATE TABLE "project_user" --------------------------------- -- CREATE TABLE "project_user" ---------------------------------
CREATE TABLE IF NOT EXISTS "project_user" ( CREATE TABLE IF NOT EXISTS "project_user" (
@@ -8,5 +8,6 @@ CREATE TABLE IF NOT EXISTS "project_user" (
"role" Text NOT NULL DEFAULT 'member', "role" Text NOT NULL DEFAULT 'member',
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP, "created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime, "deleted_at" DateTime,
CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id ) ); CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id )
);
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000011_create_project_labels_table.sql.down.sql
-- DROP TABLE "project_labels" ---------------------------------
DROP TABLE IF EXISTS "project_labels";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000011_create_project_labels_table.sql -- internal/db/migrations/2026_01_01_000011_create_project_labels_table.sql.up.sql
-- CREATE TABLE "project_labels" ------------------------------- -- CREATE TABLE "project_labels" -------------------------------
CREATE TABLE IF NOT EXISTS "project_labels" ( CREATE TABLE IF NOT EXISTS "project_labels" (
@@ -9,5 +9,6 @@ CREATE TABLE IF NOT EXISTS "project_labels" (
"color" Text NOT NULL DEFAULT '#42f5ce', "color" Text NOT NULL DEFAULT '#42f5ce',
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP, "created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime, "deleted_at" DateTime,
CONSTRAINT "idx_project_labels" UNIQUE ( project_id, label ) ); CONSTRAINT "idx_project_labels" UNIQUE ( project_id, label )
);
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000013_create_project_links_table.sql.down.sql
-- DROP TABLE "project_links" ----------------------------------
DROP TABLE IF EXISTS "project_links";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000013_create_project_links_table.sql -- internal/db/migrations/2026_01_01_000013_create_project_links_table.sql.up.sql
-- CREATE TABLE "project_links" -------------------------------- -- CREATE TABLE "project_links" --------------------------------
CREATE TABLE IF NOT EXISTS "project_links" ( CREATE TABLE IF NOT EXISTS "project_links" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000014_create_project_attachments_table.sql.down.sql
-- DROP TABLE "project_attachments" ----------------------------
DROP TABLE IF EXISTS "project_attachments";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000014_create_project_attachments_table.sql -- internal/db/migrations/2026_01_01_000014_create_project_attachments_table.sql.up.sql
-- CREATE TABLE "project_attachments" -------------------------- -- CREATE TABLE "project_attachments" --------------------------
CREATE TABLE IF NOT EXISTS "project_attachments" ( CREATE TABLE IF NOT EXISTS "project_attachments" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000015_create_project_favorites_table.sql.down.sql
-- DROP TABLE "project_favorites" ------------------------------
DROP TABLE IF EXISTS "project_favorites";
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000015_create_project_favorites_table.sql -- internal/db/migrations/2026_01_01_000015_create_project_favorites_table.sql.up.sql
-- CREATE TABLE "project_favorites" ---------------------------- -- CREATE TABLE "project_favorites" ----------------------------
CREATE TABLE IF NOT EXISTS "project_favorites" ( CREATE TABLE IF NOT EXISTS "project_favorites" (
@@ -7,6 +7,7 @@ CREATE TABLE IF NOT EXISTS "project_favorites" (
"user_id" Integer NOT NULL REFERENCES "users"("id"), "user_id" Integer NOT NULL REFERENCES "users"("id"),
"favorited_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP, "favorited_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime, "deleted_at" DateTime,
CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id ) ); CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id )
);
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_00_000007_create_project_dependencies_table.sql.down.sql
-- DROP TABLE "project_dependencies" -----------------------------
DROP TABLE IF EXISTS "project_dependencies";
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_00_000007_create_project_dependencies_table.sql -- internal/db/migrations/2026_01_00_000007_create_project_dependencies_table.sql.up.sql
-- CREATE TABLE "project_dependencies" ----------------------------- -- CREATE TABLE "project_dependencies" -----------------------------
CREATE TABLE IF NOT EXISTS "project_dependencies" ( CREATE TABLE IF NOT EXISTS "project_dependencies" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000020_create_issues_table.sql.down.sql
-- DROP TABLE "issues" -----------------------------------------
DROP TABLE IF EXISTS "issues";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000020_create_issues_table.sql -- internal/db/migrations/2026_01_01_000020_create_issues_table.sql.up.sql
-- CREATE TABLE "issues" --------------------------------------- -- CREATE TABLE "issues" ---------------------------------------
CREATE TABLE IF NOT EXISTS "issues" ( CREATE TABLE IF NOT EXISTS "issues" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000021_create_issue_labels_table.sql.down.sql
-- DROP TABLE "issue_labels" -----------------------------------
DROP TABLE IF EXISTS "issue_labels";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000021_create_issue_labels_table.sql -- internal/db/migrations/2026_01_01_000021_create_issue_labels_table.sql.up.sql
-- CREATE TABLE "issue_labels" --------------------------------- -- CREATE TABLE "issue_labels" ---------------------------------
CREATE TABLE IF NOT EXISTS "issue_labels" ( CREATE TABLE IF NOT EXISTS "issue_labels" (
@@ -8,5 +8,6 @@ CREATE TABLE IF NOT EXISTS "issue_labels" (
"user_id" Integer NOT NULL REFERENCES "users"("id"), "user_id" Integer NOT NULL REFERENCES "users"("id"),
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP, "created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime, "deleted_at" DateTime,
CONSTRAINT "idx_issue_labels" UNIQUE ( issue_id, project_label_id ) ); CONSTRAINT "idx_issue_labels" UNIQUE ( issue_id, project_label_id )
);
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000022_create_issue_links_table.sql.down.sql
-- DROP TABLE "issue_links" ------------------------------------
DROP TABLE IF EXISTS "issue_links";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000022_create_issue_links_table.sql -- internal/db/migrations/2026_01_01_000022_create_issue_links_table.sql.up.sql
-- CREATE TABLE "issue_links" ---------------------------------- -- CREATE TABLE "issue_links" ----------------------------------
CREATE TABLE IF NOT EXISTS "issue_links" ( CREATE TABLE IF NOT EXISTS "issue_links" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000023_create_issue_attachments_table.sql.down.sql
-- DROP TABLE "issue_attachments" ------------------------------
DROP TABLE IF EXISTS "issue_attachments";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000023_create_issue_attachments_table.sql -- internal/db/migrations/2026_01_01_000023_create_issue_attachments_table.sql.up.sql
-- CREATE TABLE "issue_attachments" ---------------------------- -- CREATE TABLE "issue_attachments" ----------------------------
CREATE TABLE IF NOT EXISTS "issue_attachments" ( CREATE TABLE IF NOT EXISTS "issue_attachments" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000005_create_issue_blockers_table.sql.down.sql
-- DROP TABLE "issue_blockers" ---------------------------------
DROP TABLE IF EXISTS "issue_blockers";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000005_create_issue_blockers_table.sql -- internal/db/migrations/2026_01_01_000005_create_issue_blockers_table.sql.up.sql
-- CREATE TABLE "issue_blockers" ------------------------------- -- CREATE TABLE "issue_blockers" -------------------------------
CREATE TABLE IF NOT EXISTS "issue_blockers" ( CREATE TABLE IF NOT EXISTS "issue_blockers" (
@@ -8,4 +8,3 @@ CREATE TABLE IF NOT EXISTS "issue_blockers" (
CONSTRAINT "idx_blocking_issue" UNIQUE ( source_issue_id, blocking_issue_id ) CONSTRAINT "idx_blocking_issue" UNIQUE ( source_issue_id, blocking_issue_id )
); );
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000024_create_issue_comments_table.sql.down.sql
-- DROP TABLE "issue_comments" ---------------------------------
DROP TABLE IF EXISTS "issue_comments";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000024_create_issue_comments_table.sql -- internal/db/migrations/2026_01_01_000024_create_issue_comments_table.sql.up.sql
-- CREATE TABLE "issue_comments" ------------------------------- -- CREATE TABLE "issue_comments" -------------------------------
CREATE TABLE IF NOT EXISTS "issue_comments" ( CREATE TABLE IF NOT EXISTS "issue_comments" (
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000106_create_issue_comment_links_table.sql.down.sql
-- DROP TABLE "issue_comment_links" ----------------------------
DROP TABLE IF EXISTS "issue_comment_links";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000106_create_issue_comment_links_table.sql -- internal/db/migrations/2026_01_01_000106_create_issue_comment_links_table.sql.up.sql
-- CREATE TABLE "issue_comment_links" -------------------------- -- CREATE TABLE "issue_comment_links" --------------------------
CREATE TABLE IF NOT EXISTS "issue_comment_links" ( CREATE TABLE IF NOT EXISTS "issue_comment_links" (
@@ -10,4 +10,3 @@ CREATE TABLE IF NOT EXISTS "issue_comment_links" (
"deleted_at" DateTime "deleted_at" DateTime
); );
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_01_000107_create_issue_comment_attachments_table.sql.down.sql
-- DROP TABLE "issue_comment_attachments" --------------------------
DROP TABLE IF EXISTS "issue_comment_attachments";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_01_000107_create_issue_comment_attachments_table.sql -- internal/db/migrations/2026_01_01_000107_create_issue_comment_attachments_table.sql.up.sql
-- CREATE TABLE "issue_comment_attachments" -------------------------- -- CREATE TABLE "issue_comment_attachments" --------------------------
CREATE TABLE IF NOT EXISTS "issue_comment_attachments" ( CREATE TABLE IF NOT EXISTS "issue_comment_attachments" (
@@ -13,4 +13,3 @@ CREATE TABLE IF NOT EXISTS "issue_comment_attachments" (
"deleted_at" DateTime "deleted_at" DateTime
); );
-- ------------------------------------------------------------- -- -------------------------------------------------------------
@@ -0,0 +1,5 @@
-- internal/db/migrations/2026_01_02_000001_create_webhook_receipts_table.sql.down.sql
-- DROP TABLE "webhook_receipts" -------------------------------
DROP TABLE IF EXISTS "webhook_receipts";
-- -------------------------------------------------------------
@@ -1,4 +1,4 @@
-- internal/db/migrations/2026_01_02_000001_create_webhook_receipts_table.sql -- internal/db/migrations/2026_01_02_000001_create_webhook_receipts_table.sql.up.sql
-- CREATE TABLE "webhook_receipts" ------------------------------- -- CREATE TABLE "webhook_receipts" -------------------------------
CREATE TABLE IF NOT EXISTS "webhook_receipts" ( CREATE TABLE IF NOT EXISTS "webhook_receipts" (
@@ -13,4 +13,3 @@ CREATE TABLE IF NOT EXISTS "webhook_receipts" (
CONSTRAINT "unique_delivery_id" UNIQUE ( delivery_id ) CONSTRAINT "unique_delivery_id" UNIQUE ( delivery_id )
); );
-- ------------------------------------------------------------- -- -------------------------------------------------------------
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
DB_NAME="database.sqlite"
if [ -z "$1" ]; then
echo "You need to tell me up or down"
exit 1
fi
if [[ "$1" == "up" ]]; then
rm -f "$DB_NAME"
touch "$DB_NAME"
for file in migrations/*.up.sql; do
echo "Executing $file..."
sqlite3 "$DB_NAME" < "$file"
done
fi
if [[ "$1" == "down" ]]; then
for file in migrations/*.down.sql; do
echo "Executing $file..."
sqlite3 "$DB_NAME" < "$file"
done
fi
+4 -4
View File
@@ -546,8 +546,8 @@ packages:
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
electron-to-chromium@1.5.359: electron-to-chromium@1.5.360:
resolution: {integrity: sha512-8lPELWuYZIWk7NDvCNthtmMw/7Q5Wu25NpM4djFMHBmk8DubPAtL4YTOp7ou0e7HyJtwkVlWv8XMLURnrtgJQw==} resolution: {integrity: sha512-GkcBt6YYAw9SxFWn+xVar4cLVGlXVuswwtRLBozi2zp0GjXs4ZnOrqV4zbXzg35n7w81hCkyJNYicgXlVHAmBA==}
entities@7.0.1: entities@7.0.1:
resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==}
@@ -1316,7 +1316,7 @@ snapshots:
dependencies: dependencies:
baseline-browser-mapping: 2.10.31 baseline-browser-mapping: 2.10.31
caniuse-lite: 1.0.30001793 caniuse-lite: 1.0.30001793
electron-to-chromium: 1.5.359 electron-to-chromium: 1.5.360
node-releases: 2.0.44 node-releases: 2.0.44
update-browserslist-db: 1.2.3(browserslist@4.28.2) update-browserslist-db: 1.2.3(browserslist@4.28.2)
@@ -1369,7 +1369,7 @@ snapshots:
es-errors: 1.3.0 es-errors: 1.3.0
gopd: 1.2.0 gopd: 1.2.0
electron-to-chromium@1.5.359: {} electron-to-chromium@1.5.360: {}
entities@7.0.1: {} entities@7.0.1: {}
+4 -3
View File
@@ -4,11 +4,12 @@
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="flex flex-wrap pt-1 mr-12 bg-transparent rounded-lg sm:mr-16"> <ol class="flex flex-wrap pt-1 mr-12 bg-transparent rounded-lg sm:mr-16">
<li class="text-sm leading-normal"> <li v-if="title !== 'Dashboard'" class="text-sm leading-normal">
<RouterLink class="opacity-50 text-slate-700" to="/">Pages</RouterLink> <RouterLink class="opacity-50 text-slate-700" to="/dashboard">Dashboard</RouterLink>
</li> </li>
<li <li
class="text-sm pl-2 capitalize leading-normal text-slate-700 before:float-left before:pr-2 before:content-['/']" class="text-sm capitalize leading-normal text-slate-700"
:class="title !== 'Dashboard' ? 'pl-2 before:float-left before:pr-2 before:content-[\'/\']' : ''"
aria-current="page" aria-current="page"
> >
{{ title }} {{ title }}
-17
View File
@@ -66,23 +66,6 @@
</ul> </ul>
</div> </div>
<div class="mx-4 mt-4">
<div class="relative flex min-w-0 flex-col items-center break-words rounded-2xl border-0 bg-white bg-clip-border shadow-none">
<div class="mb-7.5 h-28 w-full overflow-hidden rounded-xl">
<div class="bg-gradient-to-tl from-slate-600 to-slate-300 h-full w-full"></div>
</div>
<div class="-mt-14 w-3/4 text-center">
<p class="mt-0 mb-4 font-semibold leading-tight text-xs">Need help?</p>
<a
href="#"
class="inline-block w-full px-8 py-2 mb-4 font-bold text-center text-black uppercase transition-all ease-in bg-white border-0 rounded-lg shadow-soft-md bg-150 leading-pro text-xs hover:shadow-soft-2xl hover:scale-102"
>
Documentation
</a>
</div>
</div>
</div>
</aside> </aside>
</template> </template>
+32 -32
View File
@@ -8,25 +8,7 @@
<div class="flex-auto p-4"> <div class="flex-auto p-4">
<div class="flex flex-row -mx-3"> <div class="flex flex-row -mx-3">
<div class="flex-none w-2/3 max-w-full px-3"> <div class="flex-none w-2/3 max-w-full px-3">
<p class="mb-0 font-sans font-semibold leading-normal text-sm">Projects</p> <p class="mb-0 font-sans font-semibold leading-normal text-sm">Open Issues</p>
<h5 class="mb-0 font-bold"></h5>
</div>
<div class="px-3 text-right basis-1/3">
<div class="inline-flex w-12 h-12 text-center rounded-lg items-center justify-center bg-gradient-to-tl from-purple-700 to-pink-500 shadow-soft-2xl">
<i class="fas fa-layer-group text-white text-lg relative"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="w-full max-w-full px-3 mb-6 sm:w-1/2 sm:flex-none xl:mb-0 xl:w-1/4">
<div class="relative flex flex-col min-w-0 break-words bg-white shadow-soft-xl rounded-2xl bg-clip-border">
<div class="flex-auto p-4">
<div class="flex flex-row -mx-3">
<div class="flex-none w-2/3 max-w-full px-3">
<p class="mb-0 font-sans font-semibold leading-normal text-sm">Open Tasks</p>
<h5 class="mb-0 font-bold"></h5> <h5 class="mb-0 font-bold"></h5>
</div> </div>
<div class="px-3 text-right basis-1/3"> <div class="px-3 text-right basis-1/3">
@@ -75,23 +57,29 @@
</div> </div>
</div> </div>
</div> <div class="w-full max-w-full px-3 mb-6 sm:w-1/2 sm:flex-none xl:mb-0 xl:w-1/4">
<div class="relative flex flex-col min-w-0 break-words bg-white shadow-soft-xl rounded-2xl bg-clip-border">
<div class="flex flex-wrap mt-6 -mx-3"> <div class="flex-auto p-4">
<div class="flex flex-row -mx-3">
<div class="w-full max-w-full px-3 mt-0 lg:w-7/12 lg:flex-none"> <div class="flex-none w-2/3 max-w-full px-3">
<div class="relative flex flex-col min-w-0 break-words bg-white border-0 shadow-soft-xl rounded-2xl bg-clip-border"> <p class="mb-0 font-sans font-semibold leading-normal text-sm">Projects</p>
<div class="border-black/12.5 rounded-t-2xl border-b-0 border-solid p-6 pb-0"> <h5 class="mb-0 font-bold"></h5>
<h6 class="capitalize">Recent Projects</h6> </div>
<p class="text-sm leading-normal">Your active projects</p> <div class="px-3 text-right basis-1/3">
</div> <div class="inline-flex w-12 h-12 text-center rounded-lg items-center justify-center bg-gradient-to-tl from-purple-700 to-pink-500 shadow-soft-2xl">
<div class="flex-auto p-6 pt-4"> <i class="fas fa-layer-group text-white text-lg relative"></i>
<p class="text-sm text-slate-500 text-center py-8">No projects yet.</p> </div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="w-full max-w-full px-3 mt-4 lg:w-5/12 lg:flex-none lg:mt-0"> </div>
<div class="flex flex-wrap mt-6 -mx-3">
<div class="w-full max-w-full px-3 mt-4 lg:w-7/12 lg:flex-none lg:mt-0">
<div class="relative flex flex-col min-w-0 break-words bg-white border-0 shadow-soft-xl rounded-2xl bg-clip-border"> <div class="relative flex flex-col min-w-0 break-words bg-white border-0 shadow-soft-xl rounded-2xl bg-clip-border">
<div class="border-black/12.5 rounded-t-2xl border-b-0 border-solid p-6 pb-0"> <div class="border-black/12.5 rounded-t-2xl border-b-0 border-solid p-6 pb-0">
<h6 class="capitalize">Activity</h6> <h6 class="capitalize">Activity</h6>
@@ -103,6 +91,18 @@
</div> </div>
</div> </div>
<div class="w-full max-w-full px-3 mt-0 lg:w-5/12 lg:flex-none">
<div class="relative flex flex-col min-w-0 break-words bg-white border-0 shadow-soft-xl rounded-2xl bg-clip-border">
<div class="border-black/12.5 rounded-t-2xl border-b-0 border-solid p-6 pb-0">
<h6 class="capitalize">Recent Projects</h6>
<p class="text-sm leading-normal">Your active projects</p>
</div>
<div class="flex-auto p-6 pt-4">
<p class="text-sm text-slate-500 text-center py-8">No projects yet.</p>
</div>
</div>
</div>
</div> </div>
</AppLayout> </AppLayout>