Sign inSign up

aash591/essl

By aash591

Updated 5 months ago

Image
0

1.6K

aash591/essl repository overview

ESSL Attendance – Docker Image

ESSL Attendance is a web application for managing biometric attendance devices and employee attendance records.
This Docker image packages the production build of the app so you can run it quickly with Docker or Docker Compose, backed by Supabase/PostgreSQL.

Tech stack
  • Frontend / Backend: Next.js (React, TypeScript)
  • Database & Auth: Supabase (PostgreSQL, JWT-based auth)
  • ORM / Migrations: Drizzle ORM
Example docker-compose.yml
version: "3.9"

services:
  essl-app:
    image: aash/essl:latest
    container_name: essl-app
    restart: unless-stopped
    ports:
      - "3000:3000"
    env_file:
      - .env
Example .env
# Copy this file to .env and update the values

# Device Configuration
NEXT_PUBLIC_DEVICE_IP=<device_ip>
NEXT_PUBLIC_DEVICE_PORT=<device_port>
NEXT_PUBLIC_DEVICE_SERIAL=<device_serial>

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=<supabase_url>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<supabase_anon_key>
SUPABASE_SERVICE_ROLE_KEY=<supabase_service_role_key>

# Database Configuration (for Drizzle auto migration)
#SUPABASE_DB_HOST_POSTGRES_URL=<supabase_db_host IP>
SUPABASE_DB_PASSWORD=<supabase_db_password>
SUPABASE_DB_PORT_POSTGRES_DIRECT=<postgres_port>
SUPABASE_DB_USE_DIRECT=true
SUPABASE_DB_USER_POSTGRES=<postgres_user>
SUPABASE_DB_NAME_POSTGRES=<postgres_db_name>

# Application Configuration
PROJECT_ENVIRONMENT=<environment>
DB_SCHEMA_NAME_PROD=<schema_name_prod>
DB_SCHEMA_NAME_DEV=<schema_name_dev>
DISABLE_AUTO_MIGRATE=false  # set to true to disable automatic DB migrations on startup
NEXT_PUBLIC_APP_VERSION=1.23

# JWT Authentication Configuration
JWT_SECRET=<jwt_secret_at_least_64_chars>
JWT_EXPIRES_IN=1d
JWT_REFRESH_EXPIRES_IN=7d

Automatic migrations:
On container startup, database migrations run automatically when DISABLE_AUTO_MIGRATE=false.
If you prefer to manage schema changes yourself, set DISABLE_AUTO_MIGRATE=true in your .env.

Initial Admin Creation

After the container is running and migrations have completed, create your first admin user using the interactive script.

Prerequisites:

  • Node.js installed on your host machine
  • Access to the repository source code (or clone from GitHub)

Steps:

  1. Clone the repository (if you haven't already):

    git clone https://github.com/aash591/essl.git
    cd essl
    
  2. Install dependencies:

    npm install
    
  3. Ensure your .env file is configured with the correct database credentials (same values used in your Docker container).

  4. Run the admin creation script:

    npx tsx scripts/create-admin.ts
    
  5. Follow the interactive prompts to provide:

    • Username
    • Password (minimum 6 characters)
    • Full Name
    • Email
    • Role selection (super_admin or admin)

The script will create the admin user in your database using the configured schema based on PROJECT_ENVIRONMENT.

Note: The script connects directly to your database using the connection details from your .env file. Make sure your database is accessible from your host machine.

Tag summary

Content type

Image

Digest

sha256:130139bf4

Size

87.7 MB

Last updated

5 months ago

docker pull aash591/essl:v1.67