Giter Site home page Giter Site logo

pariyatti / kosa Goto Github PK

View Code? Open in Web Editor NEW
8.0 9.0 3.0 2.06 MB

Digital library service

License: GNU Affero General Public License v3.0

Clojure 83.16% SCSS 4.84% Makefile 1.43% JavaScript 0.21% Shell 1.70% Jinja 0.13% Emacs Lisp 0.05% HCL 5.80% Python 2.11% Dockerfile 0.57%

kosa's Introduction

kosa [m.]: store-room; treasury

Kosa Backend Tests

Pariyatti's Library and Mobile services.

Mobile App API

The Pariyatti mobile app will consume the API as specified here.

Option 1: Use the Sandbox server

http://kosa-sandbox.pariyatti.org - Use this option if you will working exclusively on the mobile app without modifying or debugging the server.

Option 2: Set up a local development server

Follow the instructions under Development. Use this option if you need to modify or debug the server itself.

Deployment

Follow the Ops Readme.

Quick Start

To the kosa api in development mode, you can use docker-compose. Please note that it uses tcp ports 3000 and 9999 on localhost while running. If these are already occupied in your local machine, please adjust the docker-compose.yml ports locally.

To run the container image in dev mode:

docker-compose up

This will pull the latest image from Docker Hub and start kosa locally.

If you are making changes locally and would like to test that in docker as well, there is a variant of docker-compose file that can be used as well:

docker-compose -f docker-compose-local.yml up

Development

Install Java

Kosa will work with any Java 11 or higher. Java 17 is the latest LTS, and is preferred.

Install OpenJDK 17 for:

  • Mac OS
  • Linux: sudo apt-get install openjdk-17-jdk

WARNING: xtdb/xtdb#1462 may cause:

Could not open ConcurrentHashMap.table field - falling back to LRU caching. Use '--add-opens java.base/java.util.concurrent=ALL-UNNAMED' to use the second-chance cache.

Use Java as executed in the Makefile to avoid this.

Install Clojure

Install clojure as described here

Install Leinengen

Install lein as described here

Install NPM

Install npm (nodejs LTS) as described here. Sorry.

Add Secrets

Create a Gmail app password and add the following to ~/.kosa/secrets.edn on your local machine:

{:mailer {:user "[email protected]"
          :pass "GMAIL_APP_PASSWORD"
          :default-options {:to "[email protected]"
                            :tls true
                            :port 587}}}

Add the Ansible password from the KeePass Vault to:

~/.kosa/ansible-password

Build kosa

If you intend to use the "looped cards" (Pali Word a Day, Daily Words of the Buddha, or Daily Dohas), you will need access to the private repository containing the input files (https://github.com/pariyatti/Daily_emails_RSS) before you can run make txt-clone, as explained below. Speak to Pariyatti Staff to obtain access. If you do not have access to these files, Kosa will still run without them.

To see "looped cards" published to the mobile app, find {:job-name :txt-publisher-*} in kosa/config/config.{env}.edn and set {:enabled true}.

git clone [email protected]:pariyatti/kosa.git
cd kosa

make help # see all the build commands
make init # setup your system

make test # run the tests (did you install JDK 11?)

make db-clean      # delete any old db files you might have
make db-migrate    # install db schema
make db-seed       # add some sample data (optional)

make txt-clean     # completely reset TXT files (optional)
make txt-clone     # clone+copy TXT files for looped cards (optional)
                   # NOTE: this command only works if you have
                   #       access to the private repo described above
make db-txt-pali   # add looped pali word cards (optional)
make db-txt-buddha # add looped buddha word cards (optional)
make db-txt-doha   # add looped doha word cards (optional)

make run           # run the server (or)
make repl          # run the server interactively

Try it out

To add sample data from a REPL:

dev.repl> (migrate)
dev.repl> (seed)

Once you have run these, close the REPL and restart it or your XTDB node will be locked. Migrations work from the command line but seeding does not at the moment.

To login:

username: admin
password: <found in the KeePass vault>

Design Wireframes

Architectural Thinking

Old RSS Feeds

License and Copyright

AGPL-3 Copyright (c) 2019-present, Pariyatti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.