Gentle Introduction to Developing modern web apps in R & Python 1.15pm - 4.15pm
Schedule and Deliverables: https://algorit.ma/kickstart-introduction-developing-modern-web-apps/
Web App template (download link): https://github.com/onlyphantom/darkershiny
-
What do we want in a "modern" web application?
- Able to be hosted on cloud / physical
- AWS (Amazon Web Services)
- Microsoft Azure
- Alibaba Cloud
- Google Cloud ...
- In a production app, it needs to be able to work with all kind of data sources
- SQL, Oracle, Postgre, ...
- APIs (twitter, facebook, google trends, wiki...)
- Security
- Responsive / Mobile-friendly
- Generous and permissive license / Open-source
- Administrative features
- Account system
- Log in / Log out
- Mail servers
- Admin features
- Flexibility to incorporate JS / CSS elements as necessary
- Example: integrate Bootstrap
- Able to be hosted on cloud / physical
-
How do we gain the skills required for objective #1
- Prerequisites: R, Python, Git
- Visual Studio Code
- https://code.visualstudio.com/download
- Alternatives: Atom, Sublime, Notepad++
- RStudio
- https://www.rstudio.com/products/rstudio/download/
- SQL Editor
- TablePlus (find a free alternative)
- GitHub
- https://github.com
- Jupyter Notebook / Lab (installed through conda)
- https://jupyter.org/install
- The git url: https://github.com/onlyphantom/darkershiny has installation instruction and available to download as zip
git clone ...
- On your desktop (or anywhere you want), paste the
git clone
command into a terminal (command line / command prompt) - Once completed, in the folder find
app.R
. Right click -> Open in RStudio - Once opened in RStudio, click on the "Run app" button
- Create a virtual environment
- Create a new file on your computer, name it
app.py
- Install flask into your environment
pip install flask
orconda install flask
- Write the base template:
from flask import Flask
app = Flask()
@app.route('/')
def home():
return 'Hello, this is home!'
app.run()
- In your terminal, run the app by doing
flask run
- https://github.com/onlyphantom/lebaran