Skip to content

evbeda/edagames-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edagames-django

evbeda

Maintainability

Test Coverage

CLASS DIAGRAM

alternative text

DOCKER

Requirements

First you need to install Docker for Mac in your computer by doing click here.

NOTE: Download Mac with Intel Chip option.

First steps

Everytime you make migrations or modify the requirements.txt file you need to re-build the docker image. To build the docker image run this command.

docker build . -t edagames-web

docker build: build an image .: select all files -t: add a tag edagames-web: tag_name

Also you need to create an .env file in your local repository to add all enviroment variables.

SECRET_KEY=************************************************
SECRET_KEY_JWT=************
SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY=******************
SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET=*******************************
SERVER_URL=http://127.0.0.1
SERVER_PORT=5000

Execution

To run the docker container with docker-compose execute:

docker-compose up -d

NOTE: You must be in /edagames-django folder.

End Docker process

To kill a docker-compose process you must run this command:

docker-compose down

Run docker-compose for Web and Server

Create a folder edagames which contains all repos. Then add this file as a .yml

version: "3.9"
services:
    server:
        build: 
            context: ./edagames-server
        ports:
            - "5000:5000"
        environment: 
            - TOKEN_KEY

    edagames-web:
        build: 
            context: ./edagames-django
        ports:
            - "8000:8000"
        volumes: 
            - .:/edagames-django
        environment: 
            - SECRET_KEY=${SECRET_KEY}
            - SECRET_KEY_JWT=${SECRET_KEY_JWT}
            - SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY=${SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY}
            - SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET=${SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET}
            - SERVER_URL=server
            - SERVER_PORT=5000

    edagames-quoridor:
        build:
            context: ./edagames-quoridor
        ports:
            - "50051:50051"

How to run the test

in the same pwd as the manage.py run

python3 manage.py test

if you want to see the coverage and generate a html coverage run

coverage run manage.py test && pipenv run coverage xml && pipenv run coverage report -m && pipenv run coverage html

Problems that you could have

1 - If you are having problems installing mysql-client go and follow the steps on https://pypi.org/project/mysqlclient/