feat: Initial project structure for expense tracker

This commit introduces the initial project structure for the expense tracker application. It includes the basic directory layout, configuration files, a FastAPI server with a `/process-expense` endpoint for n8n integration, and a `.gitignore` file to ensure a clean repository. This completes Phase 1 of the development plan.
This commit is contained in:
google-labs-jules[bot]
2025-12-16 00:20:17 +00:00
parent 3dea7a3334
commit 67802ae1f1
16 changed files with 173 additions and 0 deletions

12
.env.example Normal file
View File

@@ -0,0 +1,12 @@
# Telegram
TELEGRAM_BOT_TOKEN=
# OpenAI
OPENAI_API_KEY=
# Google Cloud
GOOGLE_APPLICATION_CREDENTIALS=
SPREADSHEET_ID=
# Environment
ENV=dev

114
.gitignore vendored Normal file
View File

@@ -0,0 +1,114 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak
venv.bak
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/

5
config/keywords.csv Normal file
View File

@@ -0,0 +1,5 @@
keyword,categoria_principal,subcategoria,tipo_gasto_default
monitor,Tecnología,Equipo de Cómputo,negocio
croquetas,Personal,Mascotas,personal
hosting,Tecnología,Dominios y Hosting,negocio
libro,Educación,Libros y Material,negocio
1 keyword categoria_principal subcategoria tipo_gasto_default
2 monitor Tecnología Equipo de Cómputo negocio
3 croquetas Personal Mascotas personal
4 hosting Tecnología Dominios y Hosting negocio
5 libro Educación Libros y Material negocio

6
config/providers.csv Normal file
View File

@@ -0,0 +1,6 @@
provider_name,aliases,categoria_principal,subcategoria,tipo_gasto_default
Amazon,"amazon,amzn,amazon mx",Por Determinar,Compras en Línea,
Office Depot,"officedepot,office",Administración,Suministros de oficina,negocio
Uber Eats,"ubereats,uber",Personal,Comida a domicilio,personal
GoDaddy,"godaddy",Tecnología,Dominios y Hosting,negocio
Cinepolis,"cinepolis",Personal,Entretenimiento,personal
1 provider_name aliases categoria_principal subcategoria tipo_gasto_default
2 Amazon amazon,amzn,amazon mx Por Determinar Compras en Línea
3 Office Depot officedepot,office Administración Suministros de oficina negocio
4 Uber Eats ubereats,uber Personal Comida a domicilio personal
5 GoDaddy godaddy Tecnología Dominios y Hosting negocio
6 Cinepolis cinepolis Personal Entretenimiento personal

8
config/user_config.json Normal file
View File

@@ -0,0 +1,8 @@
{
"user_name": "Marco Gallegos",
"rfc": "GAMM910513CW6",
"regimen_fiscal_default": "612 - Persona Física con Actividad Empresarial y Profesional",
"moneda_default": "MXN",
"pais": "MX",
"timezone": "America/Mexico_City"
}

7
requirements.txt Normal file
View File

@@ -0,0 +1,7 @@
fastapi
python-telegram-bot
openai
google-api-python-client
pydantic
uvicorn
python-dotenv

0
src/__init__.py Normal file
View File

0
src/data_models.py Normal file
View File

21
src/main.py Normal file
View File

@@ -0,0 +1,21 @@
from fastapi import FastAPI, Request
import logging
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Expense Tracker API is running."}
@app.post("/process-expense")
async def process_expense(request: Request):
"""
Receives expense data from n8n, logs it, and returns a confirmation.
"""
payload = await request.json()
logger.info(f"Received expense data: {payload}")
return {"status": "received", "data": payload}

0
src/modules/__init__.py Normal file
View File

0
src/modules/ai_agents.py Normal file
View File

View File

View File

View File

View File

View File