Giter VIP home page Giter VIP logo

uguide_backend's Introduction

Backend repository for LearnLytics project

Local Installation (Manual)

Python

The backend uses Python 2, the latest version of which can be found at https://www.python.org/downloads/. Python is by default not available on the windows command prompt, to append it to the PATH variable run the following

set PATH=%PATH%;C:\Python27
set PATH=%PATH%;C:\Python27\Scripts

This is not permanent and will need to be run each time command prompt is started. To permanently change this add C:\Python27 and C:\Python27\Scripts to the Path environment variable found at Control Panel->All Control Panel Items->System->Advanced System Settings->Environment Variables.

Requirements

pip

The default Python 2 installation on macOS and linux will include pip which is used to install libraries and other dependencies of this project. For Windows this can be installed by downloading the get-pip.py bootstrap and running

python get-pip.py

in the directory of the downloaded file.

virtualenv

Before running the backend ensure you have installed the python library requirements found in requirements.txt (see section below). We recommend using virtualenv to create an environment for python separate from other projects on your machine. This can be accomplished through

pip install virtualenv

To create a new virtual environment for the backend we call

virtualenv venv

and activate the virtual environment with

venv\Scripts\activate

on Windows or

. venv/bin/activate

on macOS/linux.

Dependencies

Two dependencies scipy and numpy can not be installed via the Python Package Index on Windows. You must download the binaries from the Unofficial Windows Binaries for Python Extension Packages. Find the numpy and scipy headings and download the required binaries for numpy 1.15.0-cp27 and scipy 1.1.0-cp27.

pip install \path\to\numpy binary
pip install \path\to\scipy binary

To install the rest of the requirements run

pip install -r requirements.txt

while in the backend directory. This is only required at initial set up or when the requirements have changed.

Database

LearnLytics backend uses a PostgreSQL 9 database. For local development we recommend Postgres.app for a CLI-tool. For a graphical tool we suggest pgAdmin 4. Create an empty database available at the URI postgresql://localhost/backend_db with

CREATE DATABASE backend_db;

To set up a local database, first drop any existing tables with

DROP SCHEMA public CASCADE; CREATE SCHEMA public;

or in a graphical database manager. Then while in the project virtual environment run

# CMD
python create_metadb.py
# bash
./create_metadb.py

to initialise a new database with a user specified root user. To populate the database with mock data run

# CMD
python populate_with_mock_data.py
# bash
./populate_with_mock_data.py

For usage information use.

# CMD
python populate_with_mock_data.py -h
# bash
./populate_with_mock_data.py -h

Startup

After the requirements have been fulfilled you can start the backend by running

# CMD
python main.py
# bash
./main.py

PyCharm

To connect your virtualenv to PyCharm, navigate on macOS to Preferences->Project SP->Project Interpreter->gear button->Add Local->/venv/bin/python. On Windows navigate to Settings->Project SP->Project Interpreter->gear button->Add Local->/venv/Scripts/python.

uguide_backend's People

Contributors

benedv 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.