How neurprojects/neur-app works
Main Components
a. Frontend:
• Represented primarily by the "src/app" directory (with subdirectories for various user interfaces such as chat, home, account, etc.).
• UI components are contained in "src/components" – these include reusable widgets, dashboards, message components, and UI elements built with Tailwind CSS.
• State management hooks and utilities under "src/hooks" and "src/lib/utils".
b. Backend/API:
• API routes and server actions can be seen in "src/app/api" and "src/server". These files manage HTTP endpoints, real-time communication, and the orchestration of blockchain operations.
• Business logic for actions (like "action.ts", "ai.ts", "telegram.ts") in the "/src/server/actions" folder are crucial pieces to model.
c. Database Layer:
• The "prisma" directory is responsible for database migrations and schema definitions (schema.prisma). Also, helper methods for database access exist in "src/lib/prisma" and "src/server/db".
d. External Integrations:
• Several blockchain integrations (Solana features) are implemented under "src/ai/solana" and “src/lib/solana” as well as providers like Jupiter, Magic Eden, Dexscreener, pump.fun, etc.
• External services (DeFi protocols, NFT suites, wallet operations) should be depicted as separate but connected blocks that interact with the backend.
e. Development & Deployment Infrastructure:
• Configuration and deployment files such as Dockerfile.local, docker-compose.yml, vercel.json, and CI/CD GitHub configuration directives (in .github) indicate containerized/local development and validation pipelines.
• A separate section for deployment and environment configuration components.
Relationships and Interactions
• From the client (Frontend UI) to the API endpoints (src/app/api) when users interact with the application (chat messages, wallet operations, etc.).
• From these endpoints to the server actions (src/server/actions) where request processing and orchestration occur.
• From server actions to the database (through Prisma) for operations like chat persistence or user model updates.
• From server actions to external blockchain services (through solana integrations) for executing on-chain transactions, querying market data, or updating wallet portfolios.
• Asynchronous or scheduled operations (e.g., the cron jobs under "/src/app/api/cron") that manage recurring tasks like subscriptions or minute-based operations.
Architectural Patterns/Design Principles
• Full-Stack Separation: Clearly delineate the frontend (React/Next.js-based pages and components) from the backend API (server actions and endpoints).
• Modularized Architecture: Note the division of logic between UI components, hook-based state management, API layers, and server-side business logic.
• Integration Layer: A dedicated layer for blockchain interactions—illustrate connectors for each external integration (i.e., Solana's DeFi, NFTs, and wallet management).
• Database Abstraction: Use of Prisma migrations and ORM indicates an abstraction layer for interacting with the underlying database.
• CI/CD & Local Development: Mark the configuration aspects (e.g., Docker, .env.example) as part of the infrastructure facilitating consistent environments.
Detail Level
• Don’t hesitate to include smaller modules (specialized components in “src/ai”, “src/lib/solana”, or even hooks) if they play an important role in integrations or UI behavior.
• Where helpful, note underlying technologies (TypeScript, Tailwind CSS, Next.js, Prisma) alongside the respective components.