Giter Site home page Giter Site logo

ayushsoni1010 / bhagavadgita Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gita/bhagavadgita

0.0 1.0 0.0 43.58 MB

A non-profit initiative to help spread the transcendental wisdom from the Bhagavad Gita to people around the world.

Home Page: https://bhagavadgita.io

License: GNU General Public License v3.0

Python 46.11% CSS 6.59% HTML 45.02% JavaScript 1.73% SCSS 0.55% Procfile 0.01%

bhagavadgita's Introduction

Bhagavad Gita

A not-for-profit initiative to help spread the transcendental wisdom from the Bhagavad Gita to people around the world. Built for Gita readers by Gita readers.

⚠️ We are in the process of redesigning the app from scratch for v2 and are actively looking for contributors who would be interested in helping out. Please join our Discord server below if you are interested.

New Repositories 👇


OLD VERSION (v1)

Frontend and REST API for BhagavadGita.io

Backend - Flask

Frontend - Material Design

Database - PostgreSQL, ElasticSearch

REST API

The Bhagavad Gita Application Programming Interface (API) allows a web or mobile developer to use the Bhagavad Gita text in their web or mobile application(s). It follows some of the Best Practices for designing a REST API.

Current version

The current version of the API is v1. We encourage you to explicitly use this version in the url.

Schema

All API access is over HTTPS, and accessed from https://bhagavadgita.io/api/v1. All data is sent and received as JSON.

Authentication

HTTP requests to the BHAGAVAD GITA API are protected with OAUTH2 authentication. To be able to use the API, you need to be a registered BhagavadGita.io user. After signing in, you can register your applications from your Account Dashboard after which you will be issued a Client ID and Client Secret specific to an application that can be used to programatically get the access_token(valid for 300sec).

How to get an access token? Make a POST request to /auth/oauth/token with these parameters sent in Headers -

  1. Client ID - Obtained from Account Dashboard after registering an app.
  2. Client Secret - Obtained from Account Dashboard after registering an app.
  3. Grant Type - Use client credentials.
  4. Scope - Use verse if you just want to access the verses, chapter if you just want to access the chapters and verse chapter if you want access to both.

Example -

curl -X POST "https://bhagavadgita.io/auth/oauth/token" -H "accept: application/json" -H "content-type: application/x-www-form-urlencoded" -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials&scope=verse%20chapter"

Then, you can use the received access_token to access any of the endpoints. You can send the access_token as a header or as a query parameter.

Examples -

  1. Query Parameter

curl -X GET "https://bhagavadgita.io/v1/chapters?access_token=YOUR_ACCESS_TOKEN" -H "accept: application/json"

  1. Header

curl -X GET \ https://bhagavadgita.io/v1/chapters \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Documentation

We have 2 types of documenatations available for this API, both based on the Open API specification.

  1. Swagger UI
  2. ReDoc

Developing Locally

  1. Fork this repository and clone the forked repository.
  2. Create and activate a Python 3 virtualenv.
  3. Use pip install -r requirements.txt to install the requirements.
  4. python manage.py runserver to start the server.
  5. Create an environment file config.env. Please open an issue or email [email protected] for the credentials of the file.
  6. Frontend can be accessed at http://127.0.0.1:5000 and API docs can be accessed at http://127.0.0.1:5000/apidocs/.

bhagavadgita's People

Contributors

ayushsoni1010 avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar gupta-anubhav12 avatar imgbotapp avatar redraushan avatar samanyougarg avatar

Watchers

 avatar

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.