Skip to content

Urigo/accounter-fullstack

Repository files navigation

Accounter

Manage your taxes.

Getting started

  1. Switch to the correct version of Node.js:
nvm use $(cat .node-version)
  1. Install dependencies:
yarn install
  1. Create .env file:
cp .env.template .env
  1. Run setup:

If you want to create new local database, run:

yarn local:setup

In case you already have a database, you can set the database variables in your .env file, then run:

yarn setup
  1. Run client and server:
yarn build
yarn client:dev
yarn server:dev
# Also helpful while developing:
yarn generate:watch

Or use the VSCode Terminals extension: fabiospampinato.vscode-terminals to run all this for you in different terminals.

  1. Visit http://localhost:3001/ and sign in. The credentials to log in are in your .env file under AUTHORIZED_USERS. Set the hashed password in the .env file. e.g. replace SECRET with $2b$10$SuqbDX5r6qZidiMbAcGnFOPloNQSRQrLEPShZjplabtfdN.QzS4ba. And then use the password SECRET to log in.

  2. Seed the database with your business details. Edit scripts/seed.ts with your info, then run yarn seed.

  3. Load your data into the database (first set correct env vars):

yarn scrape
  1. Generate businesses by visiting http://localhost:4000/graphql

Set your headers at the bottom:

{
  "authorization": "Basic [YOUR_TOKEN]"
}

You can find YOUR_TOKEN by in the GraphQL request headers in your browser's Network tab.

Then run this mutation:

mutation {
  batchGenerateBusinessesOutOfTransactions {
    id
    name
  }
}

Testing

The test suite is organized into three projects for efficiency:

  • Unit tests (yarn test): Fast, isolated tests with no external dependencies
  • Integration tests (yarn test:integration): DB-backed tests requiring PostgreSQL and migrations
  • Demo seed E2E (yarn test:demo-seed): Full seed-and-validate pipeline (slow, ~10-30s)

Running Tests

# Fast unit tests only (default, no DB required)
yarn test

# Unit + integration tests (requires DB + migrations)
yarn test:integration

# Demo seed E2E (requires DB + migrations + ALLOW_DEMO_SEED=1)
ALLOW_DEMO_SEED=1 yarn test:demo-seed

Prerequisites for Integration/Demo Tests

Integration and demo-seed tests require:

  1. PostgreSQL running: Start with docker compose -f docker/docker-compose.dev.yml up -d postgres
  2. Migrations applied: Run yarn workspace @accounter/migrations migration:run
  3. Demo seed only: Set ALLOW_DEMO_SEED=1 environment variable

If migrations are stale, demo-seed tests fail gracefully with instructions to run migrations.

See packages/server/README.md for detailed test harness documentation.

Miscellaneous

Multiple Bank Branches

For Poalim Bank and Discount Bank accounts, your account may appear under multiple branch numbers:

  • Your account number and bank number remain the same
  • The same account might be associated with 2-3 different branch numbers
  • You can configure all relevant branch numbers in the scripts/seed.ts file

Enable Google Drive

  1. Go to Google Cloud Console
  2. Create a project or select existing one
  3. Enable Google Drive API:
    • Navigate to "APIs & Services" > "Library"
    • Search for and enable "Google Drive API"
  4. Create API key:
    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "API Key"
    • Restrict the key to Google Drive API only
  5. Add to your .env:
    GOOGLE_DRIVE_API_KEY=your_api_key_here
    

Enable OCR (with Anthropic)

  1. Sign up for an Anthropic API key at https://console.anthropic.com/settings/keys
  2. Add to your .env:
    ANTHROPIC_API_KEY=your_api_key_here
    
  3. OCR functionality will now be available for processing images and documents

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 11