diff --git a/_layouts/dexie-hackathon-page.html b/_layouts/dexie-hackathon-page.html new file mode 100644 index 0000000..f04e5fc --- /dev/null +++ b/_layouts/dexie-hackathon-page.html @@ -0,0 +1,413 @@ +--- +layout: dexie-hackathon-template +--- +
+ Dexie 3.2 integrates better with front-end frameworks. + Query the db without boilerplate and let your components mirror the database in real time. + +
+Dexie was written to be straightforward and easy to learn. If you've ever had to work with native IndexedDB then you'll certainly appreciate Dexie's concise API.
+ +With only a few lines of extra code, you can build a consistent, authenticated and access controlled local-first app!
+ +
+ /*
+ |----------------------------|
+ | Declare your database |
+ |----------------------------|
+ */
+
+ const db = new Dexie('MyDatabase');
+
+ // Declare tables, IDs and indexes
+ db.version(1).stores({
+ friends: '++id, name, age'
+ });
+
+
+
+
+
+
+
+
+ /*
+ |-----------------------|
+ | Then run some queries |
+ |-----------------------|
+ */
+
+ // Find some old friends
+ const oldFriends = await db.friends
+ .where('age').above(75)
+ .toArray();
+
+ // or make a new one
+ await db.friends.add({
+ name: 'Camilla',
+ age: 25,
+ street: 'East 13:th Street',
+ picture: await getBlob('camilla.png')
+ });
+
+ import { useLiveQuery } from "dexie-react-hooks";
+ import { db } from "./db";
+
+ export function FriendList () {
+ const friends = useLiveQuery(async () => {
+ //
+ // Query the DB using our promise based API.
+ // The end result will magically become
+ // observable.
+ //
+ return await db.friends
+ .where("age")
+ .between(18, 65)
+ .toArray();
+ });
+
+ return <>
+ <h2>Friends</h2>
+ <ul>
+ {
+ friends?.map(friend =>
+ <li key={friend.id}>
+ {friend.name}, {friend.age}
+ </li>
+ )
+ }
+ </ul>
+ </>;
+ }
+
+
+
+
+ <script>
+ import { liveQuery } from "dexie";
+ import { db } from "./db";
+
+ let friends = liveQuery(async () => {
+ //
+ // Query the DB using our promise based API.
+ // The end result will magically become
+ // observable.
+ //
+ return await db.friends
+ .where("age")
+ .between(18, 65)
+ .toArray();
+ });
+ </script>
+
+ <div>
+ <h2>Friends</h2>
+ <ul>
+ {#each ($friends || []) as friend (friend.id)}
+ <li>{friend.name}, {friend.age}</li>
+ {/each}
+ </ul>
+ </div>
+
+
+
+
+
+
+
+
+ <template>
+ <h2>Friends</h2>
+ <ul>
+ <li v-for="friend in friends" :key="friend.id">
+ {{ friend.name }}, {{ friend.age }}
+ </li>
+ </ul>
+ </template>
+ <script>
+ import { liveQuery } from "dexie";
+ import { db } from "../db";
+ import { useObservable } from "@vueuse/rxjs";
+
+ export default {
+ name: "FriendList",
+ setup() {
+ return {
+ friends: useObservable(
+ liveQuery(async () => {
+ //
+ // Query the DB using our promise based API.
+ // The end result will magically become
+ // observable.
+ //
+ return await db.friends
+ .where("age")
+ .between(18, 65)
+ .toArray();
+ })
+ )
+ };
+ }
+ };
+ </script>
+
+
+ import { Component } from '@angular/core';
+ import { liveQuery } from 'dexie';
+ import { db } from '../db';
+
+ @Component({
+ selector: 'friendlist',
+ template: `
+ <h2>Friends</h2>
+ <ul>
+ <li *ngFor="let friend of friends$ | async">
+ {{ friend.name }}, {{ friend.age }}
+ </li>
+ </ul>
+ `
+ })
+ export class FriendsComponent {
+ friends$ = liveQuery(() => listFriends());
+ }
+
+ async function listFriends() {
+ //
+ // Query the DB using our promise based API.
+ // The end result will magically become
+ // observable.
+ //
+ return await db.friends
+ .where("age")
+ .between(18, 65)
+ .toArray();
+ }
+
+
+
+
+
+
+
+
+ + Turn on sync with a few simple steps: +
+npx dexie-cloud create
+
+ npx dexie-cloud whitelist http://localhost:3000
+
+ npm install dexie@latest
+npm install dexie-cloud-addon
+ import Dexie from "dexie";
+ import dexieCloud from "dexie-cloud-addon";
+
+ const db = new Dexie('MySyncedDB', {addons: [dexieCloud]});
+
+ db.version(1).stores({
+ friends: '++id, name, age' // '++' = auto-incremented ID
+ friends: '@id, name, age' // '@' = auto-generated global ID
+ });
+
+ db.cloud.configure({
+ databaseUrl: "https://<yourdatabase>.dexie.cloud",
+ requireAuth: true // (optional. Block DB until authenticated)
+ });
+ Read more about authentication, + access control and consistency in the Dexie Cloud documentation.
+ ++ Read more » + +
+Now go make something awesome.
++ A global event spanning eight weeks, from February 14 to April 13, 2025. + The Dexie Global Hackathon 25 celebrates the thriving Dexie.js and Dexie Cloud community, + fostering innovation and driving the development of next-generation offline-first applications. +
+ ++ Dexie.js is a battle-tested IndexedDB wrapper library that developers + have trusted for years. With over 12,000 stars on GitHub, + 500,000 weekly downloads on npm, and adoption in + over 27,000 GitHub repositories, it has become + a cornerstone for building robust offline-first solutions. Leading applications like + WhatsApp, GitHub, Microsoft To-Do, Wire, and Flightradar24 rely on Dexie.js, + affirming its standard-setting approach to offline-first technology. +
+ ++ Building on this strong foundation, Dexie Cloud elevates offline-first + applications to the next level by enabling seamless multi-user synchronization with minimal + configuration. Integrate Dexie Cloud into your existing Dexie.js setup, and your app + can sync data across devices and users in minutes. With features like built-in authentication, + advanced access control, and consistent data synchronization, Dexie Cloud empowers developers + to create some of the world’s most innovative solutions. +
+ ++ During this hackathon, participants will showcase the power of Dexie.js and Dexie Cloud + by building applications that combine offline-first functionality, real-time synchronization, + and unparalleled user experiences. Join us in exploring how Dexie Cloud can help you create + amazing solutions, seamlessly bridging the gap between offline and online. + Push the boundaries of offline-first technology and become part of this incredible community + at the Dexie Global Hackathon 25! +
++ Dexie Global Hackathon 25 is not your typical hackathon. We’re running for + eight full weeks, giving you the time and resources to dive deeper, + collaborate, and build truly innovative applications. Whether you’re an independent developer + or a small team, we invite you to bring your creativity and join us in showing the world + what Dexie.js and Dexie Cloud can do. +
+ ++ The rules are straightforward: +
+ We want to recognize exceptional work in different areas. Your submission can qualify for one (or more) of the following categories: +
++ Our jury will evaluate submissions based on: +
++ Submissions are assessed by a panel from the Dexie development team, internal product owners, + and invited external experts with extensive experience in offline-first technologies + and real-time applications. Together, they form a broad and well-rounded jury to ensure + fair and professional evaluations of all submissions. +
+ + ++ David is the founder and lead developer behind Dexie.js and the driving force + behind Dexie Cloud. With a deep background in IndexedDB, offline-first strategies, + and performance optimizations, David brings critical domain knowledge that + helps the jury evaluate architectural, scalability, and technical aspects + of participants’ projects. His extensive experience ensures a thorough + assessment of how well teams leverage Dexie’s offline capabilities and + real-time synchronization. +
++ Bennie is the founder of Zenta AB and creator of totodo.app,” an application + showcasing practical offline-first and real-time collaboration strategies with Dexie.js and Dexie Cloud. + His hands-on approach to building user-centric apps ensures the jury + maintains a strong focus on usability, seamless synchronization flows, + and overall project feasibility. Bennie’s insights help gauge whether + participants deliver solutions that excel in design, innovation, and + real-world applicability. +
++ Jesper is a software engineer with a proven track record in open-source projects + related to Dexie.js. His expertise in distributed data handling, debugging, + and innovative web functionalities brings a meticulous perspective to the jury. + Jesper’s sharp eye for performance and code quality ensures that hackathon + submissions are thoroughly evaluated for technical excellence, robustness, + and overall developer craftsmanship. +
++ The Dexie Global Hackathon 25 offers valuable awards that go beyond recognition—these prizes deliver + tangible benefits through Dexie Cloud services and licenses. Here’s an overview based on current + pricing at dexie.org/cloud: +
++ To ensure your project is recognized as part of the official hackathon, add the + + --hackathon + + flag when creating your Dexie Cloud database: +
+npx dexie-cloud create --hackathon
+ Whitelist the domains or ports where your application will run. For local development, for example:
+npx dexie-cloud whitelist http://localhost:3000
+
+ You can whitelist your production URL later as well.
+
+ Make sure you have the next version of dexie and dexie-cloud-addon (ensuring all latest features are available).
+npm install dexie@next
+npm install dexie-cloud-addon@next
+
+ If you are using React please run npm install dexie-react-hooks@next
+
+ + Configure Dexie to use Dexie Cloud by updating your initialization code: +
+
+ import Dexie from "dexie";
+import dexieCloud from "dexie-cloud-addon";
+
+const db = new Dexie('MySyncedDB', { addons: [dexieCloud] });
+
+db.version(1).stores({
+ yourTable: '@id, ...indexes' // '@' = auto-generated global ID (optional but recommended)
+});
+
+db.cloud.configure({
+ databaseUrl: "https://<yourdatabase>.dexie.cloud",
+ requireAuth: true // (optional. Block DB until authenticated)
+});
+
+
+
+
+ Read more about authentication, access control, and consistency in the
+ Dexie Cloud documentation.
+
+ + We will provided a submission form here on this page during the hackathon. + Once your project is ready, simply fill out the submission form. + Make sure to include a link to your GitHub repo and your working demo or live preview. That’s it! +
+ ++ Wondering how to make the most of Dexie.js and Dexie Cloud? Here are some globally relevant, high-impact ideas to spark your creativity. Pick one or combine multiple concepts to create an innovative solution that appeals to both tech enthusiasts and everyday users: +
+ ++ These are just a few possibilities. Think about real-world problems or fun personal projects you’re passionate about—health, education, gaming, crypto, productivity, creative arts—and apply Dexie Cloud’s offline-first and multi-user sync features to make them truly stand out. We can’t wait to see what you build! +
++ We aim to create a safe, respectful, and inclusive environment. By participating in + Dexie Global Hackathon, you agree to follow these guidelines: +
+ ++ If you witness or experience misconduct, contact us at hackathon@dexie.org + or reach out via our official Discord. Organizers may issue warnings, remove participants + from communication channels, or disqualify submissions if this Code of Conduct is violated. +
++ The Dexie Global Hackathon (“Hackathon”) is open to individuals at least 18 years old. + Entrants must have internet access, a GitHub account, and the ability to host or demonstrate + their application online. This Hackathon is globally available unless local laws prohibit + participation. Organizers reserve the right to verify age and eligibility before awarding prizes. +
+ ++ All submissions remain the intellectual property of the participants. By submitting an entry, + you warrant that you own or have permission to use all content in your project. You also grant + Dexie the right to display your project name, description, screenshots, and demo links for + promotional purposes. +
+ ++ Dexie collects participant data (e.g., name, email) only for Hackathon administration and + communication. We do not sell or share personal data outside Dexie’s scope of operations. By + signing up, you consent to receive Hackathon-related emails, including updates and winner + announcements. Participants from regions with data protection laws (e.g., GDPR) have + the right to request data deletion or exercise other data rights. +
+ ++ The Hackathon is provided “as is,” without warranty of any kind. Dexie is not liable for + technical failures, lost data, or similar issues that may affect participation or scoring. + By entering, you release Dexie from any claims arising from the Hackathon, including + but not limited to personal injury, property damage, or data loss. +
+Go out there and create something amazing – the worst that can happen is that you learn how to build some of the world’s best offline-first applications.
+ +