Skip to content

Commit d457d07

Browse files
authored
Merge pull request #512 from nanotaboada/chore/claude-settings
chore(docs): update Claude config and architecture diagram
2 parents eb8f0ba + 6920e1a commit d457d07

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

.claude/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"model": "claude-sonnet-4-6"
3+
}

CLAUDE.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CLAUDE.md
2+
3+
@.github/copilot-instructions.md

README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful/badge)](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful)
88
[![License: MIT](https://img.shields.io/badge/License-MIT-3DA639.svg)](https://opensource.org/licenses/MIT)
99
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
10-
![GitHub Copilot](https://img.shields.io/badge/GitHub_Copilot-enabled-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
10+
![GitHub Copilot](https://img.shields.io/badge/GitHub_Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
1111
![Claude](https://img.shields.io/badge/Claude-Sonnet_4.6-D97757?logo=claude&logoColor=white&labelColor=181818)
1212
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/nanotaboada/python-samples-fastapi-restful?utm_source=oss&utm_medium=github&utm_campaign=nanotaboada%2Fpython-samples-fastapi-restful&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews&labelColor=181818)
1313

@@ -95,7 +95,7 @@ Proof of Concept for a RESTful API built with [Python 3](https://www.python.org/
9595
}
9696
}}%%
9797
98-
graph RL
98+
graph BT
9999
%% Core application packages
100100
main[main]
101101
routes[routes]
@@ -108,46 +108,42 @@ graph RL
108108
fastapi[FastAPI]
109109
sqlalchemy[SQLAlchemy]
110110
pydantic[Pydantic]
111-
aiocache[aiocache]
112111
113112
%% Test coverage
114113
tests[tests]
115114
116-
%% Module dependencies (solid arrows = imports)
115+
%% Module dependencies
117116
routes --> main
118-
databases --> main
117+
fastapi --> main
119118
services --> routes
120119
models --> routes
120+
databases --> routes
121121
schemas --> services
122-
databases --> services
122+
models --> services
123+
databases --> schemas
124+
fastapi --> routes
125+
sqlalchemy --> routes
126+
sqlalchemy --> services
127+
sqlalchemy --> schemas
123128
sqlalchemy --> databases
124129
pydantic --> models
125-
fastapi --> routes
126-
aiocache --> routes
127-
main --> tests
128-
129-
%% Runtime composition (dotted arrows = main creates/wires)
130-
fastapi -.-> main
131-
services -.-> main
130+
main -.-> tests
132131
133132
%% Node styling
134133
classDef core fill:#b3d9ff,stroke:#6db1ff,stroke-width:2px,color:#555,font-family:monospace;
135134
classDef deps fill:#ffcccc,stroke:#ff8f8f,stroke-width:2px,color:#555,font-family:monospace;
136135
classDef test fill:#ccffcc,stroke:#53c45e,stroke-width:2px,color:#555,font-family:monospace;
137136
138137
class main,routes,services,schemas,databases,models core
139-
class fastapi,sqlalchemy,pydantic,aiocache deps
138+
class fastapi,sqlalchemy,pydantic deps
140139
class tests test
141140
```
142141

143-
**Arrow Semantics:**
144-
145-
- **Solid arrows** represent import-time module dependencies. For example, `services → routes` means the services package is imported and used by the routes package.
146-
- **Dotted arrows** represent runtime composition. The `fastapi` app instance and wired services flow into `main` at startup.
142+
**Arrow Semantics:** Solid arrows represent import-time module dependencies — the arrow points from the dependency to the consumer. The dotted arrow to `tests` indicates the integration tests validate the full application stack as wired by `main`.
147143

148-
**Composition Root Pattern:** The `main` module acts as the composition root, creating the FastAPI app and registering all routers. This pattern enables dependency injection via `Depends()`, improves testability, and maintains clear separation of concerns.
144+
**Composition Root Pattern:** The `main` module acts as the composition root — it imports `FastAPI` and the route modules, creates the app instance, and registers all routers. This pattern enables dependency injection via `Depends()`, improves testability, and maintains clear separation of concerns.
149145

150-
**Layered Architecture:** HTTP requests flow through distinct layers: `routes``services``schemas``databases`. Each layer has a specific responsibility — routes handle HTTP mapping, validation, and in-memory caching, services contain business logic, schemas define the ORM model, and databases manage the async session.
146+
**Layered Architecture:** Each layer has a specific responsibility — routes handle HTTP mapping, validation, and in-memory caching, services contain business logic, schemas define the ORM model, and databases manage the async session.
151147

152148
**Color Coding:** Core packages (blue) implement the application logic, external dependencies (red) are third-party frameworks and ORMs, and tests (green) ensure code quality.
153149

0 commit comments

Comments
 (0)