This project is still under development!
This repo only shows v0.1. Project will be continued to develop under below page.
https://gitlab.com/fablabdocumentation/documentation_backend
Developers:
- Ivan Sanchez Milara
- Onur Ozuduru
This is code of back-end and web client, Android client can be seen from here.
This readme explains the following topics:
Database must be installed beforehand to use this software, it uses MySql but it can be changed to other ones too.
Please make sure that following packages are installed in your machine:
This guide shows how to install MySQL on Ubuntu 16.04.
Below command installs FFmpeg on Ubuntu 16.04.
$ sudo apt-get install ffmpegAll requirements for Python libraries are listed in requirements.txt file. They can be installed with below pip command.
$ pip install -r requirements.txtIn this section, installation steps are explained very briefly.
- Make sure that
MySQL,FFmpegandPython 2.7.xare installed and running in your machine. - Install Python libraries on
requirements.txt:
$ pip install -r requirements.txt- Create a new database on MySQL (Only creating the database is enough).
mysql> CREATE DATABASE fablab;
- Exit from MySQL and create & populate tables with using data dump.
dump.sqlis located underdatabasedirectory.
$ mysql -u <username> -p fablab < dump.sqlwhere fablab is your database name and dump.sql is the name of data dump file.
- In
config.pychange the below lines for your setup.
HOST_URL = 'http://YOURDOMAIN/'
...
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://USERNAME:PASSWORD@MACHINE/DBNAME"- In
main.jschange below line for your domain.
var HOST_URL = "http://YOURDOMAIN/";- Run the application.
$ python main.py- Since there is no login, user ID must be given to system manually on web client side. Below is an example URL to reach Web UI via web browser.
http://localhost:5000/docs/?userid=4
-
Please note that if application cannot create folders for images and files, it must be created manually or paths must be changed for a desired place on
config.py.- In that case please create the folders with the following names under project folder:
user_images,user_images/thumbnails,user_files. - Or modify the below lines for desired folders.
- In that case please create the folders with the following names under project folder:
app.config['UPLOADED_IMAGES_DEST'] = 'user_images'
app.config['UPLOADED_FILES_DEST'] = 'user_files'-
API documentation can be reached under
/apiendpoint. For example,http://localhost:5000/api -
To use Android application please see its Readme.md on Android client repo.
It must be noted that this code only covers the documentation tool after login. Since it will be wrap by a main login system for example; FabLab's login functions, Login have not been implemented.
Therefore, an additional login system is needed.