Git Product home page Git Product logo

tripitaka-api's Introduction

tripitaka-api


Travis:Status Code Style: Prettier


This is a self-hosting tripitaka API server. You can use this server for your tripitaka applications.

Roadpath

  • Implementing full tripitaka
  • Translating to all locales

Documentation

Use your browser or post mant to access these URLs. You can get a JSON result after a successful call.

Getting menu Items

We can get the main menu items by accessing below URL.

Request:-
http://localhost:5000/menu/si_LK
// si_LK is the locale code

Response:-
{
    status: true,
    data: [
        {
            id: "p1",
            name: "විනයපිටක",
            parent: true,
            childCount: 5
        },
        ...
    ]
}

And please provide a path to access nested menus.

Request:-
http://localhost:5000/v1/menu/si_LK/p2/n2
// p2 and n2 are parent ids

Response:- 
{
    status: true,
    data: {
        name: "මජ්ඣිමනිකාය",
        id: "n2",
        parent: true,
        childCount: 3,
        childs: [
            {
                id: "b1",
                name: "මූලපණ්ණාසපාළි",
                parent: true,
                childCount: 5
            },
            ...
        ]
    }
}

Getting Sutta contents

Please access below URL with your path to get the sutta contents.

Request:-
http://localhost:5000/v1/sutta/si_LK/p2/n2/b2/v2

Response:-
{
    id: "p2_n2_b2_v2",
    title: "භික්ඛුවග්ගො",
    sections: [
        {
            title: "1. අම්බලට්ඨික රාහුලොවාද සූත්‍රය",
            id: "p2_n2_b2_v2_s1",
            paragraphs: [
                {
                    number: "107",
                    content: "මා විසින් මෙසේ...",
                    id: "p2_n2_b2_v2_s1_p1"
                },
                ...
            ],
            endingText: "පළමුවෙනිවූ අම්බලට්ඨික රාහුලොවාද සූත්‍රය නිමි. (2-1)"
        },
        ...
    ]
}

Locales

  • Sinhala
  • English

Adding locales

Use POEdit application to edit or create your translation files. Put your translation files in /data/locales/translations/<path-to-sutta> folder.

Testing

  1. Install depedencies. npm install
  2. Compile translation files. npm run translate
  3. Watch your changes. npm run start-dev

Contributions

All contributions are welcome. Please help us to add your language to the above list and spread tripitaka.

Sources

Pitaka.lk - Winaya Pitaka (Sinhala)

tripitaka-api's People

Contributors

whizsid avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thegenocides

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.