No description
Find a file
Ham3L fb839d3705
Some checks failed
Deploy to NuxtHub / Deploy to NuxtHub (push) Has been cancelled
Initial commit ham3l.cloud
2025-12-11 00:29:52 +01:00
.github/workflows Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
app Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
content Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
public Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
scripts Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
server Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
shared/utils Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
tests Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
types Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
.editorconfig Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
.env.example Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
.firebaserc Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
.gitignore Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
apphosting.yaml Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
bun.lock Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
content.config.ts Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
drizzle.config.ts Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
eslint.config.mjs Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
firebase.json Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
nuxt.config.ts Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
package.json Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
PERMISSIONS.md Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
pnpm-lock.yaml Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
pnpm-workspace.yaml Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
README.md Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
renovate.json Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
tsconfig.json Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00
vitest.config.ts Initial commit ham3l.cloud 2025-12-11 00:29:52 +01:00

Nuxt Auto CRUD Starter

A starter template for Nuxt Auto CRUD module.

Setup

Make sure to install the dependencies:

pnpm install

Development Server

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

pnpm dev

Production

Build the application for production:

pnpm build

Important: When deploying to production, ensure you set the following environment variables:

  • NUXT_ADMIN_EMAIL
  • NUXT_ADMIN_PASSWORD
  • NUXT_SESSION_PASSWORD

Locally preview production build:

pnpm preview

Usage Modes

This template comes pre-configured with nuxt-auto-crud for a fullstack experience.

Fullstack (Default)

No extra steps needed. nuxt-auto-crud is installed and configured.

Frontend Only

If you wish to use this template as a frontend-only application:

  1. Uninstall the module:
    npm uninstall nuxt-auto-crud
    
  2. Open nuxt.config.ts and remove 'nuxt-auto-crud' from the modules list.
  3. Remove the autoCrud configuration block from nuxt.config.ts.

Permissions & Roles

This template uses a Database-Driven Permissions System.

Unlike previous versions that used JSON configuration files, all roles and permissions are now stored in the database (roles, resources, permissions, role_resource_permissions tables).

How it works:

  1. Roles: Defined in the roles table (e.g., admin, manager, public).
  2. Resources: Defined in the resources table (e.g., users, posts).
  3. Permissions: Defined in the permissions table (e.g., create, read, update, delete, list).
  4. Assignment: The role_resource_permissions table links them together.

Managing Permissions:

  • Seeding: Initial permissions are set up via server/tasks/seed.ts. You can modify this file to change default permissions.
  • Runtime: You can build a UI to manage these records directly in the database, allowing for dynamic permission updates without redeploying.

For a detailed guide on managing permissions, see PERMISSIONS.md.

Public Access:

Public (unauthenticated) access is controlled by the public role in the database. Assign permissions to the public role to allow access to resources for non-logged-in users.

Database Reset & Seeding

If you want to delete all data and start fresh:

  1. Delete the .data directory.
  2. Run the database generation command:
    bun db:generate
    
  3. Run the seed task (this will create default roles, permissions, and users):
    npx nuxi task run db:seed (or take tasks in dev tools)
    
  4. Restart the server:
    bun run dev
    

Default Users:

The seed task creates the following users (Password: $1Password):

  • Admin: admin@example.com (Full Access)
    • Note: The default password is $1Password. This hints at the complexity requirements (symbol, number, capital & small letter). You can configure these via NUXT_ADMIN_EMAIL and NUXT_ADMIN_PASSWORD in your .env file.
  • Manager: manager@example.com
  • Moderator: moderator@example.com
  • Customer: customer@example.com

Security Note: Log in with the admin credentials, create a new admin user, and then delete the default admin user.