This is a template for a SvelteKit project specifically designed to be deployed to Cloudflare Pages with a fully working local development environment that simulates several Cloudflare services such as KV store, D1 database, and R2 storage.
Clone the project and install the dependencies:
git clone https://github.com/johnrcui/sveltekit-cloudflare.git
cd sveltekit-cloudflare
npm install
To start the local development server:
npm run dev
View the app in a browser at localhost:5173.
Follow instructions in the Cloudflare Pages documentation to deploy the app to Cloudflare Pages.
For additional help, you can refer to the SvelteKit documentation.
The demo consists of
On initial load, the app will not have a database or storage created. You can initialize the database and storage by clicking the "Initialize" button.
To reset the demo, you can delete the database and storage by deleting the .data
directory in the root of the project.