GithubHelp home page GithubHelp logo

website-backend's Introduction

Website backend

A collection of backend administrative modules for various parts of the website.

Development setup

This is a python and Django based project.

It includes the setup for the pipenv python virtual environment and package management. Please install it first and then run:

pipenv install --dev
pipenv shell

You can leave the created virtual environment by running exit from the shell.

Second, you need to link the development settings file and create a secrets file:

cd sledilnik/settings
ln -s develop.py __init__.py
echo "SECRET_KEY = 'secret-key'" > secrets.py
cd -

Finally, crete the databse and run migrations:

./manage migrate

Create a superuser by:

./manage.py createsuperuser

Finally, run the server and visit the admin section at http://127.0.0.1:8000/admin/:

./manage.py runserver

Model graphs

You can visualize the data models of this project. Please make sure you have install the development requirements by running pipenv install --dev and the run:

./manage.py graph_models -g -o Model.pdf --no-inheritance <app-name>

Automatic deployment

Helm chart used is sledilnik/django located in https://github.com/sledilnik/helm-repo/. See files in .github.workflows. Use NOBUILD keyword in commit message to skip build. Use NODEPLOY keyword in commit message to skip deploy

Manual deployment (for development)

Change ../helm-repo/charts/django with path to local checkout of helm chart, do modifications and try it out.

helm upgrade website-backend-stage ../helm-repo/charts/django --install --atomic --namespace sledilnik-stage  -f .helm/values.stage.yml --debug

website-backend's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website-backend's Issues

FAQ module

Implement FAQ module.

Current state:
FAQ identifiers are stored in github.com/sledilnik/website/blob/master/src/content/faq.js and actual strings are stored in i18n jsons (src/locales/*.json). In JS, everything is compiled into searchable database, using fuse for client side search

Desired state:

  • FAQ will be available via APi endpoint e.g. /api/v1/faq
  • Import current questions in sl and en to database
  • API should return translated questions for given langiuage give as query param (lang) or Accept-Language header (query param overrides header).
  • Consider FAQ questions have to be ordered and grouped by sections (see how does current FAQ looks like)
  • Search will remain client side, so API return all objects
  • Add option to add keywords to question, for search

Example API response should look like:

{
  "meta" {...},
  "objects": {
    {
      "title": "Section title",
      "faq": [
        { "question": "Translated question", "answer": "translated answer", "keywords": ["some", "keyworrds", "for", "search"] }
        ...
        ]
    }, ...
}

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.