Next.js 15 app that turns photos, PDFs, DOCX/PPTX and text into a swipeable feed of AI-generated activities (flashcards, multiple choice, true/false, fill-in-the-blank, matching, ordering, short answer) using the user's own Ollama models. Highlights: - All AI calls run in server route handlers; the browser never talks to Ollama. - Bring-your-own-key mode (default): the key lives only in the browser and is sent per-request; server, local-daemon and shared-key modes also supported. - Client-side document extraction (pdf.js, mammoth, jszip) with scanned-PDF page rendering for the vision model; notes stay in their original language. - ChatGPT-style shell: collapsible sidebar / mobile drawer, neutral token-based light + dark themes, folder organisation, PWA (manifest, SW, offline page). - Strict JSON validation with zod + auto-repair, rate limiting, and request guards (cross-origin, body-size, API-key sanitising). - setup.sh bootstraps deps, .env.local and a production build. Gitignore excludes .env*, the generated pdf.js worker and local scratch files.
22 lines
586 B
TypeScript
22 lines
586 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
/**
|
|
* Freezmo is meant to be opened from a phone on the same network, so the dev
|
|
* server (which binds 0.0.0.0:3207) should accept dev-asset requests coming
|
|
* from private hostnames. Production builds are not affected by this option.
|
|
*
|
|
* Add your own hostname here if Next still warns about a cross-origin request.
|
|
*/
|
|
const nextConfig: NextConfig = {
|
|
allowedDevOrigins: [
|
|
"127.0.0.1",
|
|
"localhost",
|
|
"*.local",
|
|
"**.local",
|
|
"192.168.*.*",
|
|
"10.*.*.*",
|
|
"*.ts.net", // Tailscale
|
|
],
|
|
};
|
|
|
|
export default nextConfig;
|