

LoginLinkX Login System - NodeJSLoginLinkX Login System - NodeJS
Login via Link system by Email, Admin Dashboard with Logs, User Management & CronJob Cleanup
LoginLinkX Login System - NodeJS
Login via Link system by Email, Admin Dashboard with Logs, User Management & CronJob Cleanup
Overview
LoginLinkX is a powerful login system via link and easy-to-use admin dashboard system designed for managing login histories and user activity logs. This product is perfect for web applications that require an efficient way to manage and monitor user login activities. With an intuitive user interface powered by Tailwind CSS and DataTables, the dashboard provides a seamless experience for admins to view login histories, track user actions, and filter logs easily.
Features
Key Features:
- Admin Authentication: Secure authentication system that provides login access to admins via a magic link sent to their email address.
- Login System Passwordless authentication mechanism allowing users to sign in by simply clicking a magic link sent to their email. Ensures ease of use and enhanced security by removing traditional passwords.
- Real-Time Logs: Track user login histories, including login timestamp, email, and whether the user has completed the authentication process.
- Pagination & Search: The logs are displayed in a paginated table, with search functionality powered by DataTables, making it easier to navigate through large sets of data.
- CronJob Log Cleanup: Automatically deletes logs older than a defined number of days. This feature is scheduled using a cronjob for regular, automated maintenance of the database, ensuring your logs are managed effectively without manual intervention.
- Responsive Design: The admin dashboard is fully responsive, so it can be accessed and used on any device with ease.
- Light & Dark Themes: Switch between light and dark modes for a more customizable user interface experience.
- Easy Setup: The system comes with a simple installation guide, allowing you to set up the system in minutes.
Technical Features:
- Back-End: Built with Node.js and Express, using PostgreSQL for data storage.
- Front-End: Designed with Tailwind CSS for clean and modern UI design. The DataTables library is used to create an interactive and user-friendly log table with sorting, filtering, and pagination capabilities.
- Security: The system uses JWT (JSON Web Tokens) for secure admin authentication and role-based access control.
- Logging and Monitoring: Comprehensive logs to monitor when users log in, whether they have used the authentication system, and other relevant data.
Requirements
Requirements
- Docker (for containerized deployment)
- Node.js (for running the backend)
- PostgreSQL (for database management)
Instructions
1. Set Up Docker
Make sure Docker is installed on your system. You can download it from : https://www.docker.com/products/docker-desktop/.
2. Configure Environment Variables
Create a .env file in the root directory of the project. Below is an example .env file configuration:
https://www.docker.com/products/docker-desktop/.
DATABASE_URL=postgres://postgres:postgres@db:5432/loginlinkx
JWT_SECRET="Your Secret key"
MAIL_USER="USE YOUR EMAIL FOR SENT"
MAIL_PASS="USE YOUR APP PASSWORD OF YOUR EMAIL"
SERVER_URL=http://localhost:3000
CLIENT_URL=http://localhost:5000
PORT=5000
NODE_ENV=production
3. Set Up Docker Compose
The project comes with a docker-compose.yml file that handles both the backend and the PostgreSQL database.
version: '3.8'
services:
backend:
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-5000}:5000"
env_file:
- .env
depends_on:
- db
db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: loginlinkx
volumes:
- pgdata:/var/lib/postgresql/data
- ./backend/db/init.sql:/docker-entrypoint-initdb.d/init.sql
volumes:
pgdata:
This configuration will set up the backend and the PostgreSQL database in Docker containers.
5. Build and Start the Application with Docker
Run the following commands to build and start the Docker containers:
docker-compose up --build
This will:
Build the Docker containers.
Start the backend and PostgreSQL services.
The backend will be available at http://localhost:5000.
6. Access the Application
Admin Dashboard: http://localhost:5000/pages/dashbard
Login Page: Magic link will be sent to your email for authentication.
7. Running Cron Jobs (Optional)
To manage logs automatically, you can set up a cron job to run periodically. In the Dockerfile, make sure you add your cron job for log deletion.
API Endpoints
POST /api/auth/send-magic-link: Sends a magic link to the user.
Request Body: { "email": "[email protected]" }
GET /api/auth/verify: Verifies the magic link token.
Query Parameter: token
GET /api/dashboard/logs: Fetches the login history for the admin (requires admin role)
Security
JWT Authentication: Ensures secure user authentication via magic link tokens.
Data Protection: All sensitive data like the JWT secret and database credentials are stored in the .env file and should not be exposed publicly.
Email Security: The system uses an application-specific password (App Password) for sending emails.
Development
If you wish to run the project in a development environment without Docker, you can do so by following these steps:
Install dependencies:
npm install
Run the server:
npm start
Access the application: The backend server will run on http://localhost:5000.
Category | Scripts & Code / NodeJS |
First release | 25 April 2025 |
Last update | 25 April 2025 |
HTML/CSS Framework | Bootstrap, YAML |
Files included | .css, .html, .db, Javascript .js |
JavaScript Framework | jQuery, Node.js |