feature: remove sidebar & redesign top navbar

This commit is contained in:
Jordan Knott
2020-06-23 15:20:53 -05:00
parent fd7c006b73
commit 57382de9d0
78 changed files with 4124 additions and 465 deletions

View File

@ -1,10 +1,10 @@
package main
import (
_ "github.com/lib/pq"
"fmt"
_ "github.com/lib/pq"
"net/http"
"time"
"github.com/jmoiron/sqlx"
"github.com/jordanknott/project-citadel/api/router"
@ -20,6 +20,10 @@ func main() {
if err != nil {
log.Panic(err)
}
db.SetMaxOpenConns(25)
db.SetMaxIdleConns(25)
db.SetConnMaxLifetime(5 * time.Minute)
defer db.Close()
fmt.Println("starting graphql server on http://localhost:3333")
fmt.Println("starting graphql playground on http://localhost:3333/__graphql")

View File

@ -1,16 +1,16 @@
package main
import (
"context"
"fmt"
"io/ioutil"
// "context"
// "fmt"
// "io/ioutil"
"github.com/jordan-wright/email"
_ "github.com/lib/pq"
"github.com/jmoiron/sqlx"
"github.com/jordanknott/project-citadel/api/pg"
"github.com/BurntSushi/toml"
"net/smtp"
// "github.com/jmoiron/sqlx"
// "github.com/jordanknott/project-citadel/api/pg"
// "github.com/BurntSushi/toml"
// "github.com/jordanknott/project-citadel/api/router"
// "time"
)
@ -26,6 +26,14 @@ type colors struct {
}
func main() {
e := email.NewEmail()
e.From = "Jordan Knott <no-reply@citadel.com>"
e.To = []string{"jordan@jordanthedev.com"}
e.Subject = "Jordan Knott (@jordanthedev) invited you to join the team \"Paradox\" on Citadel"
e.Text = []byte("Text Body is, of course, supported!")
e.HTML = []byte("<h1>Fancy HTML is supported, too!</h1>")
e.Send("localhost:1025", smtp.PlainAuth("", "test@gmail.com", "password123", "localhost"))
// dur := time.Hour * 24 * 7 * 30
// token, err := router.NewAccessTokenCustomExpiration("21345076-6423-4a00-a6bd-cd9f830e2764", dur)
// if err != nil {
@ -33,23 +41,23 @@ func main() {
// }
// fmt.Println(token)
fmt.Println("seeding database...")
// fmt.Println("seeding database...")
dat, err := ioutil.ReadFile("data/colors.toml")
if err != nil {
panic(err)
}
// dat, err := ioutil.ReadFile("data/colors.toml")
// if err != nil {
// panic(err)
// }
var labelColors colors
_, err = toml.Decode(string(dat), &labelColors)
if err != nil {
panic(err)
}
db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable")
repository := pg.NewRepository(db)
for _, color := range labelColors.Color {
fmt.Printf("%v\n", color)
repository.CreateLabelColor(context.Background(), pg.CreateLabelColorParams{color.Name, color.Color, float64(color.Position)})
}
// var labelColors colors
// _, err = toml.Decode(string(dat), &labelColors)
// if err != nil {
// panic(err)
// }
// db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable")
// repository := pg.NewRepository(db)
// for _, color := range labelColors.Color {
// fmt.Printf("%v\n", color)
// repository.CreateLabelColor(context.Background(), pg.CreateLabelColorParams{color.Name, color.Color, float64(color.Position)})
// }
}