| .. | ||
| prisma | ||
| scripts | ||
| src | ||
| .dockerignore | ||
| .env | ||
| docker-compose.dev.yml | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| env.development | ||
| nest-cli.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| start-dev.sh | ||
| temp.sql | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
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:
- The seed script will run automatically during deployment when you run:
npx prisma db push
npx prisma db seed
- 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:
- Automatically during deployment via the seed script
- Manually via the initialization endpoint
To deploy, you would:
- Set up your environment variables
- Run the database migrations
- 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:
- Change the default password after first login
- Use strong passwords in production
- Properly secure the initialization endpoint in production
- Keep your environment variables secure
This setup ensures you always have an admin user available after deployment while maintaining security and flexibility.