Skip to content

Commit

Permalink
"Initial commit for Flask app. Not yet deployed."
Browse files Browse the repository at this point in the history
  • Loading branch information
marvintensuan committed Feb 3, 2021
1 parent 25635a7 commit 9264491
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 0 deletions.
58 changes: 58 additions & 0 deletions mrvn_flask/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import os
from flask import Flask

try:
import google.auth
from google.cloud import secretmanager_v1beta1 as sm
except ImportError:
pass

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
env_file = os.path.join(BASE_DIR, ".env")

SETTINGS_NAME = "application_settings"

if not os.path.isfile('.env'):
import google.auth
from google.cloud import secretmanager_v1beta1 as sm

_, project = google.auth.default()

if project:
client = sm.SecretManagerServiceClient()
path = client.secret_version_path(project, SETTINGS_NAME, "latest")
payload = client.access_secret_version(path).payload.data.decode("UTF-8")

with open(env_file, "w") as f:
f.write(payload)

env = environ.Env()
env.read_env(env_file)

# Setting this value from django-environ
SECRET_KEY = env("SECRET_KEY")

def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY= env('SECRET_KEY'),
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_config is None:
# load the instance config, if it exists, when not testing
app.config.from_pyfile('config.py', silent=True)
else:
# load the test config if passed in
app.config.from_mapping(test_config)

# ensure the instance folder exists
try:
os.makedirs(app.instance_path)
except OSError:
pass

from . import home
app.register_blueprint(home.bp)

return app
26 changes: 26 additions & 0 deletions mrvn_flask/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)

from google.cloud import firestore

bp = Blueprint('home', __name__)

@bp.route('/', methods=['GET'])
def home():

context = my_reddit_comments()

return render_template('sample.html', context=context)

def my_reddit_comments():
db = firestore.Client()
coll = db.collection('tagapagtuos_submissions').stream()
db = None

return [doc.to_dict() for doc in coll]

@bp.route('/cv')
def baseee():
return render_template('home.html')
77 changes: 77 additions & 0 deletions mrvn_flask/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>
<head>

<!--- Bootstrap CDN -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Righteous">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Marvin Tensuan &mdash; Curriculum Vitae</title>

<style>
body {margin: 0;
background-color: #d3d3d3;
font-family: sans-serif;
}
.contents-label{
font-family: Ubuntu;
font-size: 3em;
}
</style>

</head>
<body>
<!--- Header and Navigation -->
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="height: 120%;">
<a class="navbar-brand" href="#">Marvin Tensuan</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="https://www.marvintensuan.com">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Learning
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="http://www.marvintensuan.com/list_of_cpds">List of CPDs</a>
<a class="dropdown-item" href="http://www.marvintensuan.com/self_directed_learning">Self-Directed Learning</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="http://www.marvintensuan.com/my_learning_roadmap">My Learning Roadmap</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="https://marvintensuan.github.io">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</nav>
</header>

{% block container %}{% endblock %}

<footer class="bg-dark text-white text-center"
style="min-height: 10em;">
<p>
<br><br>Created by Marvin Tensuan<br> via
<a href="https://marvintensuan-s672kobfna-de.a.run.app/" style="color: #dddddd;">
Django on Google Cloud Run
</a>
</p>
</footer>
</body>
</html>
146 changes: 146 additions & 0 deletions mrvn_flask/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{% extends 'base.html' %}
{% block container %}
<script>
$(".nav-link").eq(0).addClass("active")
</script>

<!--- Title and Social Media Links -->
<div class="container" style="text-align: center;">
<p style="font-size: 3em; font-weight: bold; margin: 1em auto auto auto;">Marvin D. Tensuan</p>
<p style="font-size: 2em;">Curriculum Vitae</p>
<nav class="btn-group btn-group-justified btn-group" role="group"
style="max-width: 20%; min-width: 256px; margin: auto; background-color: green;">

