Giter Site home page Giter Site logo

offthewoll / sefaria-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sefaria/sefaria-project

0.0 1.0 0.0 118.41 MB

New Interfaces for Jewish Texts

Shell 0.03% Batchfile 0.01% Python 27.08% HTML 29.72% JavaScript 36.73% CSS 5.96% PHP 0.47%

sefaria-project's Introduction

New Interfaces for Jewish Texts

Sefaria is creating interfaces, apps (like a source sheet builder) and infrastructure (like an API and a structured dataset) for Jewish texts and textual learning. Our website is up at www.sefaria.org.

You can find outputs of our entire database in Sefaria-Export.

Interested developers should join the sefara-dev mailing list.

For general discussion about the project, please post to the Sefaria Forum.

You can post bugs or request/discuss features on GitHub Issues. Tackling an issue marked as a "Starter Project" is a good way to sink your teeth into Sefaria.

If you're interested in working on a project you see listed here, please email the sefara-dev mailing list.


Getting Started

Install Python

Most UNIX systems come with a python interpreter pre-installed.

For Windows:

Go to the Python Download Page and download and install python. Add the python directory to your OS' PATH variable. See here

(Optional) Install virtualenv:

If you work on many Python projects, you may want to keep Sefaria's python installation separate using Virtualenv. If you're happy having Sefaria requirements in your main Python installation, skip this step.

Install virtualenv then enter these commands:

virtualenv venv --distribute
source venv/bin/activate

Now you should see (venv) in front of your command prompt. The second command sets your shell to use the Python virtual environment that you've just created. This is something that you have to run everytime you open a new shell and want to run the Sefaria demo. You can always tell if you're in the virtual environment by checking if (venv) is at the beginning of your command prompt.

Pip:

If you don't already have it in your Python installation, install pip. Then use it to install the required Python packages.

pip install -r requirements.txt

If you are not using virtualenv, run it with sudo: sudo pip install -r requirements.txt

If you see an error about a missing 'python.h' file, you'll need to install the Python development libraries.

On Debian systems:

sudo apt-get install python-dev

On Fedora systems:

sudo yum install python-devel

After installing the Python development libraries, run pip install -r requirements.txt again.

On Windows systems, use instructions here and then make sure that the scripts sub folder of the python installation directory is also in PATH.

Create a local settings file:

cd sefaria
cp local_settings_example.py local_settings.py
vim local_settings.py

Replace the placeholder values with values with those matching your environment. You can name your local database (sefaria will be the default created by mongorestore below). You can leave SEFARIA_DB_USER ad SEFARIA_DB_PASSWORD blank if you don't need to run authentication on Mongo.

Create a log directory:

Create a directory called "log" under the project folder. Make sure that the server user has write access to it by using a command such as chmod 777.

Get Mongo running:

If you don't already have it, install MongoDB. Our current data dump requires MongoDB version 2.6 or later. After installing Mongo, run the mongo daemon with:

sudo mongod

Put some texts in your database:

A MongoDB dump of our database is available at http://dev.sefaria.org/static/dump.tar.gz . Download and unzip this content, then from the parent directory which contains dump run:

mongorestore --drop

This will create (or overwrite) a mongo database called sefaria.

Set up Django's local server

manage.py is used to run and to manage the local server. It is located in the root directory of the Sefaria-Project code base.

Django auth features run on a separate database. To init this database and set up Django's auth system, switch to the root directory of the Sefaria-Project code base, and run:

python manage.py syncdb

Run the development server:

python manage.py runserver

You can also make it publicly available by specifying 0.0.0.0 for the host:

python manage.py runserver 0.0.0.0:8000

Get Node:

Node is now required to run the site because we are using Webpack to bundle our javascript. To install node and npm, see here. On Debian systems you can do:

sudo apt-get install nodejs
sudo apt-get install npm

Now download the required Javascript libraries and install some global tools for development with the setup script.

npm install
sudo npm run setup

Create a local settings file for node and tell it what port to run on and where to find the Django server. The port should match the NODE_HOST variable set in Django's local_settings.py.

cp node/local_settings_example.json node/local_settings.json
vim node/local_settings.json

Run Webpack

To get the site running, you need to bundle the javascript with Webpack. Run:

npm run build-client

to bundle once. To watch the javascript for changes and automatically rebuild, run:

npm run watch-client

Server-side rendering with Node:

Sefaria uses React.js. To render HTML server-side, we use a Node.js server. For development, the site is fully functional without server-side rendering. For deploying in a production environemnet however server side HTML is very important for bots and SEO.

For development, you can run the Node server using nodemon with:

npm start

You also need to set

USE_NODE = True

in Django's local_settings.py. To run webpack with server-side rendering, use:

npm run build

or

npm run watch

Command Line Interface

The shell script cli will invoke a python interpreter with the core models loaded, and can be used as a standalone interface to texts or for testing.

$ ./cli
>>> p = LinkSet(Ref("Genesis 13"))
>>> p.count()
226

Thanks

We're grateful to the following orgazations for providing us with donated services:

License

GPL

sefaria-project's People

Contributors

bachrach44 avatar blockspeiser avatar cmrberry avatar dakom avatar edamboritz avatar eliavs avatar eliezerisrael avatar gisrael avatar herzberg avatar jdotjdot avatar jonmosenkis avatar joshuagoldmeier avatar kylehg avatar marcstober avatar markerdmann avatar nonzero avatar nqeron avatar nsantacruz avatar pzp1997 avatar ravyehoshua avatar rneiss avatar stevekaplan123 avatar tnadler avatar wolfkevin avatar yairrand 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.