Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ce6372e
feat(vite): auto-load templates with template helper and config flag
bedus-creation Jun 20, 2026
ffed730
Merge pull request #133 from fastapi-startkit/task/vite-auto-templates
bedus-creation Jun 20, 2026
0562c63
Revert "feat(vite): auto-load templates + Template helper + config flag"
bedus-creation Jun 20, 2026
b37ed2e
Merge pull request #134 from fastapi-startkit/revert-133-task/vite-au…
bedus-creation Jun 20, 2026
8fb2b3d
feat(vite): auto-load Jinja2 templates from the Vite provider
bedus-creation Jun 20, 2026
ca3cbae
Merge pull request #135 from fastapi-startkit/feature/vite-auto-load-…
bedus-creation Jun 20, 2026
bcf9ca1
feat(vite): re-export ViteConfig from vite package root
bedus-creation Jun 20, 2026
5f1988b
feat(masoniteorm): re-export all relationship classes from package root
bedus-creation Jun 20, 2026
61a13db
test(masoniteorm): drop relationship re-export test
bedus-creation Jun 20, 2026
b256966
Merge pull request #137 from fastapi-startkit/feature/export-orm-rela…
bedus-creation Jun 20, 2026
18c9502
refactor(vite-app): move templates to resources/templates and use pro…
bedus-creation Jun 20, 2026
6d3d7f1
refactor(vite-app): resolve templates via canonical app accessor
bedus-creation Jun 20, 2026
685ec72
refactor(vite-app): move providers into app/ package
bedus-creation Jun 20, 2026
6217d94
test(vite-app): add simple HTTP tests for web routes
bedus-creation Jun 20, 2026
7c0fc93
chore: drop accidental .coverage binary and ignore coverage artifacts
bedus-creation Jun 20, 2026
0c33b9f
Merge origin/main into feature/export-viteconfig
bedus-creation Jun 20, 2026
e129d9a
test(vite-app): remove hot file workaround from index page test
bedus-creation Jun 20, 2026
161f1fc
test(vite-app): rename test_web to test_web_routes
bedus-creation Jun 20, 2026
b8cc904
test(vite-app): drop asset and vite directive assertions
bedus-creation Jun 20, 2026
c2d3814
test(vite-app): rename TestWebRoutes to TestHomeController
bedus-creation Jun 20, 2026
f313317
Merge pull request #136 from fastapi-startkit/feature/export-viteconfig
bedus-creation Jun 20, 2026
990e842
feat(ai): back the Agent with LangChain/LangGraph, keep the public AP…
bedus-creation Jun 23, 2026
478e72e
refactor(ai): config package + Lab provider/model resolution; wire Ag…
bedus-creation Jun 23, 2026
2dd8e40
wip(ai): drop create_agent — init_chat_model + hand-rolled Runner too…
bedus-creation Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
**/.env
**/*.sqlite
**/*.vite
**/.coverage
**/.coverage.*
**/htmlcov/
**/coverage.xml
fastapi_startkit/dist
fastapi_startkit.github.io.git
laravel-repo
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/category.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import HasMany, HasManyThrough
from fastapi_startkit.masoniteorm import HasMany, HasManyThrough

if TYPE_CHECKING:
from app.models.course import Course
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/course.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import BelongsTo, HasMany, BelongsToMany, MorphMany
from fastapi_startkit.masoniteorm import BelongsTo, HasMany, BelongsToMany, MorphMany

if TYPE_CHECKING:
from app.models.category import Category
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/lesson.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import BelongsTo, MorphMany
from fastapi_startkit.masoniteorm import BelongsTo, MorphMany

if TYPE_CHECKING:
from app.models.course import Course
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/profile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import BelongsTo
from fastapi_startkit.masoniteorm import BelongsTo

if TYPE_CHECKING:
from app.models.user import User
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/review.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import MorphTo
from fastapi_startkit.masoniteorm import MorphTo

class Review(Model):
__table__ = "reviews"
Expand Down
2 changes: 1 addition & 1 deletion example/database-app/app/models/user.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING

from fastapi_startkit.masoniteorm.models import Model
from fastapi_startkit.masoniteorm.relationships import HasMany, HasOne, BelongsToMany
from fastapi_startkit.masoniteorm import HasMany, HasOne, BelongsToMany

if TYPE_CHECKING:
from app.models.profile import Profile
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from pathlib import Path

from fastapi import FastAPI
from starlette.templating import Jinja2Templates

from fastapi_startkit.fastapi import FastAPIProvider as BaseFastAPIProvider

Expand All @@ -14,11 +11,6 @@ def register(self) -> None:
)
self.app.use_fastapi(fastapi)

