Code Monkey home page Code Monkey logo

gabduel's Introduction

The Gab/Duel Folks

-Zach Neill.

Description

The Gab/Duel Folks allows people with opinions to gab with and duel each other online.

Installation

Only Docker is needed. This is great news for anyone with a Linux kernel (or we lucky few who got Docker Desktop for Windows to work).

Production Environment

To run this app in production-mode:

  • Set the docker-compose.yaml services-->web-->build-->dockerfile to Dockerfile
  • Comment out services-->web-->volumes: ['./flask:/app']
  • docker compose up
    • If it fails, just run it again. Sometimes the database isn't ready in time, even in spite of depends_on.
  • Navigate to localhost:8080
    • Not to be confused with localhost:5000!!!

To take down any of the layers, run docker compose down. To remove a specific layer like the database, run docker compose down db

Sometimes on startup on Windows, Docker throws a docker-credential-desktop error. Fix it with source docker-credential-fix.sh

Development Environment

To run this app in a development setting:

  • docker compose up -d db
    • This command starts the postgres database on port 5432

If you want the nginx layer...

  • docker compose up -d nginx
  • Set the docker-compose.yaml web-->build-->dockerfile to Dockerfile.dev
  • Make sure services-->web-->volumes: ['./flask:/app'] is uncommented
  • docker compose up web
    • For extra measure, you can run docker compose up web --build
  • Navigate to localhost:8080

If you don't need nginx...

  • source setup.sh
  • flask run
    • ctrl+c to stop the server, flask run to rerun it
  • Navigate to localhost:5000
    • Not to be confused with localhost:8080!!!

Testing

Pytest is the testing framework. The unit and functional tests are in the tests directory in flask-->tests.

The app uses Coverage.py. For a coverage report, cd into the flask directory and run source run_coverage.sh. Or, run coverage run -m pytest followed by coverage report --omit="*/test*,*/__init__.py,database.py,*/conftest.py"

For a linting test, run python -m pylint flask/app or python -m pylint app if you are in the flask directory.

A Travis CI pipeline is currently being set up.

Technologies

  • Flask
    • Front end and api
  • Gunicorn/Flask
    • Server
  • nginx
    • Load balancing/server
  • PostgreSQL
    • Database
  • Flask-SQLAlchemy
    • ORM
  • Docker
    • Containerization
  • Pytest/Pylint
    • Testing
  • Travis CI
    • CI/CD pipeline

Dev Checklist

  • Fix tests
  • Travis CI
  • Edit profile
  • Request friends

gabduel's People

Contributors

zachneill avatar

Watchers

 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.