Development and Implementation of a REST API for Project Management with Hapi. js and MySQL
Development and Implementation of a REST API for Project Management with Hapi. js and MySQL
Marco Antonio Celis Crisóstomo
TLDR
The obtained results demonstrate that the proposed solution significantly reduces access and information manipulation times compared to traditional monolithic systems, provides a uniform and predictable interface based on the HTTP protocol, and facilitates integration with different types of clients such as web, mobile, or desktop applications.
Abstract
In this article, the design, development, and implementation of a Representational State Transfer Application Programming Interface (REST API) aimed at the comprehensive management of collaborative projects in organizational environments is described. The solution was built using the Hapi.js framework within the Node.js ecosystem, supported by a MySQL relational database, and incorporates robust authentication mechanisms, role-based authorization, and structured validation of input data. The system architecture includes five interconnected functional modules: user management with status and role control, project administration with status tracking, task management with priority levels, chronological tracking records, and document attachment control linked to both projects and specific tasks. Regarding security, the platform uses password encryption through bcrypt, stateless authentication with JSON Web Tokens (JWT), and a password recovery workflow that sends a temporary key via email. To validate all incoming data, the Joi library was used, ensuring that the information is correct before performing any database operations. The UUID standard was employed for the creation of unique identifiers within the system resources. The normalized relational database design supports five main entities (users, projects, tasks, tracking records, and documents), establishing referential integrity relationships that ensure information consistency. The obtained results demonstrate that the proposed solution significantly reduces access and information manipulation times compared to traditional monolithic systems, provides a uniform and predictable interface based on the HTTP protocol, and facilitates integration with different types of clients such as web, mobile, or desktop applications. Hapi.js was chosen because its route configuration is declarative and because it offers native schema validation, which helps make the code easier to maintain and scale.
