Skip to content
vfernandezg.devProjectsContact
All projects

TG Intranet · Tesla Group

Corporate intranet that replaced a SaaS CRM and chains of spreadsheets with one system for sales, quoting, people, logistics and reporting.

Login screen of the Tesla Group intranet, with the company logo, the corporate e-mail and password fields and the sign-in button
Role
IT lead. Sole developer, project manager and Scrum master
Period
Jun 2026 — Present
Status
In progress
Stack
  • Kotlin
  • Spring Boot
  • Angular
  • PostgreSQL
  • Python
  • Redis
  • Docker

Tesla Group is an electrical engineering and industrial integration company in Trujillo, Peru. I build and run its intranet as the only developer: an Angular app, a Kotlin core service and a Python data service on one PostgreSQL database. The code and the system are private, so this page describes the architecture and leaves out business data.

What it covers

  • CRM: accounts, opportunity pipeline and proposals.
  • Quoting with revisions and Excel export, and a price catalog.
  • Field rosters and hours, and logistics product coding.
  • Sales and project cost dashboards.
  • Document comparison: it reads quotation and purchase-order PDFs and proposes fields for a person to verify.

Accounting and sales-order modules exist in rehearsal mode. They mirror the ERP until a cutover.

How it works

Architecture diagram. An Angular app behind nginx, a Kotlin core service, PostgreSQL and Redis, a Python service that replicates the ERP, and a document-processing worker

  • Modular monolith, hexagonal per context. Each business context is a pair of Gradle modules: a core with pure Kotlin domain code, and an adapter module with Spring. Domain modules do not have Spring on the classpath, so importing it does not compile.
  • Rules as tests. More than 50 ArchUnit rules cover dependency cycles, isolation between contexts, “every endpoint requires a permission” and “every request body is validated”.
  • Integration through the database. The Python service replicates the SaaS ERP through its API into PostgreSQL and rebuilds the reporting tables. There is no HTTP between services. PostgreSQL LISTEN/NOTIFY feeds a WebSocket hub that refreshes open screens.
  • Access control. Roles by section and action, with per-user overrides and data scope. Objects outside a user’s scope answer 404. The audit log is append-only, enforced by a database trigger.
  • Document processing. A worker with a restricted database role claims runs from an inbox table, extracts with OCR and a language model, and stores a literal citation for each field. It proposes; a person decides.

Engineering practice

  • CI pins actions by commit and images by digest, scans with gitleaks, Semgrep and Trivy, and publishes images only from the main branch.
  • Integration tests run against real PostgreSQL and Redis. Golden tests reproduce a real quoting workbook cell by cell.
  • A sandbox mode runs the same image with synthetic data.

The intranet is also the subject of my capstone project and thesis at Universidad Privada Antenor Orrego.