|
1 | | -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 1 | +# BlueDocs Frontend |
2 | 2 |
|
3 | | -## Getting Started |
| 3 | +Next.js app for the BlueDocs map dashboard. |
4 | 4 |
|
5 | | -First, run the development server: |
| 5 | +## Local Setup |
6 | 6 |
|
7 | 7 | ```bash |
8 | | -npm run dev |
9 | | -# or |
10 | | -yarn dev |
11 | | -# or |
12 | | -pnpm dev |
13 | | -# or |
14 | | -bun dev |
| 8 | +bun install |
| 9 | +cp .env.example .env.local |
15 | 10 | ``` |
16 | 11 |
|
17 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 12 | +Set these values in `.env.local`: |
18 | 13 |
|
19 | | -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 14 | +- `NEXT_PUBLIC_MAPBOX_TOKEN`: Mapbox public token with access to Mapbox styles. |
| 15 | +- `NEXT_PUBLIC_API_URL`: BlueDocs API URL. Use `https://bluedocs-api.onrender.com` for the hosted backend or `http://localhost:8000` for local backend development. |
| 16 | +- `NEXT_PUBLIC_CONVEX_URL`: Convex deployment URL from `bun run convex:dev` or the Convex dashboard. |
20 | 17 |
|
21 | | -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 18 | +Then run: |
22 | 19 |
|
23 | | -## Learn More |
| 20 | +```bash |
| 21 | +bun run dev |
| 22 | +``` |
| 23 | + |
| 24 | +## Simple Convex Auth |
| 25 | + |
| 26 | +Authentication intentionally stays simple: |
| 27 | + |
| 28 | +- Users create an account with email and password. |
| 29 | +- Sign-up immediately creates a session. |
| 30 | +- There is no email verification, no magic link, and no external auth provider. |
| 31 | +- Passwords must be at least 8 characters. |
| 32 | +- Saved projects are stored per signed-in Convex user. |
24 | 33 |
|
25 | | -To learn more about Next.js, take a look at the following resources: |
| 34 | +The auth functions live in `convex/accounts.ts`, and the session/password helpers live in `convex/lib/auth.ts`. |
26 | 35 |
|
27 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 36 | +## Vercel Redeploy |
29 | 37 |
|
30 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 38 | +Create a new Vercel project from this repo and set the project root to `frontend`. |
31 | 39 |
|
32 | | -## Deploy on Vercel |
| 40 | +Set Vercel environment variables: |
| 41 | + |
| 42 | +- `NEXT_PUBLIC_MAPBOX_TOKEN`: New Mapbox public token. |
| 43 | +- `NEXT_PUBLIC_API_URL`: `https://bluedocs-api.onrender.com`. |
| 44 | +- `CONVEX_DEPLOY_KEY`: Convex production deploy key for the new Convex deployment. |
| 45 | + |
| 46 | +The Vercel build command is configured in `vercel.json`: |
| 47 | + |
| 48 | +```bash |
| 49 | +npx convex deploy --cmd-url-env-var-name NEXT_PUBLIC_CONVEX_URL --cmd 'bun run build' |
| 50 | +``` |
33 | 51 |
|
34 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 52 | +That command deploys Convex functions first, injects `NEXT_PUBLIC_CONVEX_URL` for the frontend build, then runs the Next.js production build. |
35 | 53 |
|
36 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| 54 | +If email notifications are needed, set `RESEND_API_KEY` in the Convex deployment environment. Without it, notification sending is skipped. |
0 commit comments