imkFinal/backend
2025-03-31 06:43:31 +02:00
..
prisma docker-compose up and running :) 2025-03-31 04:40:31 +02:00
src fix 2025-03-31 06:43:31 +02:00
_Dockerfile production 2025-03-31 06:27:21 +02:00
.env production 2025-03-31 06:27:21 +02:00
Dockerfile production 2025-03-31 06:27:21 +02:00
nest-cli.json final version 2025-02-24 23:43:50 +01:00
package-lock.json opt for prod 2025-03-31 05:37:44 +02:00
package.json opt for prod 2025-03-31 05:37:44 +02:00
README.md default 2025-03-29 17:08:01 +01:00
temp.sql docker-compose up and running :) 2025-03-31 04:40:31 +02:00
tsconfig.build.json final version 2025-02-24 23:43:50 +01:00
tsconfig.json final version 2025-02-24 23:43:50 +01:00

Add the necessary environment variables to your .env file:

# Default Admin Configuration
DEFAULT_ADMIN_EMAIL=admin@imk.com
DEFAULT_ADMIN_PASSWORD=admin123456
DEFAULT_ADMIN_NAME=System Admin

To use this setup:

  1. The seed script will run automatically during deployment when you run:
npx prisma db push
npx prisma db seed
  1. Alternatively, you can manually trigger the initialization by making a POST request to:
POST /init/system

This gives you two ways to ensure the default admin user is created:

  1. Automatically during deployment via the seed script
  2. Manually via the initialization endpoint

To deploy, you would:

  1. Set up your environment variables
  2. Run the database migrations
  3. Run the seed script
npm run prisma:deploy
npm run prisma:seed

The default admin credentials will be:

  • Email: admin@imk.com (or whatever you set in env)
  • Password: admin123456 (or whatever you set in env)

Make sure to:

  1. Change the default password after first login
  2. Use strong passwords in production
  3. Properly secure the initialization endpoint in production
  4. Keep your environment variables secure

This setup ensures you always have an admin user available after deployment while maintaining security and flexibility.