Skip to content

Latest commit

 

History

History
296 lines (229 loc) · 10.2 KB

baswf.md

File metadata and controls

296 lines (229 loc) · 10.2 KB

This repository contains the "bullet-proof" 4,000+ lines of source code to the UI of a dice-rolling betting game application.

The code was built while following the 22-hour video course "Build a SaaS (web) Applications with Flask" (and Docker) (bsawf) marketed at buildasaasappwithflask.com by full-stack developer NickJanetakis.com (@nickjanetakis). BTW Nick also created and maintains a course on Docker and a podcast Running in Production. Udemy.com?

The finished app in one command

The latest version of the completed app is at
https://github.com/nickjj/build-a-saas-app-with-flask.git

Unique to this website is a bash shell script I've written that enables you to run it on your MacOS laptop with one command.

  1. View my script at:

    https://github.com/wilsonmar/build-a-saas-app-with-flask/blob/master/install-bsawf.sh
    

    This script is explained in the section below.

  2. Execute the script yourself by triple-clicking this command below:

    bash -c "$(curl -fsSL https://raw.GitHubusercontent.com/wilsonmar/build-a-saas-app-with-flask/master/install-bsawf.sh)" -d -a -v 
    
  3. Open a Terminal on your mac, click on it, and keypress command+V to paste.

    The script should install everything needed, then open the app in your default browser.

    snakeeyes-landing-899x355

    e_modules/sass-loader/dist/cjs.js!./app/app.scss 249 KiB {mini-css-extract-plugin} [built]
    

webpack_1 | + 12 hidden modules worker_1 | [2020-01-17 04:59:42,036: INFO/Beat] beat: Starting...

Press Ctrl+C if you want to stop it.

  1. Open another Terminal

Install Script Explained

In the script are comments of what responses looked like.

The app

  1. Open another Terminal to run tree to see all the folders and files to the finished app:

    ├── Dockerfile
    

├── LICENSE ├── README.md ├── SnakeEyes_CLI.egg-info │   ├── PKG-INFO │   ├── SOURCES.txt │   ├── dependency_links.txt │   ├── entry_points.txt │   ├── requires.txt │   └── top_level.txt ├── assets │   ├── app │   │   ├── app.js │   │   ├── app.scss │   │   ├── modules │   │   │   └── bootstrap.js │   │   └── scss │   │   ├── _forms.scss │   │   ├── _nav.scss │   │   ├── _sticky-footer.scss │   │   ├── _typography.scss │   │   ├── _variables-bootstrap.scss │   │   ├── _variables.scss │   │   └── all.scss │   ├── package.json │   ├── postcss.config.js │   ├── static │   │   ├── 502.html │   │   ├── images │   │   │   └── snake-eyes.jpg │   │   ├── maintenance.html │   │   └── robots.txt │   ├── webpack.config.js │   └── yarn.lock ├── cli │   ├── init.py │   ├── cli.py │   └── commands │   ├── init.py │   ├── cmd_cov.py │   ├── cmd_flake8.py │   └── cmd_test.py ├── config │   ├── init.py │   ├── gunicorn.py │   └── settings.py ├── docker-compose.override.example.yml ├── docker-compose.override.yml ├── docker-compose.yml ├── docker-entrypoint.sh ├── lib │   ├── init.py │   ├── flask_mailplus.py │   └── tests.py ├── requirements.txt ├── setup.py └── snakeeyes ├── init.py ├── app.py ├── blueprints │   ├── init.py │   ├── contact │   │   ├── init.py │   │   ├── forms.py │   │   ├── tasks.py │   │   ├── templates │   │   │   └── contact │   │   │   ├── index.html │   │   │   └── mail │   │   │   └── index.txt │   │   └── views.py │   └── page │   ├── init.py │   ├── templates │   │   └── page │   │   ├── home.html │   │   ├── privacy.html │   │   └── terms.html │   └── views.py ├── extensions.py ├── templates │   ├── layouts │   │   └── base.html │   └── macros │   ├── flash.html │   └── form.html └── tests ├── init.py ├── conftest.py ├── contact │   ├── init.py │   ├── test_tasks.py │   └── test_views.py └── page ├── init.py └── test_views.py   26 directories, 70 files

