# Svelte + Appwrite = 🚀
## Appwrite svelte template
Blazing fast development with done backend and fully-prepared frontend.
CMS ready!
## Appwrite installation
[Appwrite installation](https://appwrite.io/docs/installation)
## Frontend included
* tailwind
* scss
* css reset
* typescript
* routing
* ready routes
* oauth
* files upload, download
* folder structure
* common components
* service worker
* path aliases
* database realtime subscribers
* database paginate, infinity scroll
* i18n
* cms
* cms forms components
* vite
* prettier
* editorconfig
* icons: [Bootstrap icons](https://icons.getbootstrap.com/)
## Database subscribers
```svelte
{#if $loading}
Loading data from database...
{:else}
{#each [...$subscriber, ...$insertSubscriber] as item}
{item.name}
{/each}
{/if}
{#each $scrollData as item}
{item.name}
{/each}
console.log(e) /* on every fetch from scroll dispatcher do some action */} />
```
## Files subscribers
```svelte
```
## Routing
Routes can be added in `__routes.ts` file. Every route is fetched lazyly.
```ts
export default defineRoutes({
routes: [
{
path: '/',
component: () => import('$routes/index.svelte'),
before: () => get(user).isLoggedIn && navigate('/dashboard') // before route is rendered call before function
},
{
path: '/oauth',
component: () => import('$routes/oauth/index.svelte')
},
{
path: '/oauth/failure',
component: () => import('$routes/oauth/failure.svelte'),
loading: LoadingCircle // loading component can be choosed for every route
},
{
path: '/oauth/success',
component: () => import('$routes/oauth/success.svelte'),
layout: LayoutReset // layout component can be choosed for every route
},
],
layout: Layout, // default layout component (__layout.svelte)
loading: Loading, // default loading component (__loading.svelte)
})
```
### Routes structure
`__layout.svelte` the default layout for every page
`__error.svelte` the error page (404 error)
`__loading.svelte` the default loading component
`__routes.ts` the file includes all routes in application
## Social auth
```svelte
```
## i18n
Locale file `src/locales/en.json`
```json
{
"page": {
"home": {
"title": "Appwrite svelte rocket start 🚀"
}
}
}
```
```svelte
{$_('page.home.title')}
Change language:
```
## path aliases
`$lib` = `src/lib`
`$root` = `/`
`$src` = `src`
`$cms` = `src/cms`
`$routes` = `src/routes`
## commands
```bash
npm run dev
```
```bash
npm run build
```
```bash
npm run preview
```
```bash
npm run appwrite
```