Tubo

Tubo - E-Invoicing Platform

A technical assessment project for an e-invoicing platform that validates and submits invoices to a mocked government API.

Tech Stack

Database Schema

Key Features

Environment Variables

Copy .env.example to .env and configure:

DATABASE_URL=postgresql://postgres:password@host:6543/postgres
DATABASE_URL_DIRECT=postgresql://postgres:password@host:5432/postgres
JWT_SECRET=your-secret-key-here
GOV_API_URL=http://localhost:3000/api/mock-gov
GOV_API_KEY=your-gov-api-key

Setup

  1. Install dependencies:
    npm install
    
  2. Configure environment variables (see above)

  3. Run migrations:
    npm run migrate
    
  4. Seed database:
    npm run seed
    

Running the Application

Start the development server:

npm run dev

Start the background worker (in a separate terminal):

npm run worker

API Endpoints

Frontend Pages

Seed Data

After running npm run seed, you can login with:

Architecture Decisions

Database Connections

Worker Processing

Money Handling

Security