Skip to content

Technic challenge Platzi at Master. Apalabrados is a nice database to save the user input and store it according to the data type.

Notifications You must be signed in to change notification settings

isabelyb/apalabrados

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apalabrados

Apalabrados is a nice database to save the user input and store it according to the data type.

  • Numbers: It saves your input and accumulates with the last accumulated.
  • Text: It saves your input and its first and last character.
  • Special characters: It saves it from your input, only the special characters.

This Web App is part of challenge of diagnostic in Platzi Master Cohort[8].

How to use it

  • Step 1: go to Home and insert and input you want.home

  • Step 2: When you have submitted an input Apalabrados redirect to app response. There you can see the result of database that is saved and processed the input according to the data type. submit

You could go to back to the home and try the times you want!

How to I made it

To develop this app I followed this steps in its order.

  1. Start a github repository.

  2. Made a first version of the process with data flowchart. Then I have to adjust some details i nthe develop app process. data_process

  3. How I feel more comfortable with Python, I looked for a better way to do a Web App using it. I found the more efficient tool was Flask, so I learned from zero how to do it. I read a lot of sources, these were the most helpful for me:

  4. Made a first version of the App structure. As the proces data flowchart I have to adjust some details in the develop app process. app_structure

  5. Looked for learning about how to connect MongoDB with a Flask App. Some time ago I have learned about some basics from mongo in Platzi. Mongodb Pythonbasics tutorial

  6. Code! By the way, my computer runs Ubuntu 20.04.  
    6.1. Create a virtual environment: virtualenv venv -> source venv/bin/activate.

    6.2. Install Flask: pip3 install Flask

    6.3. Create file main.py in order to start my web app.

    6.4. Config environment variables from the command line. export FLASK_APP=main.py -> Define to run Web App from main.py export FLASK_DEBUG=1 -> Turn the debugger on to follow the Web App development.

    6.5. Run Flask to try the Web App: flask run

    6.6. Saved requirements.txt. Update every tool installation: pip3 freeze > requirements.txt  

    6.7. Create database in mongodb: mongo_db

    6.8. Install Flask-PyMongo and conect database with the Web App.

    6.9. Create the Python code to manage data from the user Input with Mongodb. I used pandas too, to do it.

    • Methods POST and GET to send and get data with Web App from mongodb.
    • Create a classifier function to save all data in the right mongo collection according to the datatype.
    • Create a function to get updated data from mongo and render in HTML table to show in the Web App. I use pandas to do it.
    • Last details in basic HTML with code to show the information in the Web App. I use the Jinja Templates to do this.

Deploy in HEROKU

  1. Created runtime.txt file: This is requierement to set the Python version to run the Web App.
  2. Install the web server for Python gunicorn and created the procfile file in order to specify to heroku how to start the App.
  3. Install the Heroku Command Line to perform the App in Heroku.
  4. Made the integration of my GitHub repository with Heroku.

My Web App was deployed and I felt so happy for this. Apalabrados is my first Web App complet from zero to deploy.

deploy

Finally I finished to write the README.md file.

View Apalabrados deployment here

Issues

There are some issues. To read go here.

Instructions to Download

This is a brief guide, You should adapt it to your own software requirements.

  1. In the Apalabrados Repo, go to download zip file:

download

  1. Extract file.

  2. From command line, in the app root create a virtual enviroment.

  3. Inside venv install Web App requirements: pip3 install -r requirements.txt

  4. To run in local: 5.1. Config environment variables from the command line: export FLASK_APP=main.py and export FLASK_DEBUG=1 5.2. Run Flask to try the Web App: flask run

  5. To deploy in Heroku go to the website instructions here.

About

Technic challenge Platzi at Master. Apalabrados is a nice database to save the user input and store it according to the data type.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published