Skip to main content

RPA Templates

In order to improve standardization and take all derived benefits(common develop structure, rewriting same boilerplate code, avoid forgetfulness, reduce PR time and so on) in our team, I implemented 2 templates.

These template are stored in this RPA repository .

In order to satisfy our developments architecture I have defined a template for active services (webapp and be) and one for passive (scheduled, one shot) both descripted below.

As said these are template, are not intended to be used as they are. They create a base for new developments. The developer MUST customize for its own development. If needed the repository can be edited to adapt developers needs.

Active

Stored in "webapp" folder, this template cover the following features:

  • Docker: 
    • Composes: 4 compose file by env with be, worker, db and msg broker services integrated with volumes, restart policy, ports, dependencies and labels;
    • Dockerfile: multistage uv production ready dockerfile (could be necessary add dependecies in some cases)
  • Repository utils:
    • Precompiled .dockerignore
    • Precompiled .gitignore
    • Precompiled README.md
    • All set of .env templates
    • python and uv basics:
      • uv.lock (with packages used in active template)
      • .python-version
      • pyproject.toml
  • Web
    • Frontend:
      • index.html: basic form (text and file) template with input validation, connection handling, task process visualization (status, progress, errors), status pooling, task revoking, local browser persistence and output download
    • Backend:
      • Basic FastAPI boilerplate modules (main.py, database.py, health.py)
      • Utilities: bucket support (upload, download, presigned url for output), standard logger for webapp and for single task observability
      • Dependencies: user profiling dependencies 
      • Task Handling:
        • Schemas: Defined schemas for input and responses
        • Models: Predefined models for db definition, standard statuses and error codes
        • CRUD: API and DB task standard operations (create, read, update, delete)
        • Worker: Main task template (celery setup, task phases progression) and scheduled cleanup for stale tasks
Passive

This template is made for  passive processes such as scheduled, one shot or on request.
Based on the longevity and the precision the development requires we can choose to have or not a DB to save tasks history.

Stored in "scheduled" folder, this template cover the following features:

  • Docker: 
    • Composes: 4 compose file by env with process and db services integrated with volumes, restart policy, ports, dependencies and labels;
    • Dockerfile: multistage uv production ready dockerfile (could be necessary add dependecies in some cases)
  • Repository utils:
    • Precompiled .dockerignore
    • Precompiled .gitignore
    • Precompiled README.md
    • All set of .env templates
    • python and uv basics:
      • .python-version
      • pyproject.toml
  • Standard logger for process and for single task observability
  • Notify:
    • SMTP: functions to send alert via mail w/ to and cc handling
    • UptimeKuma: function to ping uptime kuma after process end
  • Database: Schemas, init, env var config, models for run history, status standardization and CRUD
  • FileServer: connectivity check, I/O paths exploration, files saving and archiving
  • Tests: Simple mockup for task handling