imkFinal/backend
2025-04-06 20:40:25 +02:00
..
prisma seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
scripts seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
src forgot password fix 2025-04-06 20:40:25 +02:00
.dockerignore seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
.env reset forgoten password tweak 2025-04-01 04:51:58 +02:00
docker-compose.dev.yml seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
docker-compose.yaml postgres port mapping 2025-03-31 23:23:52 +02:00
Dockerfile mark as done, CORS to be implemented 2025-03-31 20:54:42 +02:00
Dockerfile.dev seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
env.development seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
nest-cli.json final version 2025-02-24 23:43:50 +01:00
package-lock.json helmet, cors tweaks 2025-03-31 23:53:34 +02:00
package.json seting up dev vs prod enviroment 2025-04-05 01:39:25 +02:00
README.md default 2025-03-29 17:08:01 +01:00
start-dev.sh seting up dev vs prod enviroment 2025-04-05 01:39:25 +02: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.