# Bind Jinja2Templates so ViteProvider can inject vite() globals into it.
templates_dir = Path(self.app.base_path) / "templates"
templates = Jinja2Templates(directory=str(templates_dir))
self.app.bind("templates", templates)

def boot(self) -> None:
super().boot()

Expand Down
3 changes: 1 addition & 2 deletions example/vite-app/bootstrap/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from fastapi_startkit.logging import LogProvider
from fastapi_startkit.vite import ViteProvider

# from config.vite import ViteConfig
from providers.fastapi_provider import FastAPIProvider
from app.providers.fastapi_provider import FastAPIProvider

app: Application = Application(
base_path=Path(__file__).resolve().parent.parent,
Expand Down
2 changes: 2 additions & 0 deletions example/vite-app/config/vite.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ class ViteConfig:
asset_url: str = ""
static_url: str = "/build"
mount_static: bool = True
template: bool = True
templates_directory: str = "resources/templates"
3 changes: 3 additions & 0 deletions example/vite-app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ fastapi-startkit = { path = "../../fastapi_startkit", editable = true }
[dependency-groups]
dev = [
"dumpdie>=1.5.0",
"httpx>=0.28.1",
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
]
3 changes: 3 additions & 0 deletions example/vite-app/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
asyncio_mode = auto
pythonpath = .
6 changes: 3 additions & 3 deletions example/vite-app/routes/web.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse

from fastapi_startkit.application import app

web = APIRouter()


@web.get("/", response_class=HTMLResponse)
async def index(request: Request):
from bootstrap.application import app

templates = app.make("templates")
templates = app().make("templates")
return templates.TemplateResponse(request, "index.html")


Expand Down
Empty file.
14 changes: 14 additions & 0 deletions example/vite-app/tests/test_case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from abc import ABC
from typing import TYPE_CHECKING

from fastapi_startkit.testing import TestCase as BaseTestCase

if TYPE_CHECKING:
from fastapi_startkit.application import Application


class TestCase(BaseTestCase, ABC):
def get_application(self) -> "Application":
from bootstrap.application import app

return app
18 changes: 18 additions & 0 deletions example/vite-app/tests/test_web_routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from fastapi_startkit.fastapi.testing import HttpTestCase

from tests.test_case import TestCase


class TestHomeController(TestCase, HttpTestCase):
async def test_health_endpoint_returns_ok(self):
response = await self.get("/api/health")

response.assert_ok()
assert response.json() == {"status": "healthy"}

async def test_index_page_renders(self):
response = await self.get("/")

response.assert_ok()
body = response.text
assert "FastAPI StartKit" in body
75 changes: 72 additions & 3 deletions example/vite-app/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions fastapi_startkit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ ai = [
"anthropic>=0.49.0",
"openai>=1.0.0",
"google-generativeai>=0.8.0",
"langchain>=1.0.0",
"langchain-core>=1.0.0",
"langgraph>=1.0.0",
]

[dependency-groups]
Expand All @@ -68,6 +71,9 @@ dev = [
"sqlalchemy[asyncio]>=2.0.38",
"fastapi[standard]>=0.124.4",
"faker>=40.13.0",
"langchain>=1.0.0",
"langchain-core>=1.0.0",
"langgraph>=1.0.0",
]


Expand Down
24 changes: 5 additions & 19 deletions fastapi_startkit/src/fastapi_startkit/ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
"""FastAPI Startkit AI module.

Provides a LangGraph-powered declarative API for building AI agents backed
by Anthropic, OpenAI, or Google provider SDKs.

Also exposes a Laravel-style fluent API for image generation and text-to-speech::

from fastapi_startkit.ai import Image, Audio, Document

image = await Image.of("A donut on a counter").generate()

# With a photo attachment
doc = await Document.from_url("https://example.com/photo.jpg")
image = await Image.of("Make impressionist").attachments([doc]).generate()

audio = await Audio.of("Hello world").female().generate()
"""

from .agent import Agent
from .audio import Audio, AudioResponse
from .audio_factory import AudioFactory
from .config import AIConfig, AnthropicConfig, GoogleConfig, OpenAIConfig
from .config.config import AnthropicConfig, ElevenLabsConfig, GoogleConfig, OpenAIConfig
from .config.ai import AIConfig
from .decorators import max_steps, max_tokens, memory, model, provider, timeout, top_p
from .document import Document
from .fakes import fake_chat_model
from .image import Image, ImageResponse
from .image_factory import ImageFactory
from .providers.ai_provider import AIProvider
Expand All @@ -38,6 +22,8 @@
"AudioResponse",
"AudioFactory",
"Document",
"ElevenLabsConfig",
"fake_chat_model",
"GoogleConfig",
"Image",
"ImageFactory",
Expand Down
Loading
Loading