RH Worklife

An HR document management SaaS with a separate database for each company.

Case 03 · SaaS

The problem

An employee’s file mixes paper kept in boxes with digital documents. HR needs to know which document is missing, where each box is and who opened each file.

What the system does

  • Finds documents by employee number, name, type, branch, date and box

  • Works out missing documents by type and exports them to Excel

  • Receives electronic filings with direct upload to storage

  • Tracks the life cycle of physical boxes with a state machine

  • Records requests to withdraw, consult and return boxes

Architecture in three steps

  1. Identifies the company

    At login the password is checked with bcrypt and the signed token carries that company's database and storage.

  2. Opens only what the role allows

    Every route checks the feature, the document type and the sensitivity level before it queries.

  3. Records the actions

    The audit trail stores user, IP and time. Every box state change keeps who made it, when and why.

Security controls

  • One SQL Server database per company; the signed token says which to open

  • Company and user rechecked as active on every request

  • Permissions by feature, document type and sensitivity level

  • Passwords hashed with bcrypt and a 30-minute access token

  • Files through a presigned URL that expires in 1 hour

  • An audit trail of actions: who, from where, what and when

Stack. Backend: FastAPI, SQLAlchemy · Database: SQL Server, one per company · Files: AWS S3 · Frontend: React, TypeScript · Infrastructure: AWS ECS Fargate, Secrets Manager, GitHub Actions

See the next case