<button type="button" class="btn btn-secondary">
<a class="btn btn-default" role="button" href="https://www.linkedin.com/in/marvintensuan">
<img src="https://www.republiccapitalaccess.com/wp-content/uploads/2014/07/linkedin-icon.png" height="25px">
</a>
</button>
<button type="button" class="btn btn-secondary">
<a class="btn btn-default" role="button" href="mailto:marvintensuan@outlook.com">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Microsoft_Outlook_2013_logo.svg/1200px-Microsoft_Outlook_2013_logo.svg.png" height="25px">
</a>
</button>
<button type="button" class="btn btn-secondary">
<a class="btn btn-default" role="button" href="https://github.com/marvintensuan">
<img src="https://digitallabs.mmu.ac.uk/wp-content/uploads/2018/04/github_logo.png" height="25px">
</a>
</button>
</nav>
</div>
<!--- Work Experience-->
<div class="container mt-5">
<section class="row">
<div class="col-md-5 contents-label">Work Experience</div>
<div class="col-md-7">
<h3 style="font-weight: bold;">Deutsche Knowledge Services Pte. Ltd.</h3>
<h4 style="font-weight: bold;">Senior Financial Analyst | Central FX Team (October 2020 to <em>present</em>)</h4>
<p>Assist in the creation of a global-scope FX team.</p>
<h4 style="font-weight: bold;">Financial Analyst | FX Management (June 2018 to September 2020)</h4>
<p>
The FX Management team is mandated to hedge cost-related foreign currency transactions incurred from major Deutsche Bank branches across US, UK, and APAC.
<ul>
<li>Process improvements through Excel VBA automations</li>
<li>Cross-team process improvements through lean principles</li>
<li>1x Employee of the Month, May 2020</li>
<li>2x Spot Awardee</li>
<li>1x Gold Medalist, Continuous Improvement Award</li>
</ul>
</p>
</div>
</section>
</div>

<!--- Professional Certifications-->
<div class="container mt-5">
<section class="row mb-5">
<div class="col-md-5 contents-label"> Certifications</div>
<div class="col-md-7">
<!---Licenses-->
<h3>Professional Licenses</h3>
<ul>
<li>
<p style="line-height: 50%; font-weight: bold;">Certified Public Accountant</p>
<p>Philippine Regulatory Board of Accountancy (May 2018 &ndash; <em>present</em>)</p>
</li>
</ul>

<!---Memberships-->
<h3>Memberships</h3>
<ul>
<li>
<p>Philippine Institute of Certified Public Accountants</p>
</li>
</ul>
</div>
</div>

</section>
<!--- Training and Development-->
<div class="container">
<section class="row">
<div class="col-md-5 contents-label">Training and Development</div>
<div class="col-md-7">
<a href="https://marvintensuan.github.io">
<button type="button" class="btn btn-secondary btn-block text-decoration-none mb-5">
Link to Portfolio (GitHub Pages)
</button>
</a>
<a href="https://www.marvintensuan.com/list_of_cpds">
<button type="button" class="btn btn-secondary btn-block text-decoration-none mb-5">
Continuous Professional Education
</button>
</a>
<a href="https://www.marvintensuan.com/list_of_cpds">
<button type="button" class="btn btn-secondary btn-block text-decoration-none mb-5">
Self-Directed Learning
</button>
</a>

</div>
</section>
<section>

</section>
</div>

<!--- Academic Background-->
<div class="container">
<section class="row">
<div class="col-md-5 contents-label">Academic Background</div>
<div class="col-md-7">
<!--- Graduate: empty :( -->
<!---Tertiary-->
<p><h3>Bachelor of Science in Accountancy</h3></p>
<p>Polytechnic University of the Philippines (June 2013 to October 2017)</p>
<p>Extra and co-curricular activities:</p>
<ul>
<li>PWC M&A Challenge (2017)</li>
<li>UP JPIA APEX Challenge (2017)</li>
<li>NFJPIA-NCR 9th Annual Grand Summit (2016)</li>
<li>SYNTHESIS (2016)</li>
<li>COL-JAPI Stock Market Challenge (2015)</li>
<li>Student Representative (2014)</li>
<li>PUP JPIA Mathematics Competition (2013)</li>
</ul>
<!---Secondary-->
<p><h3>Muntinlupa Science High School</h3></p>
<p>(June 2009 to March 2013)</p>
<ul>
<li>Editor-in-Chief, Ang Matyag</li>
<li>Finalist, Philippine Robotics Olympiad 2012</li>
<li>Champion, 9th UP-ERG Dagitab Competition</li>
<li>Outdoorsman, Boy Scouts of the Philippines</li>
</ul>
<!---Primary-->
<p><h3>Itaas Elementary School</h3></p>
<p>(June 2003 to March 2009)</p>
<ul>
<li>8<sup>th</sup> honorable mention</li>
<li>Science News Editor, Rootlets</li>
<li>Patrol Leader, Boy Scouts of the Philippines</li>
</ul>
</div>
</section>
</div>
{% endblock %}

0 comments on commit 9264491

Please sign in to comment.