Simple Combination of FastAPI and Svelte.
- Clone this Repo
git clone https://github.com/Gingerbreadfork/fastapi-svelte pip install -r requirements.txtto install python dependencies (ideally in a virtualenv or similar - don't be a savage).- Run
npm create vite@latest client -- --template svelteinside root directory to create Svelte app insideclientdirectory. - Inside
clientdirectory runnpm install
-
Build Svelte app if you haven't yet (and after any future changes) with
npm run buildinside client folder -
In a second terminal run a Uvicorn server (ideally with hotreloading so it refreshes after new builds of the app are generated):
uvicorn main:app --reload
You can build some pretty interesting/weird little apps using FastAPI to create a few endpoints while also serving a nice little frontend Svelte client at the same time.