chore: update dependencies and add AWS Amplify packages
- Added aws-amplify and related packages to dependencies. - Updated TypeScript and added tsx to devDependencies. - Modified gallery page to log the availability of the YouTube API key.
This commit is contained in:
parent
82aec67cf5
commit
eea040d1f3
10 changed files with 37087 additions and 10 deletions
9
.claude/settings.local.json
Normal file
9
.claude/settings.local.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(find:*)",
|
||||
"Bash(ls:*)"
|
||||
],
|
||||
"deny": []
|
||||
}
|
||||
}
|
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -42,4 +42,9 @@ next-env.d.ts
|
|||
|
||||
# firebase
|
||||
firebase-debug.log
|
||||
firestore-debug.log
|
||||
firestore-debug.log
|
||||
|
||||
# amplify
|
||||
.amplify
|
||||
amplify_outputs*
|
||||
amplifyconfiguration*
|
||||
|
|
11
amplify/auth/resource.ts
Normal file
11
amplify/auth/resource.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { defineAuth } from '@aws-amplify/backend';
|
||||
|
||||
/**
|
||||
* Define and configure your auth resource
|
||||
* @see https://docs.amplify.aws/gen2/build-a-backend/auth
|
||||
*/
|
||||
export const auth = defineAuth({
|
||||
loginWith: {
|
||||
email: true,
|
||||
},
|
||||
});
|
11
amplify/backend.ts
Normal file
11
amplify/backend.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { defineBackend } from '@aws-amplify/backend';
|
||||
import { auth } from './auth/resource';
|
||||
import { data } from './data/resource';
|
||||
|
||||
/**
|
||||
* @see https://docs.amplify.aws/react/build-a-backend/ to add storage, functions, and more
|
||||
*/
|
||||
defineBackend({
|
||||
auth,
|
||||
data,
|
||||
});
|
53
amplify/data/resource.ts
Normal file
53
amplify/data/resource.ts
Normal file
|
@ -0,0 +1,53 @@
|
|||
import { type ClientSchema, a, defineData } from '@aws-amplify/backend';
|
||||
|
||||
/*== STEP 1 ===============================================================
|
||||
The section below creates a Todo database table with a "content" field. Try
|
||||
adding a new "isDone" field as a boolean. The authorization rule below
|
||||
specifies that any unauthenticated user can "create", "read", "update",
|
||||
and "delete" any "Todo" records.
|
||||
=========================================================================*/
|
||||
const schema = a.schema({
|
||||
Todo: a
|
||||
.model({
|
||||
content: a.string(),
|
||||
})
|
||||
.authorization((allow) => [allow.guest()]),
|
||||
});
|
||||
|
||||
export type Schema = ClientSchema<typeof schema>;
|
||||
|
||||
export const data = defineData({
|
||||
schema,
|
||||
authorizationModes: {
|
||||
defaultAuthorizationMode: 'identityPool',
|
||||
},
|
||||
});
|
||||
|
||||
/*== STEP 2 ===============================================================
|
||||
Go to your frontend source code. From your client-side code, generate a
|
||||
Data client to make CRUDL requests to your table. (THIS SNIPPET WILL ONLY
|
||||
WORK IN THE FRONTEND CODE FILE.)
|
||||
|
||||
Using JavaScript or Next.js React Server Components, Middleware, Server
|
||||
Actions or Pages Router? Review how to generate Data clients for those use
|
||||
cases: https://docs.amplify.aws/gen2/build-a-backend/data/connect-to-API/
|
||||
=========================================================================*/
|
||||
|
||||
/*
|
||||
"use client"
|
||||
import { generateClient } from "aws-amplify/data";
|
||||
import type { Schema } from "@/amplify/data/resource";
|
||||
|
||||
const client = generateClient<Schema>() // use this Data client for CRUDL requests
|
||||
*/
|
||||
|
||||
/*== STEP 3 ===============================================================
|
||||
Fetch records from the database and use them in your frontend component.
|
||||
(THIS SNIPPET WILL ONLY WORK IN THE FRONTEND CODE FILE.)
|
||||
=========================================================================*/
|
||||
|
||||
/* For example, in a React component, you can use this snippet in your
|
||||
function's RETURN statement */
|
||||
// const { data: todos } = await client.models.Todo.list()
|
||||
|
||||
// return <ul>{todos.map(todo => <li key={todo.id}>{todo.content}</li>)}</ul>
|
3
amplify/package.json
Normal file
3
amplify/package.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
17
amplify/tsconfig.json
Normal file
17
amplify/tsconfig.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"module": "es2022",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"$amplify/*": [
|
||||
"../.amplify/generated/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
36974
package-lock.json
generated
36974
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -36,6 +36,7 @@
|
|||
"@radix-ui/react-tabs": "^1.1.3",
|
||||
"@radix-ui/react-toast": "^1.2.6",
|
||||
"@radix-ui/react-tooltip": "^1.1.8",
|
||||
"aws-amplify": "^6.15.1",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"date-fns": "^3.6.0",
|
||||
|
@ -57,12 +58,18 @@
|
|||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@aws-amplify/backend": "^1.16.1",
|
||||
"@aws-amplify/backend-cli": "^1.8.0",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"aws-cdk-lib": "^2.189.1",
|
||||
"constructs": "^10.4.2",
|
||||
"esbuild": "^0.25.5",
|
||||
"genkit-cli": "^1.13.0",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5"
|
||||
"tsx": "^4.20.3",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,12 +29,11 @@ const videoIds = [
|
|||
const fallbackData: Video[] = [
|
||||
{ id: 'DK14VZ4Fyl4', title: 'Life Coach CHELSEA SMALLWOOD Is SUING Her HUSBANDS Ex Wife... It Gets WORSE' },
|
||||
{ id: '-6Zftd8C7NE', title: "The Husband Stealing, Cheating, \"TikTok Life Coach\"" },
|
||||
{ id: '1f_u41c3y_s', title: "The Bizarre Story of Chelsea Smallwood: The Cheating 'Coach'" },
|
||||
];
|
||||
|
||||
async function getYouTubeVideos(ids: string[]): Promise<Video[]> {
|
||||
const apiKey = process.env.YOUTUBE_API_KEY;
|
||||
|
||||
console.log("Using YouTube API Key:", apiKey ? "Available" : "Not Set");
|
||||
if (!apiKey) {
|
||||
console.warn("YOUTUBE_API_KEY environment variable not set. Using hardcoded video titles as fallback.");
|
||||
return fallbackData;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue