/tipitaka-bookcase

This app gives a visual introduction and explanation of the Tipiṭaka's 50+ volumes as well as the commentaries and subcommentaries about the Tipiṭaka.

Primary LanguageJavaScript

Tipitaka Shelves (aka Tipitaka Bookcase) app

This is app is built using Svelte 3.0. You will use NPM (Node Package Manager) to install the dependencies so you'll need Node installed first.

After you're sure you have Node installed, download this repo using the Code button on this webpage. Once downloaded, unzip and open the "tipitaka-bookcase" in a text editor. Within a Terminal window, install the dependencies with these commands:

cd tipitaka-bookcase
npm install

...then to view the Tipitaka app in your browser, type this in the Terminal.

npm run dev

Once started, navigate to localhost:5000. You should see the Tipitaka app in the browser.

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

Using TypeScript

This app comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with:

node scripts/setupTypeScript.js

Or remove the script via:

rm scripts/setupTypeScript.js

Building and running in production mode

To create an optimised version of the app:

npm run build

You can run the newly built app with npm run start. This uses sirv, which is included in your package.json's dependencies so that the app will work when you deploy to platforms like Heroku.

Single-page app mode

By default, sirv will only respond to requests that match files in public. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.

If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for any path. You can make it so by editing the "start" command in package.json:

"start": "sirv public --single"

Deploying to the web

With Vercel

Install vercel if you haven't already:

npm install -g vercel

Then, from within your project folder:

cd public
vercel deploy --name my-project

With surge

Install surge if you haven't already:

npm install -g surge

Then, from within your project folder:

npm run build
surge public my-project.surge.sh