Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ItsAnunesS/anuness.dev

Repository files navigation

Nuxt Minimal Starter

Look at the Nuxt documentation to learn more.

Setup

Make sure to install dependencies:

# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install

Development Server

Start the development server on http://localhost:3000:

# npm
npm run dev

# pnpm
pnpm dev

# yarn
yarn dev

# bun
bun run dev

Production

Build the application for production:

# npm
npm run build

# pnpm
pnpm build

# yarn
yarn build

# bun
bun run build

Locally preview production build:

# npm
npm run preview

# pnpm
pnpm preview

# yarn
yarn preview

# bun
bun run preview

Check out the deployment documentation for more information.

Authentication

Dashboard access now authenticates against the users table in the D1 database.

  1. Configure a SESSION_SECRET used to sign session cookies:

    wrangler secret put SESSION_SECRET
  2. Generate a bcrypt hash for the desired password (adjust the password string as needed):

    node -e "console.log(require('bcryptjs').hashSync('your-password', 10))"
  3. 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.

About

♻️ My website personal website made with nuxt

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages