Deployment

Learn how to deploy your Nuxt Auto CRUD application to production.

Deploying to Production

Since Nuxt Auto CRUD is built on standard Nuxt and NuxtHub practices, you can deploy it to any provider that supports Nuxt. However, NuxtHub is the recommended platform for the easiest experience with the database.

1. Environment Variables

Ensure you set the following environment variables in your production environment (e.g., via the NuxtHub dashboard or your provider's settings):

  • NUXT_SESSION_PASSWORD: A long, random string (at least 32 characters) used to encrypt user sessions.
  • NUXT_ADMIN_EMAIL: The email address of the initial admin user. This is used for seeding the first admin account.
  • NUXT_ADMIN_PASSWORD: The initial password for the admin account.

2. Database Migrations and Seeding

Your production database permissions start empty.

The system is designed to auto-seed the essential data (like the default Admin role and user) the first time you log in with the Admin credentials configured in your environment variables.

  1. Access your deployed application's login page.
  2. Log in using the email and password you set in NUXT_ADMIN_EMAIL and NUXT_ADMIN_PASSWORD.
  3. The system will detect this first login and initialize the database tables with the necessary Role-Based Access Control (RBAC) structure.

3. Configure Permissions (Important!)

Crucial Step: Your local SQLite database (where you configured roles and permissions) is NOT uploaded to production.

Once you have logged in as Admin (which triggers the seeding):

  1. Navigate to the Dashboard.
  2. Go to the Roles & Permissions section.
  3. Re-configure your permissions. You need to define which roles can access which resources again for the production environment.