vinyll / everywhere-api

Server side for Everywhere client content managment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edit-in-place, Everywhere!

Everywhere is a generic and ultra easy to use edit-in-place concept. Everywhere API is the data storage and API provider for the editor.

Technical specifications

Based on Flask and Flask RestPlus, it runs in Python3.

TinyDB is used for storage; no need to setup a database!

Installing and running

Download these sources

git clone https://github.com/vinyll/everywhere-api.git
cd everywhere-api

Run the project with venv

python3 -m venv venv
echo '/venv/' >> .git/info/exclude
source venv/bin/activate
pip install -r requirements.txt
python app.py

You could alternatively run the project with Docker (see below).

Running in production (Docker)

docker build --tag everywhere-api .
docker run --name everywhere-api -p 80:80 -v `pwd`:/app -d

This will create a docker with all requirements. Database will be stored outside of the docker, in the data folder of the source.

Available methods

All API methods are exposed on http://localhost:5000/.

You can of course use HTTPie, Postman, curl or your favorite HTTP tool.

Create a new user

Go to http://localhost:5000/#!/user/create_new_user and create a user called "mywebsite".

It will return an authentication key phrase. Keep it aside!

Create a new content

Go to http://localhost:5000/#!/content/create_or_update_content and create a new content called "home_article" for user "mywebsite".

Read a content

Go to http://localhost:5000/#!/content/get_content and request the content called "home_article" for user "mywebsite".

Usage

A common usage would be to couple with Everywhere.js client.

You can also consider serving contents from your website server side (with Python, NodeJS, PHP or whatever server side language) reading the API.

Configuration

See the settings.cfg file about what you can configure. Feel free to modify that file.

License: MIT

View the LICENSE.txt file for further details.

About

Server side for Everywhere client content managment

License:MIT License


Languages

Language:Python 81.7%Language:Shell 13.9%Language:Nginx 4.4%