this repo has no description
1# Deployment and environment setup
2
3This project is a Next.js app backed by PostgreSQL and Auth.js with Google OAuth.
4
5## Required environment variables
6
7Copy `.env.example` to `.env` and provide values for:
8
9```env
10DATABASE_URL="postgresql://..."
11AUTH_SECRET="replace-with-a-long-random-string"
12AUTH_GOOGLE_ID="your-google-client-id"
13AUTH_GOOGLE_SECRET="your-google-client-secret"
14NEXTAUTH_URL="http://localhost:3000"
15```
16
17Generate a strong auth secret, for example:
18
19```bash
20openssl rand -base64 32
21```
22
23## Local development setup
24
25### 1. Install dependencies
26
27```bash
28bun install
29```
30
31### 2. Start PostgreSQL
32
33```bash
34bun run db:up
35```
36
37This uses `compose.yaml` and starts Postgres on `localhost:5432`.
38
39### 3. Run Prisma migrations
40
41```bash
42bun run prisma:migrate
43```
44
45### 4. Start the app
46
47```bash
48bun run dev
49```
50
51## Google OAuth setup
52
53Create your own Google OAuth client in Google Cloud Console.
54
55### Local OAuth settings
56
57Use these values during local development:
58
59**Authorized JavaScript origins**
60
61- `http://localhost:3000`
62
63**Authorized redirect URIs**
64
65- `http://localhost:3000/api/auth/callback/google`
66
67If these values are missing or incorrect, Google sign-in will fail.
68
69### Production OAuth settings
70
71For a deployed environment, replace `localhost` with your real domain.
72
73Example:
74
75**Authorized JavaScript origins**
76
77- `https://your-domain.example`
78
79**Authorized redirect URIs**
80
81- `https://your-domain.example/api/auth/callback/google`
82
83Set `NEXTAUTH_URL` to the same public base URL.
84
85## Production deployment checklist
86
871. Provision a PostgreSQL database.
882. Set the required environment variables.
893. Configure Google OAuth for the production domain.
904. Install dependencies:
91
92 ```bash
93 bun install
94 ```
95
965. Run production database migrations:
97
98 ```bash
99 bunx prisma migrate deploy
100 ```
101
1026. Build the app:
103
104 ```bash
105 bun run build
106 ```
107
1087. Start the server with your process manager of choice:
109
110 ```bash
111 bun run start
112 ```
113
114## Notes
115
116- The build runs translation validation before Next.js production build.
117- Response exports are generated inside the app; no separate worker is required.
118- Editing a published form updates the live public form immediately.