1.3 KiB
1.3 KiB
Quickstart: SvelteKit Integration
This guide provides instructions for setting up and running the SvelteKit frontend integrated with the FastAPI backend.
Prerequisites
- Node.js 18+
- Python 3.9+
npm
Frontend Setup
-
Initialize SvelteKit:
cd frontend # (Assuming migration to SvelteKit structure) npm install -
Development Mode: Run the SvelteKit development server:
npm run devThe frontend will be available at
http://localhost:5173. -
Build for Production: Generate the static SPA files:
npm run buildThe output will be in the
frontend/builddirectory.
Backend Setup
-
Install Dependencies:
cd backend pip install -r requirements.txt -
Run Backend:
python src/app.pyThe backend will serve the static frontend files from
frontend/build.
Verification Steps
- Navigation: Open
http://localhost:8000(backend URL). Click on "Settings" and verify the URL changes to/settingswithout a page reload. - Deep Linking: Refresh the page at
http://localhost:8000/settings. Verify the Settings page loads correctly. - Data Loading: Verify that the Dashboard correctly lists available plugins and Settings shows the current configuration.