Skip to content

Two-tiered application using Shape Up technique and GitOps methodology

Notifications You must be signed in to change notification settings

dennislwm/archiveso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

archiveso

Netlify Status Docker Pulls Docker Build Docker Build dennislwm GitHub last commit

This project is an end-to-end application that consist of (1) static no-code front-end; (2) stateless back-end that serves request to and from an instance of ArchiveBox; and (3) CI pipeline to test and deploy a custom Docker image.


Overview

Overview


Things to learn and research

In no particular order, my plan is to use the following resources to learn and research.

Title Author Publisher Date [Short Code]
E-Book: Hands-On Docker for Microservices with Python Jaime Buelta Packt 2019 [Buel2019]
E-Book: Shape Up Ryan Singer Basecamp 2021 [Sing2021]
Lowdefy Documentation Lowdefy 2022 [Lowd2022]
Python API Usage - ArchiveBox Documentation ArchiveBox 2022 [Arch2022]

Place, Affordance, Connection

  • Places users can navigate

    • Lowdefy app e.g. https://archiveso.netlify.app
    • Python Flask server (with cloudflared as a service) e.g. https://archiveso.markit.work
    • Docker Hub e.g. https://hub.docker.com/repository/docker/dennislwm/archiveso
  • Affordance users can act

    • Docker pull docker pull dennislwm/archiveso:latest

Workflow

This project uses several methods and products to optimize your workflow.

  • Use a version control system (GitHub) to track your changes and collaborate with others.
  • Use a static analyzer (prospector) to help write your clean code.
  • Use a build tool (Makefile) to automate your development tasks.
  • Use a package manager (Pipenv) to manage your dependencies.
  • Use a testing framework (pytest) to automate your testing.
  • Use a containerization platform (Docker) to run your application in any environment.
  • Use a continuous integration pipeline (CircleCI) to automate your static analysis and image deployment.
  • Use an artifactory (Docker Hub) to store and pull your image.
  • Use a low-code framework (Lowdefy) to build your dashboard.
  • Use a continuous deployment infrastructure (Netlify) to automate your front-end hosting.
  • Use a secured tunnel (cloudflared) to manage your back-end locally.

Usage

Prerequisites

Before running the Lowdefy app on your local workstation, you need the following:

Click here to get started.
  1. Open a new terminal and run a Docker container with the Python Flask server on your local workstation. This command pulls the image from Docker Hub if it doesn't exist.
docker run --rm -d -p 8080:8080 --name objArchiveso dennislwm/archiveso:latest
  1. Run the cloudflared tunnel to expose your Docker container on port 8080 to a custom domain, e.g. https://archiveso.mydomain.com.
cloudflared tunnel --config ~/.cloudflared/config-archiveso.yml run

The tunnel remains opened as long as your don't terminate (CTRL-C) the connection.

  1. Open a new terminal and build the Lowdefy app.
cd front
npx lowdefy@latest build
  1. Run the Lowdefy app on your local workstation.
npx lowdefy@latest dev

Getting Started


Shaping

As shaping and building have independent cycles, we will define shaping as any work that does not involve implementation of code. This work may include evaluation, feasibility, comparison, research, etc.

We set a time constraint of 9 workdays, for shaping, and an additional 9 workdays for building. Hence, the total time for this project is approximately 20 workdays with a cool-down of 2 workdays.

This project started on 26-Jan-2022 and has been completed on 15-Feb-2022 (13 days), which was ahead of the expected completion date on 24-Feb-2022. The shaping cycle was completed on 8-Feb-2022 (8 days), while the building cycle took 5 days.


Building

This steps are repeatable, i.e. expose and test an endpoint and build a page to allow user interaction.


Limitation

  • The CI pipeline does not perform the last mile delivery, i.e deploy the Docker container Python Flask server app after it has been tagged and pushed to Docker Hub. The Continuous Delivery ["CD"] pipeline is not implemented.
  • Currently, I'm hosting the Docker container on my local workstation, i.e. http://localhost:8080 and using Cloud Tunnel to access it via https://archiveso.mydomain.com.

