RESTRUCTURING AND MODERNIZATION OF THE PLANKGYM SYSTEM: A PRACTICAL APPROACH TO REFACTORING AND SECURITY IN WEB SYSTEMS
Abstract
Digital transformation in micro and small businesses poses significant challenges regarding information security and software maintenance, especially in systems developed by small teams without technical standardization. This article presents a practical case study on the analysis, refactoring, and modernization of PlankGYM, a web-based system for gym management. The article demonstrates how an application that exhibited hybrid languages, lack of centralized error handling, and vulnerabilities classified in categories A01, A03, and A05 of the OWASP Top Ten was transformed into a clean, typed, and secure architecture. Based on a static code inspection diagnosis, Clean Code practices and security mechanisms were applied, including JWT authentication, role-based access control (RBAC) at two levels of validation and entry. The results show that six of the ten OWASP Top Ten 2021 categories were directly mitigated, all server logic was covered by TypeScript, and the duplication identified in database operations was eliminated, without altering the already established business rules. This study contributes a replicable refactoring roadmap for small-scale web systems developed in academic contexts or by small teams.
Author Biographies
Undergraduate student in Systems Analysis and Development Technology at the Federal Institute of São Paulo, Jacareí Campus.
Undergraduate student in Systems Analysis and Development Technology at the Federal Institute of São Paulo, Jacareí Campus.
Master's degree in Computer Science from the Graduate Program in Computer Science (PPGI) at the Federal University of Amazonas and a Bachelor's degree in Computer Science. Works on research and development projects in the areas of Software Engineering, Software Quality, and Process Improvement. Has experience in Information Security, with an emphasis on incident handling. Professor in the Department of Informatics at the Federal Institute of São Paulo (IFSP), Jacareí Campus.
References
BOGNER, Justus; MERKEL, Manuel. To type or not to type? A systematic comparison of the software quality of JavaScript and TypeScript applications on GitHub. In: INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, 19., 2022, Pittsburgh. Proceedings… New York: ACM, 2022. p. 658–669. Disponível em: https://arxiv.org/abs/2203.11115 Acesso em: jul. 2026 DOI: https://doi.org/10.1145/3524842.3528454 DOI: https://doi.org/10.1145/3524842.3528454
BUTT, Ateeq Ur Rehman et al. An optimized role-based access control using trust mechanism in e-health cloud environment. IEEE Access, v. 11, p. 138813–138826, 2023. Disponível em: https://ieeexplore.ieee.org/document/10327710 Acesso em: jul. 2026 DOI: https://doi.org/10.1109/ACCESS.2023.3335984 DOI: https://doi.org/10.1109/ACCESS.2023.3335984
CABRAL, Raphael et al. Investigating the impact of SOLID design principles on machine learning code understanding. In: IEEE/ACM INTERNATIONAL CONFERENCE ON AI ENGINEERING — SOFTWARE ENGINEERING FOR AI, 3., 2024, Lisboa. Proceedings… New York: ACM, 2024. p. 7–17. Disponível em: https://arxiv.org/abs/2402.05337 Acesso em: jul. 2026 DOI: https://doi.org/10.1145/3644815.3644957 DOI: https://doi.org/10.1145/3644815.3644957
FOWLER, Martin. Refactoring: improving the design of existing code. Boston: Addison-Wesley Professional, 1999. ISBN 978-0-201-48567-7.
HUNT, Andrew; THOMAS, David. The pragmatic programmer: from journeyman to master. Boston: Addison-Wesley Professional, 1999. ISBN 978-0-201-61622-4.
JONES, Michael B.; BRADLEY, John; SAKIMURA, Nat. JSON Web Token (JWT). RFC 7519, Internet Engineering Task Force (IETF), maio 2015. Disponível em: https://datatracker.ietf.org/doc/html/rfc7519 Acesso em: jul. 2026. DOI: https://doi.org/10.17487/RFC7519
LATTE, Benedikt; HENNING, Sven; WOJCIESZAK, Marek. Clean code: on the use of practices and tools to produce maintainable code for long-living software. In: COLLABORATIVE WORKSHOP ON EVOLUTION AND MAINTENANCE OF LONG-LIVING SYSTEMS (EMLS), 6., 2019, Stuttgart. Proceedings… [S.l.]: CEUR-WS, 2019. p. 97–101. Disponível em: https://ceur-ws.org/Vol-2308/emls2019paper01.pdf Acesso em: jul. 2026.
MARTIN, Robert C. Clean architecture: a craftsman's guide to software structure and design. Upper Saddle River: Prentice Hall, 2017. ISBN 978-0-13-449416-6. Disponível em: https://dl.acm.org/doi/10.5555/3175742 Acesso em: jul. 2026.
MARTIN, Robert C. Clean code: a handbook of agile software craftsmanship. Upper Saddle River: Prentice Hall, 2008. ISBN 978-0-13-235088-4. Disponível em: https://dl.acm.org/doi/10.5555/1388398 Acesso em: jul. 2026.
OWASP FOUNDATION. OWASP Top Ten 2021: the ten most critical web application security risks. OWASP Foundation, 2021. Disponível em: https://owasp.org/www-project-top-ten Acesso em: jul. 2026.
TANENBAUM, Andrew S.; WETHERALL, David J. Computer networks. 5. ed. Upper Saddle River: Pearson Prentice Hall, 2011. ISBN 978-0-13-212695-3.
YANAKIEV, Ivan; LAZAR, Bogdan-Mihai; CAPILUPPI, Andrea. Applying SOLID principles for the refactoring of legacy code: an experience report. Journal of Systems and Software, v. 220, art. 112254, fev. 2025. Disponível em: https://www.sciencedirect.com/science/article/pii/S016412122400298X Acesso em: jul. 2026 DOI: https://doi.org/10.1016/j.jss.2024.112254 DOI: https://doi.org/10.1016/j.jss.2024.112254
