Employin is a simple web application for companies to track when users enter or leave their workplace. Users can easily record their arrival and departure with a single click, and can also add past time points. All activity is displayed on the home page for easy review.
- One-click "Join" (arrival) and "Leave" (departure) tracking
- Add past time points
- Activity log displayed on the home page
- Magic Link login and registration
- Restrict registration to specific email domains (optional)
- Backend: Elixir, Phoenix Framework, LiveView
- Frontend: Tailwind CSS
- Database: PostgreSQL
- Elixir & Erlang installed
- PostgreSQL installed and running
- Node.js (for asset compilation)
- direnv (optional, for loading environment variables)
-
Clone the repository:
git clone <your-repo-url> cd employin
-
Set up environment variables:
- Copy
.envrc
to your project root (or use your own method to set environment variables). - Edit the values as needed.
- Copy
-
Install dependencies:
mix deps.get cd assets && npm install && cd ..
-
Set up the database:
mix ecto.setup
-
Run the server:
mix phx.server
Visit http://localhost:4000 in your browser.
All variables below are required unless otherwise noted.
Variable | Description |
---|---|
SECRET_KEY_BASE | Phoenix secret key (generate with mix phx.gen.secret ) |
DATABASE_URL | PostgreSQL connection string (e.g., ecto://USER:PASS@HOST/DB ) |
PHX_HOST | Hostname for the app (e.g., localhost , example.com ) |
ORIGINS | Allowed CORS origins (comma-separated) |
PORT | Port to run the server on (e.g., 4000 ) |
TOKEN_SECRET | Secret for token generation |
TOKEN_SALT | Salt for token generation |
EMAIL_NAME | Display name for outgoing emails |
EMAIL_FROM | Email address for outgoing emails |
SMTP_USERNAME | AWS SES SMTP username |
SMTP_PASSWORD | AWS SES SMTP password |
SMTP_ENDPOINT | AWS SES SMTP endpoint (e.g., email-smtp.us-west-2.amazonaws.com ) |
SMTP_PORT | AWS SES SMTP port (e.g., 587 ) |
EMAIL_DOMAIN | (Optional) Restrict registration to this email domain |
There are currently no automated tests.
A Dockerfile will be added soon. For now, deploy as a standard Phoenix application.
MIT