agentleFS
donvitodonvito/ai-backends/.cursor/rules/project-structure.mdc

ai-backends / rules

Cursor rule146 starsChanged 14 months agoApache-2.0View on GitHub

This document outlines the recommended folder structure for the AI Backends project. The main entry point is src/index.ts, which initializes the application. Contains route definitions for the application's API endpoints. Examples include: - routes/keywords.ts - Keyword extraction endpoint - routes/summarize.ts - Text summarization endpoint - routes/describeImage.ts - Image description endpoint Contains validation schemas for request and response data. Contains business logic and external API interactions. - services/ai.ts - AI service layer - services/ollama.ts - Ollama service layer - services/openai.ts -…

The file

Files
project-structure.mdc
---
description: 
globs: 
alwaysApply: true
---
# AI Backends Project Structure

This document outlines the recommended folder structure for the AI Backends project.

## Main Structure

The main entry point is [src/index.ts](mdc:src/index.ts), which initializes the application.

```
ai-backend/
├── src/                    # Source code
│   ├── config/             # App configuration, env vars
│   ├── controllers/        # Route controllers (handle request/response)
│   ├── middlewares/        # Express middlewares
│   ├── models/             # Data models
│   ├── routes/             # Route definitions
│   ├── services/           # Business logic
│   ├── utils/              # Utility functions
│   ├── schemas/            # Validation schemas
│   └── index.ts            # App entry point
├── tests/                  # Test files
│   ├── unit/
│   ├── integration/
│   └── fixtures/           # Test data
├── dist/                   # Compiled output
├── docs/                   # Documentation
└── scripts/                # Utility scripts
```

## Key Directories

### src/routes/

Contains route definitions for the application's API endpoints. Examples include:
- [routes/keywords.ts](../../src/routes/keywords.ts) - Keyword extraction endpoint
- [routes/summarize.ts](../../src/routes/summarize.ts) - Text summarization endpoint
- [routes/describeImage.ts](../../src/routes/describeImage.ts) - Image description endpoint

### src/schemas/

Contains validation schemas for request and response data.

### src/services/

Contains business logic and external API interactions.
- [services/ai.ts](../../src/services/ai.ts) - AI service layer
- [services/ollama.ts](../../src/services/ollama.ts) - Ollama service layer
- [services/openai.ts](../../src/services/openai.ts) - OpenAI service layer
- [services/anthropic.ts](../../src/services/anthropic.ts) - Anthropic service layer
- [services/openrouter.ts](../../src/services/openrouter.ts) - OpenRouter service layer

### src/utils/

Contains utility functions used throughout the application.

## Build Process

The build configuration is defined in [tsconfig.json](mdc:tsconfig.json) and build scripts are in [package.json](mdc:package.json).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.