Look at the Nuxt documentation to learn more.
Make sure to install dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun installStart the development server on http://localhost:3000:
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run devBuild the application for production:
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run buildLocally preview production build:
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run previewCheck out the deployment documentation for more information.
Dashboard access now authenticates against the users table in the D1 database.
-
Configure a
SESSION_SECRETused to sign session cookies:wrangler secret put SESSION_SECRET
-
Generate a bcrypt hash for the desired password (adjust the password string as needed):
node -e "console.log(require('bcryptjs').hashSync('your-password', 10))" -
Insert a user directly into the database (use a lowercase email before running the command):
wrangler d1 execute <database-name> --command="INSERT INTO users (email, password_hash, is_active) VALUES ('[email protected]', '$2a$10$hashGoesHere', 1);"
After seeding at least one active user you can authenticate at /dashboard/login. Successful logins issue an HttpOnly session cookie that guards dashboard pages and write APIs.