Technical Dossier: Syma.pe
Technical Objectives
As CTO and co-founder of Syma.pe, I led the creation and evolution of an integrated Point of Sale (POS) solution for Peruvian companies, with a particular focus on electronic invoicing according to SUNAT standards.
This project aimed to solve local market challenges and offer efficient tax tools. Below are the four stages of the Syma.pe project, detailing the Technical Objectives, Technical Challenges, Technologies Used, Technical Limitations, and Technical Details.
Date: 2018-2023
Stage 1: MVP
Technical Objectives
- Develop basic POS functionalities.
- Implement electronic invoicing using SOAP APIs with WSDL.
- Iterate quickly based on customer feedback.
Technical Challenges
- Understand and apply UBL 2.1 for electronic invoicing.
- Package a web product for local use.
- Maintain consistent versions across multiple clients.
Technologies Used
- CodeIgniter: PHP framework that facilitated rapid implementation through its MVC structure, allowing separation of business logic from presentation.
- jQuery: JavaScript library for DOM manipulation and events, providing a dynamic and responsive user interface.
- MySQL: Relational database used to store transactional data and inventories, optimized with indexes and prepared statements to improve performance.
Technical Limitations
- Initial lack of knowledge of SOAP APIs and UBL 2.1, resulting in a considerable learning curve.
- Manual software updates, causing inconsistencies between client versions.
- Dependence on SUNAT’s service availability for sending electronic documents, causing issues during service outages.
Technical Details
- SOAP APIs with WSDL: Implementation of XML web services for integration with SUNAT, using tools like SoapUI for testing and debugging. PHP classes were designed and implemented to generate and consume these services, handling common errors and exceptions.
- Distribution and Packaging: The software was packaged using custom installers for Windows and Linux, employing Bash scripts and batch files to automate deployment. Updates were manual, distributed via installers to clients, resulting in version inconsistencies.
Stage 2: Monolith
Technical Objectives
- Expand the software’s functionalities to include inventory management, expense control, and user management.
- Migrate to a more robust and structured monolithic architecture.
- Introduce the concept of SaaS and manage subscriptions.
Technical Challenges
- Assume the role of Tech Leader and lead a development team.
- Perform initial integrations with cloud servers (first Linode and then AWS).
- Optimize document submission to SUNAT using asynchronous queues.
Technologies Used
- Laravel: PHP framework that provided a solid MVC structure, using Eloquent ORM for database interaction and Blade for view generation.
- Redis: In-memory database used for session caching and frequently accessed data, significantly improving system performance.
- Vue.js: JavaScript framework to create a reactive and modular user interface, with state management using Vuex.
- Nginx: Web server and reverse proxy configured for efficient handling of concurrent connections, load balancing, and static content caching.
Technical Limitations
- Retraining on new technologies such as Laravel and Redis.
- Challenges in managing and leading a team of developers.
- Migrating clients from a one-time payment model to a monthly subscription.
Technical Details
- Asynchronous Queues in Laravel: Use of Redis as a backend for Laravel Queue, handling background tasks such as document submission to SUNAT and report generation. Workers were configured on separate servers to process queues efficiently, using Horizon to monitor the queues.
- Cloud Integration: Deployment in Linode using a single server (Single Server Deployment) and then migration to AWS, utilizing EC2 for the main infrastructure and RDS for the database. Terraform scripts were used to manage the infrastructure as code, allowing for reproducible and scalable management. Additionally, CI/CD practices were implemented to automatically deploy updates.
Stage 3: Microservices
Technical Objectives
- Decouple the monolith into microservices to improve scalability and maintenance.
- Implement specific services using optimal languages and technologies for each case.
- Adopt agile methodologies to improve development efficiency.
Technical Challenges
- Coordination of multiple languages and technologies.
- Database migrations (from MySQL to PostgreSQL and MongoDB).
- Ensuring consistency and availability of distributed services.
Technologies Used
- Python: Used for generating electronic documents for SUNAT, employing Flask to build lightweight and efficient microservices.
- Node.js: Development of additional backend services, using Express.js and Koa.js to efficiently manage routes and middleware.
- PostgreSQL: Advanced relational database, configured with replication and partitioning to handle large volumes of data and improve availability.
- MongoDB: Used for storing issued documents, configured with sharding and replicated clusters for high availability and performance.
- ElasticSearch: Search engine for fast indexing and searching of documents and products, utilizing inverted indexes and real-time analysis capabilities.
- AWS Lambda: Serverless functions for cloud processing, using Step Functions to coordinate complex workflows.
Technical Limitations
- Complexity in managing and deploying multiple microservices.
- Requires advanced knowledge in various technologies and tools.
- Need for sophisticated infrastructure to support microservices architecture.
Technical Details
- Decoupling the Monolith: Identifying key business domains and restructuring them into independent microservices. RESTful APIs were implemented for inter-service communication, using JWT for authentication and authorization.
- Orchestration and Containers: Use of Docker and Kubernetes for the deployment and orchestration of microservices, facilitating horizontal scalability and efficient resource management. CI/CD pipelines were configured with Jenkins and GitLab CI for automated deployment. Prometheus was used for monitoring and Grafana for metrics visualization.
Stage 4: Intellectual Property Sale
Technical Objectives
- Prepare the platform for transfer and adapt it to the buyer’s new environment.
- Ensure all business and technical processes are documented and transferable.
- Maintain software integrity and operability during and after the transfer.
- Provide technical support and expert knowledge during the transition period.
Technical Challenges
- Fully document the code, architecture, and operational processes to facilitate transfer.
- Ensure compatibility of the infrastructure with the buyer’s environment.
- Migrate data and services without significant user interruptions.
- Provide post-sale technical support to ensure service continuity and buyer satisfaction.
Technologies Used
- Git: Version control system to manage source code and coordinate collaboration among multiple developers. GitFlow was used to organize the workflow and maintain code stability.
- Docker: Containerization of the application to ensure it is portable and easy to deploy in the buyer’s environment.
- Terraform: Infrastructure as code tool used to define and provision the cloud infrastructure in a reproducible and scalable manner.
- Jira: Project management platform to coordinate tasks related to intellectual property transfer, ensuring all milestones and deliverables are achieved on time.
- Confluence: Collaborative documentation tool to maintain and share all technical and operational documentation in an accessible and organized manner.
Technical Limitations
- Complexity in migrating data and services to the buyer’s infrastructure.
- Need to ensure all security and regulatory compliance aspects are maintained during the transfer.
- Management of client transition and post-sale support to ensure service continuity.
- Effective coordination between the seller’s and buyer’s technical teams to avoid misunderstandings and ensure a smooth transfer.
Technical Details
- Comprehensive Documentation: Creation of detailed technical documentation covering everything from architecture diagrams and data flows to API specifications and standard operating procedures. Confluence and ReadTheDocs were used to keep documentation accessible and up-to-date. This documentation includes installation guides, user manuals, and maintenance procedures.
- Containerization and Orchestration: Use of Docker to containerize all services, ensuring they are easily deployable in any environment. Kubernetes was used to orchestrate these containers, facilitating application management and scalability.
- Infrastructure Migration: Planning and execution of the migration from the existing infrastructure to the buyer’s, using AWS migration tools to ensure a seamless transition. User Acceptance Testing (UAT) was conducted to validate the software’s functionality post-migration and ensure it meets the buyer’s requirements.
- Security and Compliance: Thorough review of all security policies and regulatory compliance to ensure the transferred software meets all applicable regulations. Additional security measures, such as data encryption in transit and at rest, were implemented to protect sensitive information during the transfer.
- Post-Sale Support: Establishment of a post-sale support period during which technical assistance and problem resolution will be provided. A dedicated team was assigned to handle buyer inquiries and ensure a smooth transition, minimizing impact on end users.