A role-based web app to track employee client visits, generate daily Excel reports, and automate email updates to admins. Built with Next.js, PostgreSQL, and secure authentication, it streamlines reporting for efficient operational oversight.
Released/Created At 2024/9/03This web application, built with Next.js, PostgreSQL, TailwindCSS with ShadCN UI, Lucia for secure authentication, and tools like xlsx
and Nodemailer, enables companies to track employee visits to clients and streamline reporting workflows. Employees can record visit details, generate daily reports, and send them automatically to admins, helping businesses maintain organized, accessible records.
Role-Based Access Control
The application uses three roles User
, Admin
, and Root
to establish specific permissions:
User: Can create visit records with details such as company name, visit reason, and additional notes. They can also send a daily report of their visits to admins.
Admin: Has the authority to manage companies, view all user records, and receive daily reports.
Root: Has full administrative rights, including managing users, creating companies, and viewing all logs and records.
Excel Report Generation with xlsx
The app uses the xlsx
library to compile daily records into an Excel report, which contains details of client visits. This feature allows users to generate their reports quickly, reducing the need for manual data entry and ensuring that admins receive a standardized report format.
Automated Email Reporting with Nodemailer
To streamline reporting, the application uses Nodemailer to send automated emails containing the daily Excel report as an attachment to admins. This setup ensures that admins have timely access to daily activity summaries, keeping them informed without additional manual processing.
Responsive, User-Friendly UI
Designed with TailwindCSS and ShadCN UI, the interface is intuitive and responsive, allowing users to easily log visits, navigate records, and interact with the app on both desktop and mobile devices.
Secure Authentication and Role-Based Permissions
Lucia manages user authentication and session handling, providing a secure login experience. The role-based permissions system restricts access based on user roles, protecting sensitive data and limiting administrative functions to authorized users.
1. Logging Visits and Notes
Users can log essential details of their client visits, such as company name, visit reason, and additional notes. Admins and root users can review these logs to monitor performance and client interactions.
2. Excel Report Generation
Using the xlsx
library, users can generate an Excel report at the end of each day, compiling all visit records into an organized, easy-to-read format. This simplifies tracking and documentation for users and admins alike.
3. Emailing of Reports
The Nodemailer integration ensures that these reports are automatically sent to admins daily, allowing for efficient report management without requiring users to manually send emails.
Next.js: Manages frontend and backend seamlessly.
PostgreSQL: Provides robust data storage for users, companies, and logs.
TailwindCSS & ShadCN UI: Creates a responsive, user-friendly interface.
Lucia Auth: Manages secure authentication and role-based permissions.
xlsx
: Generates daily Excel reports of visits.
Nodemailer: Automates daily email reporting, keeping admins updated.
User Workflow
Users log in, record client visits, add notes, and generate a daily report, which is automatically emailed to admins.
Admin Workflow
Admins can manage client companies, review all user logs, and receive daily Excel reports from all users.
Root Workflow
The root user has access to all functions, including managing user roles, creating companies, and generating or viewing comprehensive reports.
This employee visit tracking app provides an efficient, automated solution for managing client visits. The role-based access, daily reporting, and automated email system minimize manual work, enhance visibility, and offer a clear, organized view of employee-client interactions. This scalable, secure application is a valuable tool for optimizing operational oversight and data management.