Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@ next-env.d.ts

# firebase
firebase-debug.log
firestore-debug.log
firestore-debug.log

# database files
*.sqlite
*.sqlite-shm
*.sqlite-wal
Binary file removed database.sqlite
Binary file not shown.
Binary file removed database.sqlite-shm
Binary file not shown.
Binary file removed database.sqlite-wal
Binary file not shown.
719 changes: 373 additions & 346 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"genkit:watch": "genkit start -- tsx --watch src/ai/dev.ts",
"build": "npx next build",
"start": "npx next start",
"lint": "npx next lint --max-warnings=0 --no-error-on-unmatched-pattern",
"lint": "npx next lint",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"genkit": "^1.8.0",
"html2canvas": "^1.4.1",
"lucide-react": "^0.475.0",
"next": "15.3.3",
"next": "^15.5.6",
"patch-package": "^8.0.0",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
Expand All @@ -66,4 +66,4 @@
"typescript": "^5"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
}
2 changes: 1 addition & 1 deletion src/ai/flows/assess-health-safety.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Your analysis must be objective and based on general nutritional science. Be con
inputSchema: AssessHealthSafetyInputSchema,
outputSchema: AssessHealthSafetyOutputSchema,
},
async (input) => {
async (input: AssessHealthSafetyInput) => {
const {output} = await prompt(input);
if (!output) {
throw new Error('The AI model failed to provide an assessment.');
Expand Down
2 changes: 1 addition & 1 deletion src/ai/flows/extract-ingredients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Image to analyze: {{media url=image}}`,
inputSchema: ExtractIngredientsInputSchema,
outputSchema: ExtractIngredientsOutputSchema,
},
async (input) => {
async (input: ExtractIngredientsInput) => {
const {output} = await prompt(input);
if (!output) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function HomePage() {
<div className="container px-4 md:px-6">
<div className="flex flex-col items-center justify-center space-y-4 text-center mb-12">
<div className="inline-block rounded-lg bg-secondary px-3 py-1 text-sm text-secondary-foreground font-semibold">Key Features</div>
<h2 className="text-3xl font-bold tracking-tighter sm:text-5xl font-headline">Why You'll Love EatInformed</h2>
<h2 className="text-3xl font-bold tracking-tighter sm:text-5xl font-headline">Why You&apos;ll Love EatInformed</h2>
<p className="max-w-[900px] text-muted-foreground md:text-xl/relaxed">
We provide the tools you need for food clarity.
</p>
Expand Down Expand Up @@ -75,7 +75,7 @@ export default function HomePage() {
<div className="inline-block rounded-lg bg-secondary px-3 py-1 text-sm text-secondary-foreground font-semibold">How It Works</div>
<h2 className="text-3xl font-bold tracking-tighter sm:text-5xl font-headline">Simple Steps to Food Clarity</h2>
<p className="max-w-[900px] text-muted-foreground md:text-xl/relaxed lg:text-base/relaxed xl:text-xl/relaxed">
Discovering what's in your food has never been easier.
Discovering what&apos;s in your food has never been easier.
</p>
</div>
<div className="mx-auto grid max-w-5xl items-start gap-8 sm:grid-cols-2 md:gap-12 lg:grid-cols-3 lg:gap-16 mt-12">
Expand Down
10 changes: 10 additions & 0 deletions src/components/features/ImageUploadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ export function CheckPageClient() {
});
return;
}
// Security: Limit file size to 10MB to prevent DoS attacks
const maxSizeInBytes = 10 * 1024 * 1024; // 10MB
if (file.size > maxSizeInBytes) {
toast({
variant: 'destructive',
title: 'File Too Large',
description: 'Please upload an image smaller than 10MB.',
});
return;
}
const reader = new FileReader();
reader.onloadend = () => {
const dataUri = reader.result as string;
Expand Down
Loading
Loading