Giter Site home page Giter Site logo

sergepolin / swp_sport_back Goto Github PK

View Code? Open in Web Editor NEW

This project forked from innopolissport/swp_sport_back

0.0 0.0 0.0 14.25 MB

Backend side of the innosport+ platform

Home Page: https://sport.innopolis.university

Shell 0.01% JavaScript 0.63% Python 2.58% CSS 0.57% HTML 0.46% Dockerfile 0.01% PLpgSQL 95.74%

swp_sport_back's Introduction

[SWP] SportComplex service with sport Achievements

Tests Production deploy

Requirements:

  • Python3
  • Docker

Environment Variables

See compose/example.env for reference.

The project require a file compose/.env to contain following environment variables:

  • POSTGRES_USER- Username for the db
  • POSTGRES_PASSWORD- database password
  • POSTGRES_DB - database name
  • POSTGRES_SERVER - database hostname (db - by default)
  • GRAFANA_DB_USER - username for database user for grafana (will be created if not exists)
  • GRAFANA_DB_PASSWORD - password for database grafana user
  • GF_SECURITY_ADMIN_PASSWORD - admin password for Grafana Dashboard
  • SECRET_KEY - a secret key for token verifications
  • PROJECT_NAME- project title
  • SCHEMA - schema of a web page (prefer https)
  • HOSTNAME - hostname of a web page e.g: example.com
  • PORT - port over which web page is served
  • PYTHON_VERSION - which python version is to be used (specify exact version)
  • DEBUG- boolean flag for DEBUG mode ( true enables fake login and Django debug)
  • oauth_appID - application ID for oauth
  • oauth_shared_secret - application secret for ouath
  • oauth_authorization_baseURL- an URL for user auth
  • oauth_get_infoURL- tokeninfo URL
  • oauth_tokenURL- an URL to obtain token
  • oauth_end_session_endpoint- end oauth session endpoint

How to start coding

  1. Clone the repository
  2. Go to repo folder
  3. pip3 install -r ./adminpage/requirements.txt
  4. To start server
    1. Rename file: example.env to .env
    2. From repo folder: docker-compose -f ./compose/docker-compose.yml up
  5. To create superuser and make migrations
    1. docker exec -it compose_adminpanel_1 bash
    2. python manage.py makemigrations
    3. python manage.py migrate
    4. python manage.py createsuperuser

Server supports auto-reload on code change in debug mode

Documentation for api module:

  • Swagger is at /api/swagger
  • Redoc is at /api/redoc
.
├── adminpage - Django project
│   ├── adminpage - main django app
│   │   ├── settings.py
│   │   ├── swagger.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── api
│   │   ├── crud - directory with database queries
│   │   ├── fixtures - database tools for testing
│   │   ├── serializers - DRF serializers
│   │   ├── tests
│   │   │   ├── api - endpoints tests
│   │   │   └── crud - database queries tests
│   │   └── views - api endpoints
│   ├── sport
│   │   ├── admin - django adminpage classes
│   │   ├── dumps - database dumps for tests
│   │   ├── migrations - django database migrations
│   │   ├── models - django database models
│   │   ├── signals - django ORM signal handlers
│   │   ├── static - static files for app (css, fonts, images, js)
│   │   │   └── sport
│   │   │       ├── css
│   │   │       ├── fonts
│   │   │       ├── images
│   │   │       └── js
│   │   ├── templates - django templates for app pages
│   │   └── views - app pages url handlers
├── compose - compose for the project
│   └── docker-compose.yml
├── nginx - load balancer and proxy
│   ├── access.d
│   ├── conf - configuration folder
│   ├── Dockerfile
│   └── logs - log folder
├── Dockerfile.db - Dockerfile for db image
└── README.md

swp_sport_back's People

Contributors

winnerok avatar bart02 avatar k1rill-fedoseev avatar kilimanj4r0 avatar kirill-kuznetsov-git avatar dmitrypodpryatov avatar fleshrazer avatar dependabot[bot] avatar bart0003 avatar vanishmax avatar vanya6537 avatar sergepolin avatar gapurinov 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.