- Next.js 14+ with App Router and TypeScript - Tailwind CSS and ShadCN UI styling - Zustand state management - Dexie.js for IndexedDB (local-first data) - Auth.js v5 for authentication - BMAD framework integration Co-Authored-By: Claude <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Deployment Instructions - Test01
This guide provides instructions for deploying the Test01 application to production environments.
Prerequisites
- Node.js: v18 or higher
- npm: v9 or higher
- Vercel Account (Recommended for hosting)
Environment Variables
Ensure the following environment variables are configured in your production environment:
| Variable | Description | Default / Example |
|---|---|---|
NEXT_PUBLIC_AI_PROVIDER |
Default AI Provider (optional) | gemini |
NEXT_PUBLIC_GEMINI_API_KEY |
Initial API Key (optional) | AIzaSy... |
NEXT_PUBLIC_API_URL |
API Base URL (if custom) | https://api.example.com |
Note: The application uses a local-first architecture (IndexedDB), so no external database connection strings (Postgres/MySQL) are required for the core journaling features.
Deployment Options
Option 1: Vercel (Recommended)
Vercel provides the best support for Next.js applications, including PWA headers and caching.
- Push to GitHub: Ensure your code is pushed to a remote repository.
- Import Project: Go to Vercel Dashboard and import your repository.
- Configure:
- Framework Preset: Next.js
- Build Command:
next build - Output Directory:
.next - Environment Variables: Add any keys defined above.
- Deploy: Click "Deploy".
Vercel will automatically detect the manifest.webmanifest and service worker configurations.
Option 2: Docker / Custom Server
To deploy as a standalone Node.js application:
- Build the application:
npm run build - Start the server:
The app will be available at
npm starthttp://localhost:3000.
Docker Strategy: You can use the official Next.js Docker example for a containerized deployment.
Troubleshooting
Build Failures
- Google Fonts / Network Errors: The build process requires internet access to download fonts from Google. If building in a restricted environment (like a corporate firewall or offline CI), you may see TLS/Network errors.
- Workaround: Set
NEXT_TURBOPACK_EXPERIMENTAL_USE_SYSTEM_TLS_CERTS=1or temporarily disablenext/font/googleinsrc/app/layout.tsx.
- Workaround: Set
- Manifest Errors: If you see
manifest.tstype errors, ensure you are using a compatible Next.js version (14+ recommended) or checkpurposefields in icon definitions.
PWA Verification
After deployment, verify the PWA features:
- Open the deployed URL (e.g.,
https://test01.vercel.app) on a mobile device or Chrome. - Look for the "Install Test01" prompt (bottom banner) or the Install icon in the address bar.
- Install the app and verify it opens in standalone mode.
- Disconnect internet and verify you can still create/save drafts (Offline support).