update information

This commit is contained in:
jc 2024-12-03 01:49:29 -05:00
commit 5bd39081f9
10 changed files with 521 additions and 414 deletions

24
main.go
View file

@ -13,7 +13,7 @@ import (
"time" "time"
// "github.com/jackc/pgx/v5" // "github.com/jackc/pgx/v5"
"github.com/joho/godotenv" // "github.com/joho/godotenv"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware" "github.com/labstack/echo/v4/middleware"
) )
@ -29,34 +29,12 @@ func main() {
// listen to SIGTERM and SIGINT (ctrl-c) // listen to SIGTERM and SIGINT (ctrl-c)
signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT, os.Interrupt) signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT, os.Interrupt)
// Load connection string from .env file
if os.Getenv("GO_ENV") != "production" {
fmt.Println("Loading env...")
err := godotenv.Load()
if err != nil {
log.Fatal("failed to load env", err)
}
}
templates, err := template.New("").ParseGlob("views/*.html") templates, err := template.New("").ParseGlob("views/*.html")
if err != nil { if err != nil {
log.Fatalf("Error initializing templates: %v", err) log.Fatalf("Error initializing templates: %v", err)
os.Exit(1) os.Exit(1)
} }
// conn, err := pgx.Connect(context.Background(), os.Getenv("DB_URL"))
// if err != nil {
// log.Fatalf("Error connecting to database: %v\n", err)
// }
// defer func() {
// // shutdown database connection
// if err := conn.Close(context.Background()); err != nil {
// log.Printf("Error closing database connection: %v\n", err)
// } else {
// log.Println("Database connection closed gracefully.")
// }
// }()
e := echo.New() e := echo.New()
e.Renderer = &TemplateRenderer{ e.Renderer = &TemplateRenderer{
templates: templates, templates: templates,

View file

@ -1 +0,0 @@
DROP TABLE projects;

View file

@ -1,6 +0,0 @@
CREATE TABLE projects (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
repository_url VARCHAR(255),
description VARCHAR(255) NOT NULL
);

View file

@ -1 +0,0 @@
DROP TABLE technologies;

View file

@ -1,5 +0,0 @@
CREATE TABLE technologies (
id SERIAL PRIMARY KEY,
name VARCHAR(25) NOT NULL UNIQUE,
url TEXT NOT NULL
);

View file

@ -1 +0,0 @@
DROP TABLE projects_technologies;

View file

@ -1,5 +0,0 @@
CREATE TABLE projects_technologies (
project_id INTEGER NOT NULL REFERENCES projects(id),
technology_id INTEGER NOT NULL REFERENCES technologies(id),
PRIMARY KEY (project_id, technology_id) -- ensures a project-technology pair is unique
);

110
page.go
View file

@ -26,6 +26,92 @@ type Page struct {
func renderPage(c echo.Context) error { func renderPage(c echo.Context) error {
data := Page{} data := Page{}
data.Projects = []Project{ data.Projects = []Project{
{
Name: "Hermes",
URL: "",
Description: "The user-friendly terminal API client for those who are in love and addicted to do everything on the terminal.",
Repo: "https://github.com/juancwu/hermes",
Classes: "border-orange-400",
TechList: []Tech{
{
TechName: "Rust",
TechURL: "https://www.rust-lang.org/",
TechClasses: "",
},
{
TechName: "Ratatui",
TechURL: "https://ratatui.rs/",
TechClasses: "",
},
},
},
{
Name: "Konbini",
URL: "",
Description: "A \"convenient store\" with API services to manage projects' secrets or environment variables with the ability to separate the variables into their own environment.",
Repo: "https://github.com/juancwu/konbini",
Classes: "border-sky-500",
TechList: []Tech{
{
TechName: "Golang",
TechURL: "https://go.dev/",
TechClasses: "transition bg-zinc-950 text-zinc-100",
},
{
TechName: "Echo",
TechURL: "https://echo.labstack.com/",
TechClasses: "bg-zinc-950 text-zinc-100",
},
{
TechName: "PostgreSQL",
TechURL: "https://www.postgresql.org/",
TechClasses: "bg-zinc-950 text-zinc-100",
},
},
},
{
Name: "EmojiScript",
URL: "https://emojiscript.juancwu.dev/",
Description: "A silly project started for a brain rot hackathon host by Audrey Chen. Please give it a shot if you are interested!",
Repo: "https://github.com/KonferCA/EmojiScript",
Classes: "border-green-400",
TechList: []Tech{
{
TechName: "Typescript",
TechURL: "https://www.typescriptlang.org/",
TechClasses: "",
},
{
TechName: "Devpost",
TechURL: "https://brainrot-jia-seed-hackathon.devpost.com/",
TechClasses: "",
},
},
},
{
Name: "Konfer Website",
URL: "https://konfer.ca",
Description: "The official landing site for Konfer Inc.",
Repo: "https://github.com/KonferCA/Konfer.ca",
Classes: "border-indigo-300",
TechList: []Tech{
{
TechName: "React",
TechURL: "https://react.dev/",
TechClasses: "",
},
{
TechName: "Firebase",
TechURL: "https://firebase.google.com/",
TechClasses: "",
},
{
TechName: "TailwindCSS",
TechURL: "https://tailwindcss.com/",
TechClasses: "",
},
},
},
{ {
Name: "HawkHacks Website", Name: "HawkHacks Website",
URL: "https://hawkhacks.ca", URL: "https://hawkhacks.ca",
@ -98,30 +184,6 @@ func renderPage(c echo.Context) error {
}, },
}, },
}, },
{
Name: "Konbini",
URL: "",
Description: "A \"convenient store\" with API services to manage projects' secrets or environment variables with the ability to separate the variables into their own environment.",
Repo: "https://github.com/juancwu/konbini",
Classes: "border-sky-500",
TechList: []Tech{
{
TechName: "Golang",
TechURL: "https://go.dev/",
TechClasses: "transition bg-zinc-950 text-zinc-100",
},
{
TechName: "Echo",
TechURL: "https://echo.labstack.com/",
TechClasses: "bg-zinc-950 text-zinc-100",
},
{
TechName: "PostgreSQL",
TechURL: "https://www.postgresql.org/",
TechClasses: "bg-zinc-950 text-zinc-100",
},
},
},
{ {
Name: "Hachi-Bitto", Name: "Hachi-Bitto",
URL: "", URL: "",

732
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -110,27 +110,20 @@
<p class="text-md text-zinc-300 lg:text-xl"> <p class="text-md text-zinc-300 lg:text-xl">
Hello there <span aria-hidden="true">👋</span>, Hello there <span aria-hidden="true">👋</span>,
</p> </p>
<p class="text-5xl font-bold text-zinc-100 md:text-6xl lg:text-7xl xl:text-9xl"> <p class="text-4xl font-bold text-zinc-100 lg:text-5xl xl:text-7xl">
I am Juan I am Juan,
</p> </p>
<p class="text-2xl text-zinc-300 md:text-2xl lg:text-3xl xl:text-4xl"> <p class="text-2xl text-zinc-300 md:text-2xl lg:text-3xl xl:text-4xl">
I am a Software Developer during the day a computer science student who <br> <span class="font-bold text-zinc-200">loves software development</span> <br> and <br> <span class="font-bold text-zinc-200">tinkers with hardware</span>!
</p> </p>
<p class="text-2xl text-zinc-300 md:text-2xl lg:text-3xl xl:text-4xl"> <p class="text-2xl text-zinc-300 md:text-2xl lg:text-3xl xl:text-4xl">
<span aria-label="and">&amp;</span> I currently work at
work at <a href="https://konfer.ca" target="_blank" rel="noopener noreferrer"
<a href="https://lauriercs.ca" target="_blank" rel="noopener noreferrer" class="relative z-0 whitespace-nowrap font-medium underline decoration-sky-400 transition-all after:absolute after:left-0 after:top-0 after:-z-10 after:h-full after:w-0 after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:w-full focus:text-white focus:decoration-sky-500 focus:after:w-full">Konfer</a>
class="relative z-0 whitespace-nowrap font-medium underline decoration-sky-400 transition-all after:absolute after:left-0 after:top-0 after:-z-10 after:h-full after:w-0 after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:w-full focus:text-white focus:decoration-sky-500 focus:after:w-full">LCS</a>
,
<a href="https://hawkhacks.ca" target="_blank" rel="noopener noreferrer"
class="relative z-0 whitespace-nowrap font-medium underline decoration-sky-400 transition-all after:absolute after:left-0 after:top-0 after:-z-10 after:h-0 after:w-full after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:h-full focus:text-white focus:decoration-sky-500 focus:after:h-full">HawkHacks</a>
and and
<a href="https://www.fitdrop.xyz" target="_blank" rel="noopener noreferrer" <a href="https://hawkhacks.ca" target="_blank" rel="noopener noreferrer"
class="relative z-0 whitespace-nowrap font-medium underline decoration-sky-400 transition-all after:absolute after:left-0 after:top-0 after:-z-10 after:h-0 after:w-full after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:h-full focus:text-white focus:decoration-sky-500 focus:after:h-full"> class="relative z-0 whitespace-nowrap font-medium underline decoration-sky-400 transition-all after:absolute after:left-0 after:top-0 after:-z-10 after:h-0 after:w-full after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:h-full focus:text-white focus:decoration-sky-500 focus:after:h-full">HawkHacks</a>.
Fitdrop</a>
at night
</p> </p>
<p class="text-xs">(send help, I have been enslaved)</p>
<div class="h-4" aria-hidden="true"></div> <div class="h-4" aria-hidden="true"></div>
<p class="text-4xl font-medium md:inline-block lg:text-5xl"> <p class="text-4xl font-medium md:inline-block lg:text-5xl">
Check out my Check out my
@ -156,12 +149,11 @@
<span class="relative text-xl font-medium text-zinc-300 md:text-2xl">Welcome to</span> <span class="relative text-xl font-medium text-zinc-300 md:text-2xl">Welcome to</span>
<span <span
class="relative inline-block before:absolute before:-inset-1 before:block before:-skew-y-3 before:scale-90 before:bg-gradient-to-r before:from-purple-500 before:to-pink-500 before:opacity-60 before:transition-all hover:before:scale-100"> class="relative inline-block before:absolute before:-inset-1 before:block before:-skew-y-3 before:scale-90 before:bg-gradient-to-r before:from-purple-500 before:to-pink-500 before:opacity-60 before:transition-all hover:before:scale-100">
<span class="relative"> Project Graveyard </span> <span class="group relative"> Project Backyard </span>
</span>
</h1> </h1>
<a href="https://shoto.at/l/dumb-projects" <a href="https://github.com/juancwu" target="_blank" rel="noopener noreferrer"
class="relative underline decoration-sky-400 after:absolute after:left-0 after:top-0 after:-z-10 after:h-full after:w-0 after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:w-full focus:text-white focus:decoration-sky-500 focus:after:w-full"> class="relative underline decoration-sky-400 after:absolute after:left-0 after:top-0 after:-z-10 after:h-full after:w-0 after:bg-sky-500 after:transition-all hover:text-white hover:decoration-sky-500 hover:after:w-full focus:text-white focus:decoration-sky-500 focus:after:w-full">
Juan's dumb projects archive Checkout my GitHub for more projects!
</a> </a>
</div> </div>
</div> </div>
@ -173,7 +165,7 @@
<div> <div>
<div class="flex flex-col items-center justify-between gap-4 md:flex-row md:gap-0"> <div class="flex flex-col items-center justify-between gap-4 md:flex-row md:gap-0">
{{ if gt (len .URL) 1 }} {{ if gt (len .URL) 1 }}
<a href="{{ .URL }}" <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer"
class="relative flex items-center gap-2 transition-colors hover:text-sky-400"> class="relative flex items-center gap-2 transition-colors hover:text-sky-400">
<h3 class="text-2xl font-medium"> <h3 class="text-2xl font-medium">
{{ .Name }} {{ .Name }}