This is a Next.js project bootstrapped with create-next-app.
First, set up your environment variables:
Create a .env.local file in the root directory and add your API keys:
# Gemini API Key (サーバーサイドでのみ使用)
GEMINI_API_KEY=your_gemini_api_key_here
# Supabase設定
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# データベース接続(Drizzle用)
DATABASE_URL=your_supabase_database_url重要:
- APIキーは
NEXT_PUBLIC_プレフィックスを付けずに設定してください。これにより、クライアントサイドでの漏洩を防ぎます。 - Supabaseの設定は、Supabaseプロジェクトのダッシュボードから取得できます。
- Supabaseでアカウントを作成し、新しいプロジェクトを作成します
- プロジェクトの設定 > API から以下を取得します:
- Project URL
- anon public key
- service_role key
- 上記の値を
.env.localファイルに設定します
-
SQLエディタを使用する場合:
- Supabaseダッシュボードの「SQL Editor」を開きます
supabase-schema.sqlファイルの内容をコピーして実行します
-
Supabase CLIを使用する場合:
# Supabase CLIをインストール npm install -g supabase # プロジェクトを初期化 supabase init # マイグレーションを実行 supabase db push
-
Drizzleを使用する場合:
# マイグレーションファイルを生成 bun run db:generate # データベースにプッシュ bun run db:push
Then, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.