How josefranciscocruzcorro/near-hackaton works
Tesorero is a multi-tenant AI treasury application: users import bills, run an agent that proposes payments, apply deterministic policy checks, route exceptions to human approvers, and settle authorized payments across chains through NEAR Intents. The frontend reaches the .NET API; application services coordinate domain decisions, persistence, and external integrations. Treasury setup, funding, monitoring, audit/export, and signup are additional product paths. Some relationships below are documented in the README rather than verified in unsampled implementation files.
Main entry points: Endpoints.cs HTTP endpoints · router.tsx Product routes · AgentService.cs Agent planning · queries.ts API queries
Components 27
User experience
- Web application
frontend/src/App.tsx - Product routes
frontend/src/router.tsx - Bill intake
frontend/src/pages/Bills.tsx - Agent and approvals
frontend/src/pages/Agent.tsx - Treasury console
frontend/src/pages/Treasury.tsx - Payee management
frontend/src/pages/Payees.tsx - API client
frontend/src/api/client.ts - API queries
frontend/src/api/queries.ts - Session and roles
frontend/src/auth/AuthContext.tsx
API and application
- HTTP endpoints
backend/src/Tesorero.Api/Endpoints/Endpoints.cs - Tenant signup
backend/src/Tesorero.Application/Services/SignupService.cs - Agent planning
backend/src/Tesorero.Application/Services/AgentService.cs - Payment workflow
backend/src/Tesorero.Application/Services/PaymentService.cs - Dashboard data
backend/src/Tesorero.Application/Services/DashboardService.cs - Treasury operations
backend/src/Tesorero.Application/Services/TreasuryVaultServices.cs - Application interfaces
backend/src/Tesorero.Application/Abstractions/Abstractions.cs - Scheduled jobs
backend/src/Tesorero.Infrastructure/Jobs/Jobs.cs
Policy and identity
- Policy engine
backend/src/Tesorero.Domain/Policies/PolicyEngine.cs - Invoice security
backend/src/Tesorero.Domain/Security/InjectionDetector.cs
Chain integrations
- DeepSeek model
backend/src/Tesorero.Infrastructure/External/DeepSeekClient.cs - NEAR Intents API
backend/src/Tesorero.Infrastructure/External/OneClickIntentsClient.cs - NEAR RPC
backend/src/Tesorero.Infrastructure/Near/NearAccountsClient.cs - Treasury chain client
backend/src/Tesorero.Infrastructure/Near/TreasuryChainClient.cs - Treasury contract
contracts/treasury/src/lib.rs
Tenant data
- Tenant database
backend/src/Tesorero.Infrastructure/Persistence/AppDbContext.cs
Other components
- Business user
- Auditor
Connections 31
- Business user → Web application: uses
README.md - Web application → Product routes: renders
frontend/src/App.tsx - Product routes → Bill intake: routes to
frontend/src/router.tsx - Product routes → Agent and approvals: routes to
frontend/src/router.tsx - Product routes → Treasury console: routes to
frontend/src/router.tsx - Product routes → Payee management: routes to
frontend/src/router.tsx - Bill intake → API queries: requests data
README.md - Agent and approvals → API queries: requests data
README.md - Treasury console → API queries: requests data
README.md - Payee management → API queries: requests data
README.md - API queries → API client: calls
frontend/src/api/queries.ts - Session and roles → API client: configures auth
frontend/src/auth/AuthContext.tsx - API client → HTTP endpoints: HTTP requests
README.md - HTTP endpoints → Tenant signup: calls
backend/src/Tesorero.Api/Endpoints/Endpoints.cs - HTTP endpoints → Dashboard data: calls
backend/src/Tesorero.Api/Endpoints/Endpoints.cs - HTTP endpoints → Agent planning: calls
backend/src/Tesorero.Api/Endpoints/Endpoints.cs - HTTP endpoints → Payment workflow: calls
backend/src/Tesorero.Api/Endpoints/Endpoints.cs - Agent planning → Policy engine: evaluates proposals
backend/src/Tesorero.Application/Services/AgentService.cs - Agent planning → DeepSeek model: requests plans
README.md - Agent planning → Invoice security: flags invoices
README.md - Payment workflow → NEAR Intents API: quotes and tracks
README.md - Payment workflow → Treasury chain client: submits payments
README.md - Treasury operations → NEAR Intents API: converts deposits
README.md - Treasury operations → NEAR RPC: checks accounts
README.md - Treasury operations → Treasury chain client: manages treasury
README.md - Treasury chain client → Treasury contract: calls contract
README.md - Dashboard data → Tenant database: reads tenant data
backend/src/Tesorero.Application/Services/DashboardService.cs - HTTP endpoints → Tenant database: persists records
- Scheduled jobs → Agent planning: runs scheduled
README.md - Scheduled jobs → Payment workflow: tracks settlement
README.md - Auditor → Web application: reviews and exports
README.md