Search code examples
pythonreactjsweb-applicationsflask-sqlalchemyclone

Execution commands for a Trello-like program on GitHub


Background

I'm trying to execute the Trello-like program on GitHub: https://github.com/delitamakanda/treelo.

The README.md file on the GitHub was not written detailed, so I would appreciate it if you could explain it to me to run it on the browser.

Problem

It has failed to do it with the following command and environment settings.

Error Message on http://127.0.0.1:5000/

Not Found
The requested URL was not found on the server. 
If you entered the URL manually please check your spelling and try again.

Execution Command

$ FLASK_APP=manage.py FLASK_DEBUG=true flask run

Terminal Response

127.0.0.1 - - [04/Nov/2019 11:43:03] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [04/Nov/2019 11:43:03] "GET /favicon.ico HTTP/1.1" 404 -

What I did

On the treelo-master folder, I have executed the following command on Terminal and it was succeeded to create a virtual environment with requirements.txt.

$ python3 -m venv env
$ source env/bin/activate
 pip install -r requirements.txt

Response

Installing collected packages: SQLAlchemy, MarkupSafe, Mako, python-editor, 
six, python-dateutil, alembic, aniso8601, click, Jinja2, itsdangerous, 
Werkzeug, Flask, Flask-Cors, Flask-SQLAlchemy, Flask-Migrate, pytz, 
Flask-RESTful, Flask-Script
 Running setup.py install for SQLAlchemy ... done
 Running setup.py install for MarkupSafe ... done
 Running setup.py install for Mako ... done
 Running setup.py install for python-editor ... done
 Running setup.py install for alembic ... done
 Running setup.py install for itsdangerous ... done
 Running setup.py install for Flask-Script ... done
Successfully installed Flask-1.0 Flask-Cors-3.0.4 Flask-Migrate-2.1.1 Flask-RESTful-0.3.6 
Flask-SQLAlchemy-2.3.2 Flask-Script-2.0.6 Jinja2-2.10.1 Mako-1.0.7 MarkupSafe-1.0 
SQLAlchemy-1.3.0 Werkzeug-0.15.3 alembic-0.9.9 aniso8601-3.0.0 click-6.7 
itsdangerous-0.24 python-dateutil-2.7.3 python-editor-1.0.3 pytz-2018.4 six-1.11.0

Solution

  • The above project is basically telling you to open two terminal instances. In one of them, you have to run

    npm install
    npm start
    

    This will spin up your frontend app in the default webpack port.

    The Flask setup requires you to run the virtualenv. If you don't have it please install it using the link here - https://virtualenv.pypa.io/en/latest/installation/

    After doing so you have to execute the commands in the API as they are given in the README.md

    virtualenv venv
    
    source venv/bin/activate
    
    ## exit venv
    exit venv
    
    # run debug server
    python manage.py server
    
    # create db
    python manage.py db init
    
    # scan all new tables and columns
    python manage.py db migrate -m "initial migration"
    
    # apply migrations
    python manage.py db upgrade
    

    This will spin up your Flask Server successfully at http://localhost:5000/api. I think the last steps you have already done so your server should be up and running if everything went correctly.