Skip to content

Commit 4d5fb34

Browse files
authored
Merge pull request #8 from yogyy/next-14
project updates 2025
2 parents 7d4c00c + 1d25152 commit 4d5fb34

File tree

107 files changed

+8527
-4326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+8527
-4326
lines changed

.env.example

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# Environment variables declared in this file are automatically made available to Prisma.
2-
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
1+
# https://supabase.com/docs/guides/database/drizzle
32

4-
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
5-
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
6-
7-
DATABASE_URL=
8-
NEXTAUTH_JWT_SECRET=
9-
NEXTAUTH_SECRET=
3+
DATABASE_URL= # PostgreSQL DB
4+
BETTER_AUTH_SECRET=
5+
BETTER_AUTH_URL=
106

117
GITHUB_ID=
128
GITHUB_SECRET=
@@ -18,4 +14,5 @@ TMDB_API_KEY=
1814
NEXT_PUBLIC_UMAMI_WEBSITE_ID=
1915

2016
UPSTASH_REDIS_REST_URL=
21-
UPSTASH_REDIS_REST_TOKEN=
17+
UPSTASH_REDIS_REST_TOKEN=
18+
NODEJS_HELPERS=0 # require for vercel to hono work with the Pages Router

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"plugins": ["prettier-plugin-tailwindcss"],
33
"tabWidth": 2,
4-
"printWidth": 80
4+
"printWidth": 90
55
}

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
## Notflox
1+
# Notflox
22

3-
Open Source Project to connect Public REST APIs(TMDB) using [Tanstack Query](https://tanstack.com/)
3+
Open Source TMDB client app
44

55
## Features
66

7+
- Authentications
78
- Movie / Tv List
89
- Movie / Tv Details
910
- Trailer (if available)
10-
- Authentications
11+
- Watchlist (login require)
1112

1213
## Installation
1314

@@ -23,9 +24,9 @@ npm run dev
2324
To run this project, you will need to add the following environment variables to your .env file
2425

2526
```bash
26-
DATABASE_URL=
27-
NEXTAUTH_JWT_SECRET=
28-
NEXTAUTH_SECRET=
27+
DATABASE_URL= # PostgreSQL DB
28+
BETTER_AUTH_SECRET=
29+
BETTER_AUTH_URL=
2930

3031
GITHUB_ID=
3132
GITHUB_SECRET=
@@ -35,6 +36,10 @@ GOOGLE_CLIENT_SECRET=
3536

3637
TMDB_API_KEY=
3738
NEXT_PUBLIC_UMAMI_WEBSITE_ID=
39+
40+
UPSTASH_REDIS_REST_URL=
41+
UPSTASH_REDIS_REST_TOKEN=
42+
NODEJS_HELPERS=0 # require for vercel to hono work with the Pages Router
3843
```
3944

4045
## Demo

atoms/auth-atoms.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import { atom } from "jotai";
22

3-
export const loginState = atom<boolean>(true);
3+
export const authState = atom<"login" | "register">("login");
44
export const providerState = atom<"google" | "github" | null>(null);
5-
6-
export const changeLoginState = atom(null, (get, set, newState: boolean) => {
7-
set(loginState, newState);
8-
});

auth.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

drizzle.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "drizzle-kit";
2+
3+
export default defineConfig({
4+
out: "./drizzle",
5+
schema: "./src/db/schema/*.ts",
6+
dialect: "postgresql",
7+
dbCredentials: {
8+
url: process.env.DATABASE_URL!,
9+
},
10+
});

drizzle/0000_cynical_may_parker.sql

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
CREATE TABLE "notflox_account" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"account_id" text NOT NULL,
4+
"provider_id" text NOT NULL,
5+
"user_id" text NOT NULL,
6+
"access_token" text,
7+
"refresh_token" text,
8+
"id_token" text,
9+
"access_token_expires_at" timestamp,
10+
"refresh_token_expires_at" timestamp,
11+
"scope" text,
12+
"password" text,
13+
"created_at" timestamp NOT NULL,
14+
"updated_at" timestamp NOT NULL
15+
);
16+
--> statement-breakpoint
17+
CREATE TABLE "notflox_session" (
18+
"id" text PRIMARY KEY NOT NULL,
19+
"expires_at" timestamp NOT NULL,
20+
"token" text NOT NULL,
21+
"created_at" timestamp NOT NULL,
22+
"updated_at" timestamp NOT NULL,
23+
"ip_address" text,
24+
"user_agent" text,
25+
"user_id" text NOT NULL,
26+
CONSTRAINT "notflox_session_token_unique" UNIQUE("token")
27+
);
28+
--> statement-breakpoint
29+
CREATE TABLE "notflox_user" (
30+
"id" text PRIMARY KEY NOT NULL,
31+
"name" text NOT NULL,
32+
"email" text NOT NULL,
33+
"email_verified" boolean NOT NULL,
34+
"image" text,
35+
"created_at" timestamp NOT NULL,
36+
"updated_at" timestamp NOT NULL,
37+
CONSTRAINT "notflox_user_email_unique" UNIQUE("email")
38+
);
39+
--> statement-breakpoint
40+
CREATE TABLE "notflox_verification" (
41+
"id" text PRIMARY KEY NOT NULL,
42+
"identifier" text NOT NULL,
43+
"value" text NOT NULL,
44+
"expires_at" timestamp NOT NULL,
45+
"created_at" timestamp,
46+
"updated_at" timestamp
47+
);
48+
--> statement-breakpoint
49+
ALTER TABLE "notflox_account" ADD CONSTRAINT "notflox_account_user_id_notflox_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."notflox_user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
50+
ALTER TABLE "notflox_session" ADD CONSTRAINT "notflox_session_user_id_notflox_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."notflox_user"("id") ON DELETE cascade ON UPDATE no action;

drizzle/0001_lethal_mandroid.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CREATE TABLE "notflox_watchlist" (
2+
"id" varchar(22) PRIMARY KEY NOT NULL,
3+
"title" varchar NOT NULL,
4+
"show_id" varchar(10) NOT NULL,
5+
"media_type" varchar(6),
6+
"user_id" varchar NOT NULL,
7+
"backdrop_path" varchar,
8+
"poster_path" varchar,
9+
"created_at" timestamp DEFAULT now(),
10+
"release_date" timestamp NOT NULL
11+
);
12+
--> statement-breakpoint
13+
ALTER TABLE "notflox_watchlist" ADD CONSTRAINT "notflox_watchlist_user_id_notflox_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."notflox_user"("id") ON DELETE no action ON UPDATE no action;

drizzle/0002_daily_ogun.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE "notflox_watchlist" ALTER COLUMN "media_type" SET NOT NULL;--> statement-breakpoint
2+
ALTER TABLE "notflox_watchlist" ALTER COLUMN "user_id" SET NOT NULL;--> statement-breakpoint
3+
ALTER TABLE "notflox_watchlist" ADD CONSTRAINT "unique_watchlist" UNIQUE("media_type","show_id","user_id");

0 commit comments

Comments
 (0)