Technologies used

Different packages and libraries are mentioned in various files (assets folder), but they are listed below in alphabetical order:

  1. Ajax requests
  2. Babel
  3. Bash script*
  4. Bootstrap
  5. Celery
  6. CSRF Protection
  7. distutils.util (in config/settings.py)
  8. Docker Compose
  9. ES6 JS
  10. Flake8 to analyze Python code (in cli/commands/cmd_flake8.py)
  11. Flask
  12. Flask-Mail to send emails
  13. Fontawesome
  14. Gunicorn
  15. Jinga2
  16. JSON format files
  17. NodeJs
  18. PostgreSQL persistant store
  19. Pytest package
  20. Redis cache
  21. Scss
  22. SQLAlchemy
  23. Stripe microtransaction payments for subscriptions and coupon detection. It uses RESTFUL APIs.
  24. Yarn task runner
  25. Webpack (assets/webpack.config.js)

Snakeeyes App Features

VIDEO playlist: What Does This Course Cover?

VIDEO

  • Coupon code
  • Subscriptions
  • Billing history
  • Contact form
  • Admin dashboard
  • Search through a list of users
  • [3:55] Edit details about each user
  • Internationalization (i18n)

Not Features

  • multi-tenancy

  • RESTful APIs. However, Nick created a separate Mar 28, 2018 VIDEO about building RESTful APIs.

  • GraphQL

  • Swagger/OpenAPI

Course

The course's materials promises to show "the real (battle-hardened production) way (to create the Snakeeyes app), without tedious research".

  1. Once you have paid, visit Downloading the course materials

  2. Unzip

  3. In Finder view the folders unzipped:

    06-creating-a-base-flask-app
    

07-blueprints-and-jinja-2-templates 08-testing-and-code-quality 09-creating-a-cli-script 10-using-our-first-flask-extension 11-creating-a-contact-form 12-creating-a-complete-user-system 13-creating-a-custom-admin-dashboard 14-logging-middleware-and-error-handling 15-quality-of-life-cli-improvements 16-accepting-recurring-payments 17-building-the-snake-eyes-game 18-processing-microtransactions 19-database-migrations 20-internationalization-i18n

  1. View the updates video: 3 Upgrading a Dockerized Flask App from Python 2.7 to Python 3.7.4 August 2019. 30:06

    originally python:2.7-slim from DockerHub

  2. Testing (using Pytest)

  3. CLI Script to "help manage your project" in cli/cli.py

  4. Web Sockets*

Create Another App

If you want to create your own app based on these assets:

  1. Change Nick's email in https://github.com/nickjj/build-a-saas-app-with-flask/blob/master/assets/static/502.html

TODO:

References

https://www.youtube.com/watch?v=agXtLglF5Lw&list=PL-v3vdeWVEsUDDWYgZ8ImfSORIHyrsBJy&index=10

https://s3.amazonaws.com/thinkific-import-development/49114/bsawfcoursematerial-191204-142013.zip exposed in https://github.com/JohnBobo/bsawf and https://github.com/jademount/bsawf and https://github.com/OprekAbleCom/bsawf-course-material

https://www.youtube.com/watch?v=5b8OiqQ6NuY

WSL

https://www.youtube.com/watch?v=5gu8wWX3Ob4 A Productive Linux Development Environment (WSL) on Windows with WSL, Docker, tmux, VSCode and More Dec 21, 2018 [19:32] https://www.youtube.com/watch?v=A0eqZujVfYU Developing on Windows with WSL2 (Subsystem for Linux), VS Code, Docker, and the Terminal by Scott Hanselman

Testing

Live Demo: How to Begin Writing Tests in an Untested Code Base