-
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.
* Created a dummy header component * Added CSS * Added Header and Navigation * Created github action * Fixed npm install command typo * Testing Caching * Still Testing * Added styles for search bar * Added Searchbar component * Added Empty dockerfile * Added button component * Added buttons to header and added login and signup buttons * Added on click to the function to change styles for other component * Added Docker File and tested locally * Added Dockerhub login * Added metadata action testing to see what it does * Change image name * Added Build and push action testing to see if it works * Changed Order lets see if push works now * Change name for docker image * Added Responsive styles * Added Mobile Icons * Added Responsive styles * Created dummy component * added Navigation Dropdown component * Added External Cache Registry to cache and speed up the build * Added Docker buildX setup * Changed Name of the image * Feature (#13) * Created dummy dropdown component * Changed Font to lato * Changed Font added Navigation Drodown * Added Missing Key * Feature (#15) * Created dummy dropdown component * Changed Font to lato * Changed Font added Navigation Drodown * Added Missing Key * Added Drizzle configs, creted .env file. pulled the data from the database instead of hardcoding. * Removed unused imports --------- Co-authored-by: Amith <amith@Amiths-Laptop.local>
- Loading branch information
1 parent
abb327f
commit 7dcc92d
Showing
25 changed files
with
5,459 additions
and
3,108 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL="postgres://mrrobot:A!m@12ith@localhost:5432/awwwards" |
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 @@ | ||
'use server' | ||
import { db } from "../_drizzle/connection"; | ||
|
||
export const getNavigationData = async () => { | ||
|
||
const navigationData = await db.query.links.findMany({ | ||
columns: {name: true, svgIconName: true}, | ||
with: { | ||
sublinks: { | ||
columns: { | ||
name: true, | ||
count: true | ||
} | ||
} | ||
} | ||
}) | ||
return navigationData; | ||
} |
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
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,8 @@ | ||
import 'dotenv/config' | ||
import { drizzle } from "drizzle-orm/postgres-js"; | ||
import * as schema from './schema' | ||
import postgres from "postgres"; | ||
|
||
const client = postgres("postgres://mrrobot:A!m@12ith@localhost:5432/awwwards") | ||
|
||
export const db = drizzle(client, { schema, logger: true}) |
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 @@ | ||
import "dotenv/config" | ||
import { drizzle } from "drizzle-orm/postgres-js"; | ||
import { migrate } from "drizzle-orm/postgres-js/migrator"; | ||
import postgres from "postgres"; | ||
|
||
const migrationClient = postgres(process.env.DATABASE_URL as string, { max: 1 }) | ||
|
||
const dbConfig = async () => { | ||
|
||
await migrate(drizzle(migrationClient), { | ||
migrationsFolder: 'app/_drizzle/migrations' | ||
}) | ||
|
||
await migrationClient.end() | ||
|
||
} | ||
|
||
dbConfig() |
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,28 @@ | ||
CREATE SCHEMA "awwwards_dev"; | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "awwwards_dev"."links" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"name" varchar NOT NULL, | ||
"routeTo" varchar NOT NULL, | ||
"description" text, | ||
"created_at" timestamp (6) with time zone DEFAULT now(), | ||
"updated_at" timestamp (6) with time zone DEFAULT now(), | ||
"svg_icon_name" varchar NOT NULL, | ||
CONSTRAINT "links_name_unique" UNIQUE("name") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "awwwards_dev"."sublins" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"name" varchar NOT NULL, | ||
"count" integer NOT NULL, | ||
"link_id" integer NOT NULL, | ||
"created_at" timestamp (6) with time zone DEFAULT now(), | ||
"updated_at" timestamp (6) with time zone DEFAULT now(), | ||
CONSTRAINT "sublins_name_unique" UNIQUE("name") | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "awwwards_dev"."sublins" ADD CONSTRAINT "sublins_link_id_links_id_fk" FOREIGN KEY ("link_id") REFERENCES "awwwards_dev"."links"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
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,2 @@ | ||
ALTER TABLE "awwwards_dev"."links" ADD COLUMN "route_to" varchar NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "awwwards_dev"."links" DROP COLUMN IF EXISTS "routeTo"; |
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,16 @@ | ||
CREATE TABLE IF NOT EXISTS "awwwards_dev"."sublinks" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"name" varchar NOT NULL, | ||
"count" integer NOT NULL, | ||
"link_id" integer NOT NULL, | ||
"created_at" timestamp (6) with time zone DEFAULT now(), | ||
"updated_at" timestamp (6) with time zone DEFAULT now(), | ||
CONSTRAINT "sublinks_name_unique" UNIQUE("name") | ||
); | ||
--> statement-breakpoint | ||
DROP TABLE "awwwards_dev"."sublins";--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "awwwards_dev"."sublinks" ADD CONSTRAINT "sublinks_link_id_links_id_fk" FOREIGN KEY ("link_id") REFERENCES "awwwards_dev"."links"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
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 @@ | ||
ALTER TABLE "awwwards_dev"."sublinks" DROP CONSTRAINT "sublinks_name_unique"; |
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 @@ | ||
ALTER TABLE "awwwards_dev"."sublinks" ADD CONSTRAINT "sublinks_name_unique" UNIQUE("name"); |
Oops, something went wrong.