AccurateA is an AI-powered accounting automation platform built for UK small businesses and accounting practices. The server provides a RESTful API for financial data management, AI-driven transaction classification, bank reconciliation, VAT compliance, and HMRC MTD integration.
- Python 3.11+
- PostgreSQL 15+
- Tesseract OCR (for document processing)
- An OpenAI API key (for AI classification features)
git clone <repository-url>
cd server
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCopy the example file and fill in your values:
cp .env.example .envOpen .env and configure the required variables (see Environment Variables section below).
alembic upgrade headuvicorn main:app --reloadThe API will be available at http://localhost:8000.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
SECRET_KEY |
Yes | JWT signing secret |
ALGORITHM |
No | JWT algorithm (default: HS256) |
ACCESS_TOKEN_EXPIRE_MINUTES |
No | Token expiry in minutes (default: 60) |
APP_ENV |
No | development or production (default: development) |
DEBUG |
No | Enable debug mode (default: True) |
OPENAI_API_KEY |
No | Required for AI classification and agents |
PINECONE_API_KEY |
No | Required for vector-based pattern matching |
PLAID_CLIENT_ID |
Yes | Plaid API credentials |
PLAID_SECRET |
Yes | Plaid API credentials |
TRUELAYER_CLIENT_ID |
No | TrueLayer Open Banking credentials |
TRUELAYER_CLIENT_SECRET |
No | TrueLayer Open Banking credentials |
FRONTEND_URL |
No | Frontend origin for CORS (default: http://localhost:5173) |
SENTRY_DSN |
No | Sentry error monitoring DSN |
SENTRY_TRACES_SAMPLE_RATE |
No | Sentry performance sampling rate (default: 0.2) |
When running in development mode, interactive API documentation is available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc - OpenAPI JSON:
http://localhost:8000/openapi.json
These endpoints are disabled in production for security.
Build and run with Docker:
docker build -t accuratea-server .
docker run -p 8000:8000 --env-file .env accuratea-serverRun the test suite:
python -m pytest tests/Run individual test files:
python test_security.py
python test_db.py