Giter Site home page Giter Site logo

nightmnare / commentapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaossa/commentapp

0.0 0.0 0.0 20 KB

Simple Firebase + Flask anonymous comment web app. Homework done @ IIC2173 PUC

Home Page: comment-app-five.vercel.app

License: GNU General Public License v3.0

Python 90.95% HTML 9.05%

commentapp's Introduction

CommentApp

Simple Firebase + Flask anonymous comment web app. Homework done @ IIC2173 PUC. Application deployed at Google Cloud Platform, using a VM Instance, on Ubuntu 18.04.

Stack

Why Flask? The expected application is really simple: an anonymous comment application. The simplest design should have few routes: the comment form (/), a view of the created comments (/comments) and a route to create the comments (/comments/new).

Why GCP? It's free trial and complete status panel made easy to start the development. It's Cloud Shell allowed to try different comments and setup a custom environment really fast. Bad things? Most of the interesting solutions involve working with more GCP services, but I avoid using another machine. I end up using Firebase (I know it's related to Google anyway).

Why Ubuntu 18.04? It's the same version I use on Windows Subsystem for Linux (WSL), on Windows 10, so I'm familiarized with it.

Why Firebase? Fast, easy to setup and free.

Solution

The application is simple. The routes were created with Flask, and the comments were stored using sqlite. Once the solution was deployed, there were problems while saving updates to the file used as database. So, instead of relying in a file (at least one living in the same server) I preferred to store the comments in a Firebase database, using its API through a simple wrapper, Pyrebase.

To be honest, I tried different solutions:

  • Flask + sqlite, on Google App Engine: Didn't work because I was not able to update a file on production (also, wasn't sure if it was running on port 80)
  • Flask + Firebase, on Google App Engine: It worked! But it was weird to work without touching a server. Something was wrong.
  • Flask + Firebase, on Google VM Instance: After a lot of trouble trying to use the right port, it worked โœจ

References

commentapp's People

Contributors

aaossa 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.