{"id":20308890,"url":"https://github.com/bchainhub/dapp-sveltekit-boilerplate","last_synced_at":"2025-04-11T15:40:26.004Z","repository":{"id":251476051,"uuid":"837128853","full_name":"bchainhub/dapp-sveltekit-boilerplate","owner":"bchainhub","description":"Serverless Decentralized App powered by SvelteKit and Core Ecosystem","archived":false,"fork":false,"pushed_at":"2025-03-14T18:57:59.000Z","size":299,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T09:54:55.531Z","etag":null,"topics":["blockchain","boilerplate","cloudflare","core","core-blockchain","corebc","corepass","dapp","passkey","pipe","starter","starterpack","sveltekit","sveltekit-template","webauthn"],"latest_commit_sha":null,"homepage":"https://core-dapp.pages.dev","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bchainhub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T09:20:05.000Z","updated_at":"2025-03-14T18:59:57.000Z","dependencies_parsed_at":"2024-08-03T10:24:18.660Z","dependency_job_id":"ae184d29-0600-411e-ba28-0d97adb46563","html_url":"https://github.com/bchainhub/dapp-sveltekit-boilerplate","commit_stats":null,"previous_names":["bchainhub/dapp-sveltekit-boilerplate"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bchainhub%2Fdapp-sveltekit-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bchainhub%2Fdapp-sveltekit-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bchainhub%2Fdapp-sveltekit-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bchainhub%2Fdapp-sveltekit-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bchainhub","download_url":"https://codeload.github.com/bchainhub/dapp-sveltekit-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248432867,"owners_count":21102458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","boilerplate","cloudflare","core","core-blockchain","corebc","corepass","dapp","passkey","pipe","starter","starterpack","sveltekit","sveltekit-template","webauthn"],"created_at":"2024-11-14T17:24:25.096Z","updated_at":"2025-04-11T15:40:25.995Z","avatar_url":"https://github.com/bchainhub.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SvelteKit Boilerplate WIP (Work in Progress)\n\nThis project is work-in-progress, then it can introduce any breaking changes. Please, use it with caution.\n\nWelcome to the SvelteKit Boilerplate! This project provides a solid foundation for building web applications with SvelteKit, along with security features and compatibility with Cloudflare services.\n\n## Features\n\n- **[SvelteKit](https://kit.svelte.dev/)**: A framework for building fast, modern web applications.\n- **[Typescript](https://www.typescriptlang.org/)**: Type-safe development with TypeScript integration.\n- **[TailwindCSS](https://tailwindcss.com/)**: Utility-first CSS framework for rapid UI development.\n- **[PostCSS](https://postcss.org/)**: Transform CSS with JavaScript plugins.\n- **[ESLint](https://eslint.org/)**: Linting utility for identifying and reporting on patterns in JavaScript.\n- **[Prettier](https://prettier.io/)**: Code formatter for maintaining consistent style.\n- **[Lucide icons](https://lucide.dev/)**: Beautiful and customizable icon set.\n- **[blo identicons](https://github.com/bchainhub/blo)**: blo is a small and fast library to generate Blockchain identicons.\n- **[ICAN / IBAN validation](https://github.com/bchainhub/ican.js)**: Validate international bank account numbers.\n- **[Exchange Number Format](https://github.com/bchainhub/exchange-rounding)**: Utility for formatting and rounding exchange numbers.\n\n## Databases\n\n- **[Drizzle ORM](https://orm.drizzle.team)**: Headless TypeScript ORM with a head.\n  - SQLite / CloudFlare D1 database.\n  - Postgres database.\n  - Hyperdrive connector.\n  - and many more... (write your own connector in the `src/server/db` directory)\n\n### Database connectors\n\n- [Postgres.js](https://github.com/porsager/postgres) for Postgres database.\n- [libSQL](https://github.com/tursodatabase/libsql) for SQLite and Web4 database.\n- [Hyperdrive](https://developers.cloudflare.com/hyperdrive/) connector for Cloudflare (paid plan).\n\n## Installation\n\nTo get started, clone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/bchainhub/dapp-sveltekit-boilerplate.git\ncd dapp-sveltekit-boilerplate\nnpm install\n```\n\n## Usage\n\nStart the development server:\n\n```bash\nnpm run dev\n```\n\nBuild the project for production:\n\n```bash\nnpm run build\n```\n\nPreview the production build:\n\n```bash\nnpm run preview\n```\n\n## Configuration\n\nUpdate the `vite.config.ts` file located in the main folder to customize the project settings.\n\nYou can customize application settings in `wrangler.toml` file:\n\n- `NODE_VERSION`: Node.js version.\n\nEnvironment variables are stored in the `.env` file. You can add your own environment variables to this file.\n\n- `CLOUDFLARE_ACCOUNT_ID`: Cloudflare account ID.\n- `CLOUDFLARE_API_TOKEN`: Cloudflare API token.\n- `CAPTURE_COUNTRY`: Provide country as a variable from CF pages, Netlify, Vercel. If enabled.\n- `CAPTURE_CITY`: Provide city as a variable from CF pages, Netlify, Vercel. If enabled.\n\nPublic variables:\n\n- `PUBLIC_ENABLE_AUTH`: Enable or disable authentication. Default is false (disabled).\n\nEnvironment variables for database setup:\n\n- `DB_TYPE`: Database type: SQLite, PostgeSQL. Default is no database (empty string).\n- `DB_URL`: Database URL.\n- `DB_AUTH_TOKEN`: Database authentication token.\n- `DB_SSL`: Enable or disable SSL for Postgres database.\n\n## Web4\n\nWeb4 is the tool for connecting to the offline blockchain data and ecosystem using specialized devices. You can use it for blockchain operations and interaction using radio frequencies. Native support for Web4 is included in the project.\n\nCurrently, we are supporting the following functionality:\n\n- Read-only data from the blockchain ETL service.\n- TxMS transactions.\n\nWhat is Web4?\n\nIn short Web4 is an alternative network and operations instead of the Internet. It is a secure and reliable way to interact with the blockchain data. You can use it for blockchain operations and interaction using radio frequencies as well as 0G connectivity. But it is not focused only on Blockchain, can it be various types of data.\n\nWhy do you need Web4?\n\nIn some cases you need to interact with the blockchain data offline. You can use Web4 + Web3 for this purpose. It is a secure and reliable way to interact with the blockchain data. You can use it for blockchain operations and interaction using radio frequencies as well as 0G connectivity.\n\n## PWA\n\nThe project is a Progressive Web Application (PWA) by default. You can customize the PWA settings in the `vite.config.ts` file.\n\n## Styling\n\nThe project uses TailwindCSS for styling. You can customize the styles by editing the `tailwind.config.js` file.\n\nCustom styles and variables are defined in the `src/css` directory. You can use [customization tool](https://docusaurus.io/docs/styling-layout#styling-your-site-with-infima) to edit variables. We are using prefix `skc` for custom classes.\n\nYou can use tool to generate TailwindCSS colors: [TailwindCSS Color Generator](https://javisperez.github.io/tailwindcolorshades/) or [TailwindCSS Color Shades](https://www.tailwindshades.com/).\n\n## Database setup\n\nTypes of connectors:\n\n- [D1 database](https://developers.cloudflare.com/d1/) Cloudflare's free plan\n- [Hyperdrive connector](https://developers.cloudflare.com/hyperdrive/) Cloudflare's paid plan\n\nWe are recommending purchasing the Hyperdrive connector for production use. There are many advantages and you can bind plenty of databases.\n\nYou can use SQLite, Postgres database, or any other supported by Drizzle. Supported drivers by Cloudflare are listed [here](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-postgres/#supported-drivers). The database setup is defined in the `.env` file prefixed with `DB_`.\n\n### ORM Database Setup\n\nThe project uses Drizzle ORM for database setup. You can find more information in the [Drizzle ORM documentation](https://orm.drizzle.team/).\n\nThis step is optional, but required for authentication and blockchain operations.\n\nWe are supporting three categories of databases:\n\n- Ordinary databases\n- Blockchain databases\n- Local Blockchain databases on the ORB (or any other) device\n\n### Drizzle setup\n\nDrizzle setup is located in the `drizzle.config.ts` file. Configure it for your database setup.\n\nSchemas are located in the `src/schemas` directory. You can add your own schema files.\n\n### Recommended database setup\n\nWe are recommending to use the following setup:\n\nIf you own the Orb device, you can use it for blockchain operations. You can use the D1 database for ordinary operations. You can use the Hyperdrive connector for production use - for Apps they need the heavy load.\n\n- Small applications: D1 database + Blockchain database on Orb device or D1.\n- Medium applications: Hyperdrive connector + Blockchain database on Orb device.\n- Large applications: Hyperdrive connector + Blockchain database on Orb device or another Hyperdrive instance.\n\n## Authentication\n\nThe project uses CorePass Extension for authentication but Passkey is possible to build also.\n\nDependencies:\n\n- CorePass Extension\n- Node.js version 22 or higher.\n\n## Sitemaps\n\nSitemaps help search engines prioritize pages within your site, particularly when you have a large amount of content. You can create a sitemap dynamically using an endpoint: `src/routes/sitemap.xml/+server.ts`\n\n```ts\nexport async function GET() {\n  return new Response(\n    `\n    \u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n    \u003curlset\n      xmlns=\"https://www.sitemaps.org/schemas/sitemap/0.9\"\n      xmlns:xhtml=\"https://www.w3.org/1999/xhtml\"\n      xmlns:mobile=\"https://www.google.com/schemas/sitemap-mobile/1.0\"\n      xmlns:news=\"https://www.google.com/schemas/sitemap-news/0.9\"\n      xmlns:image=\"https://www.google.com/schemas/sitemap-image/1.1\"\n      xmlns:video=\"https://www.google.com/schemas/sitemap-video/1.1\"\n    \u003e\n      \u003c!-- \u003curl\u003e elements go here --\u003e\n    \u003c/urlset\u003e`.trim(),\n    {\n      headers: {\n        'Content-Type': 'application/xml'\n      }\n    }\n  );\n}\n```\n\n## Security\n\nAbout Platform Environment Variables:\n\n- These variables are accessible in server-side code except those that are prefixed with `PUBLIC_`.\n\n### Local environment variables\n\nWe can access local environment variables using the `env` function. This function is used to read the environment variables from the `.env` file. Any value is returned as `string`.\n\n## Contributing\n\nContributions are welcome! For feature requests, bug reports, or questions, please [open an issue](https://github.com/bchainhub/dapp-sveltekit-boilerplate/issues).\n\n## License\n\nThis project is open source and available under the [CORE License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbchainhub%2Fdapp-sveltekit-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbchainhub%2Fdapp-sveltekit-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbchainhub%2Fdapp-sveltekit-boilerplate/lists"}