Methodology

  • Shaping and building have independent cycles.
  • Shaping requires a level of abstraction that is neither too concrete (wireframe) nor too abstract (words).
  • Time constraint as an appetite for both shaping and building.
  • Integrate one slice from UI to backend during shaping.
  • Make a bet for what to build and honor it.
  • Choose either a base, bull or bear cycle length with cool-down.
  • Break a project into independent scopes, each with a smaller period, on a hill chart.
  • Each independent scope should include details such as places a user can navigate (S3 bucket), affordances a user can act (/api/upload), and connections a user are taken to (api/upload -> S3 bucket).
  • Integrate all scopes to form a minimal intentional product [MIP].

Project Structure

root
|- README.md                                  <-- This README markdown file
|- .gitignore                                 <-- Git ignore file
+- doc/                                       <-- Holds documentation files
+- img/
   |- shape.drawio
+- app/
   |- Pipfile                                 <-- Requirements file for app
   |- Pipfile.lock
   |- Makefile                                <-- Makefile for app, image and dependency
   |- main.py                                 <-- Python file for app
   |- Dockerfile                              <-- Dockerfile for app
   |- docker-compose.yml                      <-- YAML file for CI static-analysis
   +- src/
      +- archiveso/
         |- __init__.py
         |- clsArchiveso.py
   +- test/
+- .circleci/                                 <-- Holds CircleCI files
   |- config.yml                              <-- Config file for CI pipeline implementation
+- front/                                     <-- Holds Lowdefy front-end static files
   |- lowdefy.yaml                            <-- YAML file for Lowdefy root schema
   +- auth0/
   +- components/                             <-- Holds YAML files for Lowdefy reusable components
   +- pages/                                  <-- Holds YAML files for Lowdefy pages

Troubleshooting

  1. Argo Tunnel error

Your cloudflared tunnel is not running as a service.

cloudflared tunnel --config ~/.cloudflared/config-archiveso.yml run

Reference

The following resources were used as a single-use reference.

Title Author Publisher Date [Short Code]
GitHub Repo: Flask Ticket Dennis Lee 2021 [Dlee2021]
Creating a Python Makefile - Earthly Blog Aniket Bhattacharyea 2021 [Bhat2021]
Command Line Interface - Flask Documentation Flask 2022 [Flas2022]
About fixtures - Full pytest documentation pytest 2022 [pyte2022]
GitHub Repo: Flask tutorial Pallets Projects 2022 [Pall2022]
pipreqs 0.4.11 - Project description Vadim Kravcenko 2022 [Krav2022]
Autodocumenting Makefiles Daniel Greenfeld 2022 [Gree2022]
GitHub CI/CD tutorial: Setting up continuous integration Stanley Ndagi 2022 [Ndag2022]
Python static code analysis tools Timothy Mazzucotelli 2017 [Mazz2017]
Build and Deploy only on PR request Accept CircleCI 2021 [Circ2021]
Using CircleCI workflows to replicate Docker Hub automated builds Jonathan Cardoso 2020 [Card2020]
GitHub Repo: lowdefy-example-openid-connect lowdefy 2021 [Lowd2021]
Developing RESTful APIs with Python and Flask Bruno Krebs 2021 [Kreb2021]
Building a RESTful Blog APIs using python and flask - Part 2 Olawale Aladeusi 2018 [Alad2018]
How to Handle JWTs in Python Jessica Temporal 2021 [Temp2021]
Flask-HTTPAuth documentation Miguel Grinberg 2022 [Grin2022]
Docker ARG, ENV and .env - a Complete Guide Vladislav Supalov 2022 [Supa2022]
A ‘Hello World’ GitOps Example Walkthrough Ian Miell 2022 [Miel2022]
GitHub Repo: lowdefy-example-case-management lowdefy 2021
How to use Shortcuts on iOS to automatically save link to GitHub as a Reading List Yi 2022
GitHub Repo: A timesheet application built in FastAPI and IDOM dyvenia 2022
Argo Tunnel as a service Nuno Diegues 2021

About

Two-tiered application using Shape Up technique and GitOps methodology

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published