An open API service indexing awesome lists of open source software.

https://github.com/ilmalte/github-actions-with-sqlite

A Typescript page, compiled with Web Assembly and dynamically deployed on Github Pages. It displays random data from a sqlite database, populated by a simple Python script scheduled with Github Actions.
https://github.com/ilmalte/github-actions-with-sqlite

github-actions github-page python sqlite3 typescript webassembly

Last synced: 11 months ago
JSON representation

A Typescript page, compiled with Web Assembly and dynamically deployed on Github Pages. It displays random data from a sqlite database, populated by a simple Python script scheduled with Github Actions.

Awesome Lists containing this project

README

          

[![add_activities_to_db](https://github.com/ilmalte/test-sqlite/actions/workflows/add_activities_to_db.yml/badge.svg)](https://github.com/ilmalte/test-sqlite/actions/workflows/add_activities_to_db.yml)
[![continuous-integration-workflow](https://github.com/ilmalte/test-sqlite/actions/workflows/continuous-integration-workflow.yml/badge.svg)](https://github.com/ilmalte/test-sqlite/actions/workflows/continuous-integration-workflow.yml)
# SIMPLE SQLITE SCRIPT SCHEDULED WITH GITHUB ACTIONS
This repo only wants to be a super simple test of sqlite, Github Actions and Github Pages!
A Github Action adds random records on a sqlite db every 6 hours.
Then a Typescript page, compiled in WebAssembly, displays data randomly using sql.js-httpvfs (a wrapper around sql.js to provide a read-only HTTP-Range-request based virtual file system for SQLite).
sql.js-httpvfs is amazing because allows hosting an SQLite database on a static file hoster and querying that database from the browser without fully downloading it.

## How to launch
In the package.json you can find a script to help you during the development process.
You only need to launch the following commands in your Linux terminal (WSL as well).

`
npm install # if needed
`

`
npm run dev
`

## How to build
If you want to build this you need to run the following commands:

`
cd ./ui
`

`
npm install # if needed
`

`
npm run build-prod
`

## CI with Github Actions
Thanks to a Github Action, every push on master launches a job that deployes a build on the branch "gh-pages".
In this way you can have a working version of this repo on the following url:
https://ilmalte.github.io/github-actions-with-sqlite/

## I recently discovered this official documentation with more resources about this topic
Here you can find the documentation for the SQLite project's WebAssembly- and JavaScript-related APIs, which enable the use of sqlite3 in modern WASM-capable browsers:
https://sqlite.org/wasm/doc/trunk/index.md