Here is a clean, professional README.md tailored for the PetroData Leave Portal. It highlights the tech stack we've implemented, including the new Maroto PDF engine and the MailerSend integration.
A specialized Internal Tools dashboard designed for PetroData Limited to manage employee leave requests. The system automates the workflow from staff application to final executive approval, featuring automated PDF archiving and multi-stage email notifications.
- Staff Submission: Employee submits a leave request via the portal.
- Line Manager Review: Manager receives an email with a secure token to Approve/Reject.
- HR Recommendation: Upon manager approval, HR receives the request to verify policy compliance.
- MD Final Verdict: The Managing Director provides the final decision.
- Automated Archiving: Once fully approved, the system generates an official PDF record and dispatches it to the Staff and HR archives.
- Backend: Go (Golang 1.22+)
- Database: PostgreSQL (GORM)
- PDF Engine: Maroto v2 (High-performance, grid-based PDF generation)
- Email Service: MailerSend API (via
mailersend-go) - Frontend: Vanilla JavaScript (ES6+), Tailwind CSS, SweetAlert2
- Infrastructure: Docker, Kubernetes, Hosted on Render
Located in service/pdf_generator.go, this module uses the Maroto grid system to construct official documents in-memory. It eliminates the need for temporary file storage, ensuring high security and speed.
Located in service/emailer.go, it handles multi-part emails with Base64-encoded PDF attachments. It supports asynchronous dispatching using Go routines to ensure zero lag for the end-user.
The system uses unique, non-sequential UUIDs for every approval stage. This allows managers and executives to take action directly from their email without requiring a full login session for every click.
- Clone the repository:
git clone https://github.com/JpUnique/petrodata-leave-project.git
cd petrodata-leave-project
- Install dependencies:
go mod tidy
- Run the server:
go run main.go
- Access the Portal:
Open
http://localhost:8080in your browser.
- MailerSend 422 Error: If you see
Trial account unique recipients limit, ensure your sending domain is verified in the MailerSend dashboard or reuse existing recipient emails for testing. - PDF Layout: If the logo is missing in the PDF, ensure
assets/newlogo.pngis placed correctly at the root level.
Would you like me to add a "Contribution" section or a specific "API Documentation" table to this README?