Code Monkey home page Code Monkey logo

bookshelf's Introduction

bookshelf

A web application to rate and review books.

Motivation

A project to learn and implement a python flask application using Google's Firebase cloud services. At this point this includes Firebase Auth and Firestore. Updates will include Firebase Storage to store user profile images, Firebase Hosting to take advantage of serving staic files over a CDN, and Firebase Cloud Functions to manage firestore maintnance.

Technologies

  • Backend
    • Python 3.7
    • Flask
    • Firebase Authentication
    • Firebase Firestore
  • Frontend
    • html/CSS
    • Materialize CSS
    • JavaScript
  • Hosting
    • Google Cloud Run
    • Docker
  • External Data
    • Google Books REST API
  • Code Styling
    • flake8 linting
    • black formatter

Setup/Installation

Before installation the following external services are required:

  • A Firebase account is required along with a seperate project for development and testing.
  • A Google Cloud account with the secrets manager api enabled with the following secrets:
    • SECRET_KEY - used by flask for CSRF protection
    • WEB_API_KEY - used by Firebase for REST api requests.
  • Install Docker.

Clone repository:
git clone https://github.com/thewordisbird/bookshelf.git

Setup secrets, local keys, and config files:

  • This app uses the google secrets manager api. The following secrets are required for every connected project (production, development, testing, etc.):
    • SECRET_KEY
    • WEB_API_KEY
  • Download and save Firebase Service Account Key for each project (production, development, testing, etc.).
  • Update the following fields for all files in /config:
    • PROJECT_ID
    • GOOGLE_APPLICATION_CREDENTIALS
  • Add Firebase SDK snippet to /bookshelf/scripts/init.js

Usage

The application is controlled in the manage.py file. This file will set all the relevant config values for the desired run enviornment and build the docker file based off the appropriate .yml docker-compose file.

  • Run locally in development mode. Runs on localhost:5000:
    $ ./manage.py compose up
  • Stop locally run instance:
    $ ./manage.py compose down
  • Run tests:
    $ ./manage.py test

Inspiration/Resources

This project was inspired by the google bookshelf app common to many of their tutorials and Amazon's goodreads.

The management pattern is a modification and incorporation of the patterns discussed by Leonardo Giordani in his 3 part blog:
Flask project setup: TDD, Docker, Postgres and more - Part 1
Flask project setup: TDD, Docker, Postgres and more - Part 2
Flask project setup: TDD, Docker, Postgres and more - Part 3

License

MIT License

bookshelf's People

Contributors

thewordisbird avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.