Skip to content

ArtyomSliusar/storage-of-knowledge-be

Repository files navigation

Storage of knowledge

This repository contains a web application for keeping your study notes and useful links in one place. Your notes and links are always available, can be easily filtered and found. Application doesn't have its own UI (except of admin UI), it just provides an API for web (https://github.com/ArtyomSliusar/storage-of-knowledge-fe) or mobile clients.

Technology

  • Python 3.6
  • Django 2.1

Installing

on-premise

  • Install build dependencies for mysql client
sudo apt-get install default-libmysqlclient-dev gcc
  • Create and activate virtual environment
python3.6 -m venv stofkn-venv
source stofkn-venv/bin/activate
  • Install requirements
pip install -r requirements.txt
  • Create .env file in storageofknowledge folder (use example.env)

  • Create logging configuration file (use storageofknowledge/logging templates)

  • Run migrations

python manage.py migrate
  • Create superuser
python manage.py createsuperuser
  • Run server
python manage.py runserver

docker

  • Run a new container, with .env file and develop.json logging configuration, use host network to connect to host database or Elasticsearch.
docker run --rm --network="host" \
    --env-file $(pwd)/storageofknowledge/.env \
    -v $(pwd)/storageofknowledge/logging/develop.json:/app/storageofknowledge/logging/develop.json \
    artyomsliusar/storage-of-knowledge-be:0.1

You can check https://github.com/ArtyomSliusar/storage-of-knowledge if you want to run this application with all dependencies included.

Configuration

Environment variables for configuration:

How to

  • Build a new docker image manually
docker build -f Dockerfile ./ -t artyomsliusar/storage-of-knowledge-be:0.1
  • Run bash inside a new docker container
docker run -ti --rm --entrypoint=/bin/bash artyomsliusar/storage-of-knowledge-be:0.1

TODO:

  • tests
  • api documentation
  • use UUID for user
  • add language field
  • email user, if somebody has commented his/her note
  • social networks integration