* Updates to README * Add some badges and screenshots |
||
|---|---|---|
| .github | ||
| src | ||
| static | ||
| .DS_Store | ||
| .eslintignore | ||
| .eslintrc.cjs | ||
| .gitignore | ||
| .npmrc | ||
| .prettierrc.cjs | ||
| LICENSE | ||
| README.md | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.cjs | ||
| svelte.config.js | ||
| tailwind.config.cjs | ||
| tsconfig.json | ||
| tsnode-loader.js | ||
| vite.config.ts | ||
README.md
Webnative App Template
The Webnative App Template is a clone-and-go template for building a web application using Webnative, fast. Clone, customize, and deploy to have a running distributed app in mere minutes.
🤔 What's Webnative?
The Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:
- user accounts (via the browser's Web Crypto API),
- authorization (using UCAN)
- encrypted file storage (via the Webnative File System, backed by the InterPlanetary File System, or IPFS)
- and key management (via websockets and a two-factor auth-like flow).
Webnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's Webnative Guide.
📦 What does this template give me?
🥰 Silky-smooth end-user flows
The Webnative App Template provides a silky-smooth user experience out of the box. Creating an account and linking a second device feels familiar, comfortable, and obvious. Webnative authentication is key-based rather than password-based, so we've focused heavily on the authentication flows, borrowing language and screens from two-factor auth flows.
🧱 Built with a modern web stack
The app template is built with modern web technologies:
- SvelteKit (powered by Vite under the hood)
- TypeScript
- Tailwind
- DaisyUI
👩🏫 A simple Webnative demo to learn from
The app template includes a functioning application: an image gallery. Check out the image gallery code to learn how a Webnative application handles things like file uploads, directories, etc.
🚀 Getting Started
You can try out the template yourself here.
Ready? Let's go:
-
Clone the repository:
git clone git@github.com:fission-codes/webnative.git -
Install the dependencies.
npm install -
Start the local development server.
npm run dev -
Navigate to
http://localhost:5173in your web browser.
🛠 Customize your app
The app template is designed to be easy for you to make it your own. Here's how:
-
Rename your application.
In
/src/lib/app-info.ts:- Change
appNameto the name of your app. - Change
appDescriptionto a simple, 1-sentence description of your app. - Once you deploy your app, change
appURLto the production URL.
In
package.json, changenameto your application's name. - Change
-
Customize your app's logo.
- App Logo SVG can be customized in
/src/components/icons/Brand.svelte. Target an image that is 35 pixels high. - Replace the favicon files in
/staticby following the instructions in this blog post - Generate a Twitter/Social Media Embed image.
- In
/src/lib/app-info.ts, changeappImageURLto match the URL of your embed image. - In
/src/routes/__layout.svelte, updateog:image:widthandog:image:heightto the size of your embed image.
- In
- App Logo SVG can be customized in
-
Customize the look and feel.
The app template is built using Tailwind and DaisyUI. You can customize basic theme colors by editing
/tailwind.config.css. Check out the DaisyUI Theme Generator to play around with theme colors or read the customization guide to customize the component appearance. -
Clear out the app's home page.
The home page content is in
/src/routes/index.svelte. Delete everything in the file (but don't delete the file!) to start over with a blank home page. -
Remove the image gallery demo app code.
If you're not building an image gallery, you don't need the gallery demo code, except perhaps to learn from. To get rid of it, delete:
/src/lib/gallery.svelte/src/routes/gallery.svelte/src/components/gallery- the
galleryStorein/src/stores.ts - the
initializeFilesystemfunction in/src/lib/auth/account.tscreates directories used by WNFS. Change those to what you need for your app or delete them if you're not using WNFS.
👏 You're ready to start adding custom functionality! 🚀
Check out the Webnative Guide for Webnative questions or UCAN.xyz for UCAN questions.
🧨 Deploy
The Webnative App Template demo is currently hosted on Netlify, but it should be supported on any static hosting platform (Vercel, Cloudflare Pages, etc).
Fission App Hosting
Coming soon!
You can't currently deploy to Fission's app hosting infrastructure. SvelteKit Single-Page Applications require redirects in order to support routing. Redirects are not currently supported by IPFS, so the Fission Publish GitHub action is not yet supported.
There is work underway to extend IPFS http gateways to support redirects. Once that is merged, deploying to Fission will work.
Netlify
In order to deploy your Webnative application on Netlify:
- Create a new Netlify site and connect your app's git repository. (If you don't have your application stored in a git repository, you can upload the output of a static build.)
- Netlify takes care of the rest. No Netlify-specific configuration is needed.
- There is no step 3.
Static Build
Export a static build.
npm run build
The build outputs the static site to the build directory.

