This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Development Build" | |
on: | |
push: | |
branches: [ development ] | |
pull_request: | |
branches: [ development ] | |
jobs: | |
Build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Feature Development Build | |
on: | |
push: | |
branches-ignore: [development, staging, production, release] | |
workflow_dispatch: | |
jobs: | |
Build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Gunicorn instance to serve the api | |
After=network.target | |
[Service] | |
User=lyle | |
Group=lyle | |
WorkingDirectory=/home/lyle/flask-ec2-deployment | |
Environment="PATH=/home/lyle/flask-ec2-deployment/venv/bin" | |
EnvironmentFile=/home/lyle/.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the default Blueprint.""" | |
from flask import Blueprint, jsonify | |
default = Blueprint('default', __name__, template_folder='templates', static_folder='static') | |
@default.route('/') | |
def default_route(): | |
"""Confirm that the application is working.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module has methods that are used in the other modules in this package.""" | |
import json | |
def get_user_data(github_data: dict) -> dict: | |
"""Obtain the user data from github response. | |
Given the response issued out by GitHub, this method should give back the | |
user data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the auth Blueprint.""" | |
import os | |
from flask import redirect, url_for | |
from flask_dance.consumer import oauth_authorized | |
from flask_dance.consumer.storage.sqla import SQLAlchemyStorage | |
from flask_dance.contrib.github import github, make_github_blueprint | |
from flask_login import current_user, login_user | |
from sqlalchemy.orm.exc import NoResultFound |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains initialization code for the api package.""" | |
from flask import Flask, redirect, url_for | |
from flask_dance.contrib.github import github | |
from api.helpers import set_flask_environment | |
from .blueprints.auth.models import User | |
from .blueprints.auth.views import auth | |
from .blueprints.default.views import default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- templates/dashboard.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<title>Github OAuth</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <!-- load bulma css --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- load fontawesome --> | |
<style> | |
body { padding-top:70px; } | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the default Blueprint.""" | |
import re | |
from flask import Blueprint, jsonify, render_template | |
from flask_login import login_required, logout_user | |
import json | |
default = Blueprint('default', __name__, template_folder='templates', static_folder='static') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- templates/home.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<title>Github OAuth</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <!-- load bulma css --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- load fontawesome --> | |
<style> | |
body { padding-top:70px; } |