Repository navigation
[FEAT, TEMPLATE, DOCS] v2.0.0 stage 4: next steps, feature guide, SQL-backed items - #97
Merged
Merged
Conversation
…pt comments, SQL-backed items
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
✅ Template Inspection Passed All changed templates have been validated successfully. Last updated: 2026-12-03T04:09:46.009Z |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requesting Merging
Description
Fourth staged PR for v2.0.0: what the user gets right after generation.
fastkit initandfastkit startdemoend with a Next steps panel that is true for the run (package manager,--no-venv,--no-install,--in-place, database, migrations). The generated README carries the same list for a fresh checkout.layered,domainandproduction, the example/itemsAPI is stored in the selected SQL database.The list and the sections are built as data in the generation layer, so the web generator in the next stage renders the same content.
Type of Change
Test Environment
EncodingWarningfromfastapi_fastkitas errors: 5595 passed, 33 skippedLC_ALL=C,PYTHONUTF8=0),-m "not extended": 5499 passed, 33 skippedos/signalattributes removed): 5587 passed, 41 skippedmkdocs build --strict: passesdev: 99%layered,domainandproductionwith PostgreSQL, MySQL and SQLite, with and without Alembic, plusdomainwith MongoDB and threesingle-fileselections. Their own tests,ruff check,ruff format --check, black, isort andmypy srcpass./openapi.jsoncompared before and after: unchanged forlayered+ SQLite,domain,domain+ PostgreSQL andproduction; forsingle-filewith features only the/healthoperation id and summary change.down/up:productiondefaults (PostgreSQL, Alembic, JWT):migrateexits 0, then register, token and/users/medomain+ MySQL 8.4 + Alembic, with the defaultcaching_sha2_passwordauthenticationdomain+ SQLite + Alembic (database file in a volume)domain+ PostgreSQL + JWT without Alembic (tables created at startup)layered+ PostgreSQL + Alembic + Celery, andlayered+ PostgreSQL without AlembicDATABASE_URLin.env.Not verified: MySQL and MongoDB under Docker Compose after the service URL change (checked with
docker compose config; the MySQL run above was before it), real Windows.Major Changes
After generation
initandstartdemo, replacing the single "runfastkit runserver" line. It leaves out steps the run already did and adds the ones it skipped.uv run uvicorn ...), between<!-- fastkit:next-steps:start -->and<!-- fastkit:next-steps:end -->. Generating again into the same folder replaces only that block..envsettings and a link. Level templates used as they are, and--templateprojects, get the steps only.Concept comments
hello8,single-file4,layered12,domain12,production19). Code added byaddroutehas none.SQL-backed
/itemslayered,domainandproductionwith PostgreSQL, MySQL or SQLite: async SQLAlchemy model and data access in the level's own layout; tests run on in-memory SQLite. With Alembic the initial revision creates the table, otherwise it is created at startup.layeredthe JSON-file store, its mock data and its tests are not generated for such a project; routes, schemas and responses stay the same.addroutein such a project still adds an in-memory resource and prints a note pointing at the SQL-backed example.single-filesrc/main.py; no preset regeneratesmain.pyany more. The settings move tosrc/core/config.pyonly when a generated module reads them.src/core/config.pyexists and does not definesettings.Dependencies, Docker, config
fastapi>=0.141.1); a version the user pins wins.aiosqliteas a dev dependency. MySQL projects installaiomysql[rsa].migrateservice runsalembic upgrade headbefore the app and worker start. With SQLite the database file is kept in a volume.DATABASE_URL,MONGODB_URL) are set in the compose file and no longer taken from.env, so a localhost URL written there for running on the host does not reach the containers.migrateand worker services share one image, built once.version(PEP 440) sets[project].versionof the generated project.Tests and docs
index.mdpages only the sample output changed.Screenshots (optional)
N/A
Etc
single-moduleandminimalprojects keep the template'ssrc/main.pyandtests/test_main.py, and their database module moves fromsrc/config/database.pytosrc/core/database.py;classic-layeredwith a SQL database getssrc/models/items.pyand nosrc/mocks/;domain-starterwith PostgreSQL no longer getssrc/app/db/.single-fileprojects with features, the/healthoperation id changes fromhealth_check_health_gettohealth_health_get. ADATABASE_URLin.envor the shell no longer overrides the URL the containers use.docker compose run migrateon a checkout that has not been built yet does not find the image;docker compose up --buildbuilds it.addroutedoes not generate SQL-backed resources; an in-place run over an existinglayeredproject that switches it to a SQL database leaves the oldtests/test_item_store.pybehind; the tests that need FastAPI installed are skipped in CI, because the dev dependency group does not include it.