This project utilizes FastAPI for the API and Svelte for the frontend application.
You can run the FastAPI application after building the Svelte files, or alternatively, launch FastAPI first and then Vite in development mode for an enhanced development experience.
The Sveltekit application uses adapter-static
to create an SPA.
pip
to install Python dependenciespnpm
to manage Node.js dependenciesClone the repository:
git clone http://github.com/yann-dubrana/fastapi-svelte-template.git
cd fastapi-svelte-template
Install Python dependencies:
pip install -r requirements.txt
Install Node.js dependencies:
cd app
pnpm install
To build the Svelte files, run:
cd app
pnpm build
After building the Svelte files, launch the FastAPI application:
uvicorn main:app --reload
For a better development experience, first launch the FastAPI application:
uvicorn main:app --reload
Then, in another terminal, start Vite in development mode:
cd app
pnpm dev
http://localhost:8000/docs
http://localhost:8000/