Skip to content

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

BeeWise public auth launch notice

Set these server environment variables for the apps/sale deployment:

BEEWISE_AUTH_PAUSED=true
BEEWISE_AUTH_NOTICE_TEXT="BeeWise đang chuẩn bị ra mắt. Chức năng đăng nhập và đăng ký sẽ sớm mở."

When enabled, the notice and disabled login/register forms appear only on beewise.vn and www.beewise.vn. POST requests to /api/auth/login/* and /api/auth/register on those hosts return 503. Test domains and localhost continue to work. Set BEEWISE_AUTH_PAUSED=false (or remove it) to reopen public auth, then restart or redeploy the sale server so the new environment value takes effect. The notice text is optional; the app has a default message.

The production ingress must preserve the original Host header so the sale app can distinguish the public and test domains.

If the backend auth API is directly reachable outside the sale app, enforce the same public launch policy at the backend or ingress as well.

Chat realtime (Centrifugo)

Set NEXT_PUBLIC_CENTRIFUGO_WS_URL in both apps/sale and apps/lms deployment environments to the public WebSocket endpoint, for example wss://<public-host>/connection/websocket. Restart or rebuild both apps after changing it. The frontend obtains a short-lived connection token from GET /realtime/centrifugo/token, then a room-specific token from GET /realtime/centrifugo/subscription-token?chatRoomId=.... The Centrifugo SDK refreshes both tokens when needed and subscribes to chat:room:{chatRoomId} while that room is open. It uses API polling when the URL is absent or the WebSocket cannot connect.

The Centrifugo health response on the test API currently reports an internal container hostname; browsers cannot use that hostname. Expose the Centrifugo WebSocket endpoint through a public HTTPS ingress that forwards WebSocket Upgrade and Connection headers. The subscription token endpoint checks room membership and must remain restricted to authenticated users.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open 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.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

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.

Releases

Packages

Contributors

Languages