Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 2.59 KB

README.md

File metadata and controls

49 lines (37 loc) · 2.59 KB

Teatime

Teatime is a fully static distributed library system powered by IPFS, SQLite and GitHub


Auto-updating instances are hosted on Netlify and GitHub Pages

A Distributed Library

The Teatime web application is completely decoupled from its databases and the files it fetches. The databases used in Teatime are GitHub repositories tagged with the teatime-database topic, which are published on GitHub Pages. Each database contains a config.json file that points to an SQLite database. Before a user performs a search in Teatime, they choose which database to query and then Teatime retrieves data from the SQLite database using sql.js-httpvfs. Since the web application is a static site, and the databases are comprised of static files, both can be easily forked, replicated, and deployed. The rows in the SQLite databases include a file hash, which Teatime uses to fetch the file from IPFS gateways. This distributed architecture makes Teatime's resilience.

Creating a Database

Tip

An example database can be found in the database repository

Each SQLite database contains a table with the below schema. Note that column names can be adjusted in the config.json file.

CREATE TABLE "books" (
 "id" INTEGER,
 "title" TEXT,
 "author" TEXT,
 "year" INTEGER,
 "lang" TEXT,
 "size" INTEGER,
 "ext" TEXT,
 "ipfs_cid" TEXT,
 PRIMARY KEY("id" AUTOINCREMENT)
);

If the SQLite file is too big, you can split it. Note the information about optimizing your database. You will also want to use FTS. Then, publish your repository to GitHub Pages and give it the teatime-database topic.

Contributing

Note

Even if you cannot code, a great way to contribute is to simply fork this repository, as well as your favorite database repositories.

  1. Install the dependencies: npm install
  2. Run the server: npm run dev
  3. Navigate to http://localhost:3000

Check out the Nuxt documentation for more information.