How aijarvis0x/jarvis-api works
Main Components
• API Server: At the core is the server entry point (src/server.ts and src/app.ts). This component includes the HTTP server that initializes the routing and other middleware.
• Routing Layer: Represented by the “src/routes” directory which includes endpoints such as admin, auth, bot, category, chat, market, metadata, user, etc.
• Database: Prisma is used for database management. Indicate “prisma/schema.prisma” and migration folders as the backend relational database, keeping in mind that Prisma abstracts the actual DB.
• Job Processing/Task Scheduler: Highlight “src/lib/job-queue.ts” and the cron-like jobs (such as those in core-ai and scan) that handle background tasks.
• Blockchain/Smart Contract Integration: Using the “src/monad” folder with ABI files (e.g., market.abi.ts, mint-nft.abi.ts), include a component that connects to blockchain networks or smart contracts.
• Configurations and Environment: Illustrate config modules (e.g., in src/config) that set up environment variables, keys, and other runtime settings.
• Deployment/Containerization: Include Docker components (Dockerfile, docker-compose, ecosystem configs, and nginx.conf) that indicate how the project is containerized and may be fronted by Nginx as a reverse proxy.
Relationships and Interactions
• Service Layer making calls to the Database (Prisma) to perform queries and/or migrations.
• How middleware (plugins) wraps around the routes to enforce security (auth, CSRF, rate limiting, verification) and any validation.
• If applicable, highlight the integration with blockchain smart contracts (via the monad modules) as external service calls.
Architectural Patterns and Technologies
• Clearly label components with technologies: TypeScript for the codebase, Prisma as the ORM, PostgreSQL (or another DB backend) as the database engine, Redis as the caching/message queue layer, and Docker for containerization.
• Mention the use of middleware (fastify-zod, security-headers, etc.) to enforce validation and security.
• Micro/module separation where each route/service encapsulates a specific domain (admin, auth, market, etc.).