p10: add Examples Gallery page

swadhinbiswas committed 3 months ago
5421d21
1 parent b7b034a
commit 5421d21
1 file changed
+49 -0
▼docs_site/src/content/docs/examples/index.md
+49-0
1
+---
2
+title: Examples Gallery
3
+description: Runnable code examples demonstrating JustAPI features.
4
+---
5
+
6
+## Getting Started
7
+
8
+| Example | Description | File |
9
+|---|---|---|
10
+| [Hello World](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/01_hello_world.py) | Basic GET and parameterized routes | `examples/01_hello_world.py` |
11
+| [Path & Query Params](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/02_path_query_params.py) | URL parameters and query strings | `examples/02_path_query_params.py` |
12
+| [Request Body](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/03_request_body.py) | JSON body validation with Pydantic | `examples/03_request_body.py` |
13
+
14
+## Core Features
15
+
16
+| Example | Description | File |
17
+|---|---|---|
18
+| [Dependencies](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/04_dependencies.py) | Dependency injection with Depends | `examples/04_dependencies.py` |
19
+| [Middleware](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/05_middleware.py) | Request/response interception | `examples/05_middleware.py` |
20
+| [Error Handling](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/06_error_handling.py) | Custom exception handlers | `examples/06_error_handling.py` |
21
+| [File Uploads](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/07_file_uploads.py) | Multipart form data | `examples/07_file_uploads.py` |
22
+| [Routers](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/08_routers.py) | Modular APIRouter | `examples/08_routers.py` |
23
+| [DB Integration](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/09_db_integration.py) | Database read/write | `examples/09_db_integration.py` |
24
+| [WebSockets](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/10_websockets.py) | Real-time bidirectional comms | `examples/10_websockets.py` |
25
+
26
+## Advanced
27
+
28
+| Example | Description | File |
29
+|---|---|---|
30
+| [Plugin System](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/plugin_cache.py) | Custom plugin with caching | `examples/plugin_cache.py` |
31
+| [Agent Demo](https://github.com/swadhinbiswas/JustAPI/blob/main/examples/agent_demo/app.py) | MCP tools, sessions, streaming | `examples/agent_demo/app.py` |
32
+
33
+## Full Application
34
+
35
+The [demo_shop](https://github.com/swadhinbiswas/JustAPI/tree/main/demo_shop) is a complete e-commerce application with 23 endpoints:
36
+
37
+- Catalog (categories, products, sellers)
38
+- Customers (register, lookup)
39
+- Cart (add, remove, checkout)
40
+- Orders (create, list, status lifecycle)
41
+- Reviews (CRUD, analytics)
42
+
43
+All examples are in the [`examples/`](https://github.com/swadhinbiswas/JustAPI/tree/main/examples) directory of the repository.
44
+
45
+## See Also
46
+
47
+- [Tutorials](/tutorials/hello-world/) — Step-by-step guides
48
+- [API Reference](/api-reference/) — Complete API docs
49
+- [CLI Scaffolder](/getting-started/cli-scaffolder/) — Generate project templates
0
50