Transforming 3-4 hours of manual work into 10 seconds
- About
- Features
- Tech Stack
- Screenshots
- Getting Started
- Architecture
- API Documentation
- Deployment
- Roadmap
- Contributing
- License
- Contact
Pan Tributario is a full-stack SaaS application that automates the extraction and processing of Ecuadorian tax forms (SRI Forms 103 & 104). Built to solve a real problem faced by accountants and businesses, it reduces manual data entry from 3-4 hours per client to just 10 seconds.
Ecuadorian accountants manually extract financial data from PDF tax forms:
- Form 103 (Retenciones): 10+ fields per document
- Form 104 (IVA): 130+ fields across 7 sections
- Time required: 3-4 hours per client
- Monthly workload: 150-200 hours for 50 clients
- Error rate: ~5% due to manual entry
Automated PDF processing with:
- β‘ 1,440x faster processing (3-4 hours β 10 seconds)
- β Zero errors through automated extraction
- π Professional reports (Excel & PDF exports)
- π₯ Multi-client management with yearly summaries
- π Complete data isolation between users
- π€ Drag-and-drop PDF upload with bulk processing
- π Automatic form detection (103 vs 104)
- π Intelligent field extraction using regex patterns
- πΎ Client management organized by company and year
- π Yearly accumulations for tax reporting
- π Professional exports (Excel with formulas, branded PDFs)
- π¨ Dark mode with proper contrast ratios
- π± Mobile responsive design
- π Real-time processing with progress indicators
- π― Guest mode (5 free documents, no signup)
- βΎοΈ Unlimited access for registered users
- π Google OAuth 2.0 integration
- π Bcrypt password hashing
- π€ reCAPTCHA v3 bot protection
- π‘οΈ Multi-tenant architecture with complete user isolation
- πͺ Secure session management
- β‘ Async processing for optimal performance
- πΎ 10 database tables with proper relationships
- π 35+ API endpoints (RESTful)
- π Analytics dashboard for admins
- π CDN integration (Cloudflare) for 70%+ cache rate
- Node.js 18+ and npm
- Python 3.11+
- PostgreSQL 15+
- Docker (optional)
git clone https://github.com/CapBraco/tax_form_processor.git
cd tax_form_processorcd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
# Edit .env with your database credentials
# Run migrations
alembic upgrade head
# Start server
uvicorn main:app --reloadBackend will run at http://localhost:8000
cd frontend
# Install dependencies
npm install
# Create .env.local file
cp .env.example .env.local
# Edit .env.local with your backend URL
# Start development server
npm run devFrontend will run at http://localhost:3000
DATABASE_URL=postgresql://user:password@localhost:5432/taxforms
SECRET_KEY=your-secret-key-min-32-characters
FRONTEND_URL=http://localhost:3000
GOOGLE_CLIENT_ID=your-google-oauth-client-id
GOOGLE_CLIENT_SECRET=your-google-oauth-secret
RECAPTCHA_SECRET_KEY=your-recaptcha-secretNEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=your-recaptcha-site-key# Build and run with docker-compose
docker-compose up -d
# Access the application
# Frontend: http://localhost:3000
# Backend: http://localhost:8000βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT LAYER β
β (Next.js Frontend - React Components & TypeScript) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β HTTPS/REST API
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API LAYER β
β (FastAPI - Async Python with Pydantic validation) β
β β
β ββββββββββββ βββββββββββββ ββββββββββββ β
β β Auth β β Upload β β Clients β β
β β Routes β β Routes β β Routes β β
β ββββββββββββ βββββββββββββ ββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β SQLAlchemy ORM
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATABASE LAYER β
β (PostgreSQL - 10 Tables, JSONB fields) β
β β
β users β’ documents β’ form_103_data β’ form_104_data β
β guest_sessions β’ temporary_files β’ analytics β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. User uploads PDF β Frontend validates file
2. API receives file β Saves to temp storage
3. pdfplumber extracts text β Regex patterns parse fields
4. Data saved to database β Async SQLAlchemy commit
5. Frontend polls status β Real-time updates
6. Success response β Display extracted data
Key Tables:
users- Authentication and profilesdocuments- Metadata for uploaded PDFsform_103_data- Extracted data from Form 103form_104_data- Extracted data from Form 104 (130 fields)guest_sessions- Temporary sessions with document limits
Interactive API documentation available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
POST /api/auth/register # Create new account
POST /api/auth/login # Login with credentials
POST /api/auth/google # Google OAuth login
POST /api/auth/logout # Logout
GET /api/auth/me # Get current userPOST /api/upload/bulk # Upload multiple PDFs
GET /api/documents # List user documents
GET /api/documents/{id} # Get document details
DELETE /api/documents/{id} # Delete documentGET /api/forms-data/103/{id} # Get Form 103 data
GET /api/forms-data/104/{id} # Get Form 104 dataGET /api/clientes # List user clients
GET /api/clientes/{name} # Get client details
POST /api/clientes/export # Export to Excel/PDF-
Backend Service
- Build:
Dockerfileinbackend/ - Start:
uvicorn main:app --host 0.0.0.0 --port $PORT - Environment: Production variables from Railway
- Build:
-
Frontend Service
- Build:
npm run build - Start:
npm run start - Environment: Production variables from Railway
- Build:
-
PostgreSQL Database
- Managed by Railway
- Automatic backups
- Connection string in
DATABASE_URL
- Point DNS to Railway (CNAME)
- Configure Cloudflare for CDN
- Enable SSL/TLS (Full strict mode)
- Set up page rules for caching
- Form 101 support (Impuesto a la Renta)
- Form 106 support (ATS)
- Email notifications
- Bulk document deletion
- Mobile app (React Native)
- API for third-party integrations
- Advanced analytics dashboard
- Scheduled reports (weekly/monthly)
- Multi-language support (English)
- WhatsApp notifications
- Collaborative features (team accounts)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please read CONTRIBUTING.md for details on our code of conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
Bryan A Paucar - @devbraco
Project Link: https://github.com/CapBraco/tax_form_processor
Live Demo: https://tax.capbraco.com
- Inspired by real-world accounting workflows in Ecuador
- Thanks to my father for inspiring me to build this app
- Built with modern web technologies and best practices
- Special thanks to the FastAPI and Next.js communities
Made with β€οΈ by Bryan A Paucar
β Star this repo if you find it helpful!





