This is a Next.js project bootstrapped with create-next-app.
First, 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.
- Create product/order tables using Sequelize migrations or a one-time
sequelize.sync()script (models inlib/models.ts). For the one-time script, runnpx tsx scripts/sync-db.ts. - Create Better Auth tables with
npx @better-auth/cli migrate(requiresBETTER_AUTH_SECRET+ DB config). Generate withopenssl rand -base64 32. - Copy
.env.exampleto.envand setPOSTGRES,BETTER_AUTH_*, the Brevo sender info, Supabase storage, and shipping. - Start the app with
npm run dev.
Better Auth handles admin sign-in at /api/auth/*. Set ADMIN_EMAILS to the email(s) allowed to access /api/admin/* routes.
Use /admin for the back-office UI. If no admin user exists, you will be redirected to /admin/register to create the first account.
You can also create the first account via POST /api/admin/register or directly with POST /api/auth/sign-up/email, then sign in using POST /api/auth/sign-in/email.
If ADMIN_EMAILS is empty, any authenticated user is treated as admin (useful in dev only).
Emails are sent via the Brevo API. Save the Brevo secret key in Settings → Emailing, and set either BREVO_SENDER_EMAIL/BREVO_SENDER_NAME or EMAIL_FROM ("Name <email>") in your env.
Product and collection media files are uploaded to Supabase Storage.
Set SUPABASE_URL, SUPABASE_S3_ENDPOINT, SUPABASE_S3_ACCESS_KEY_ID, SUPABASE_S3_SECRET_ACCESS_KEY, and optionally SUPABASE_STORAGE_BUCKET (default: product-media).
Use a public bucket if you want to serve images directly to storefront users.
Public:
GET /api/products?limit=24&offset=0GET /api/products/[slug]POST /api/ordersGET /api/orders/[publicId]
Auth (Better Auth):
POST /api/auth/sign-up/emailPOST /api/auth/sign-in/emailPOST /api/auth/sign-outGET /api/auth/get-sessionGET /api/auth/token(JWT)GET /api/auth/jwks
Admin (requires session cookie or Authorization: Bearer <jwt>):
GET /api/admin/ordersGET /api/admin/orders/[id]PATCH /api/admin/orders/[id](status updates)POST /api/admin/orders/[id]/payment-link(send PayPal link email)
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.
-
Front home design
-
Front menu
-
Front product page
-
Front API connection
-
Front checkout
-
Brand page
-
Order page
-
Order details page
-
View button, edit product page admin
-
Adding/deleting admin user + name
-
Setting page -> Logo -> Favicon