Coder Social home page Coder Social logo

hakesh-trom's People

Contributors

dependabot[bot] avatar omeramsc avatar rotem-lavi avatar tomermc avatar

Watchers

 avatar  avatar  avatar

hakesh-trom's Issues

Setup Heroku

We need to setup our Heroku account in order to have a server with DB in the cloud.

DoD

We're running basic Flask server via heroku

Preform reverse geo-location search - Get address

From the TLV API we have the building polygon but the address for the building.
Using the polygon we need to find out the building address.

To Do

  • Calcuate center for each building
  • Preform reverse geo-location search using the Google Maps API
  • Export the data to a file for safe keeping

Create account for Google Maps API

We need to create an account for Google Maps API. Maybe use student account to get free credits.

DoD

We have an account with enabled biling

Campaign Control Panel | Backend

Add the backend functionality to the campaign control panel:

  • Make the route to the page individual to the specific campaign

  • Add the routes to the other pages (buttons)

  • Connect to the DB and add the Jinja tags to show the campaign information.

Write and train artificial neural network

We need to write, train and export the modal of an artificial neural network that predictits the amount of money a building will donate.

Network Info

TBD

Data

  • All the bulding attributes we got from the TLV API
    • Number of floors
    • Area
    • Hight
    • etc.
  • 2 years of donation:
    • 2018 will represet the prevYearDonation
    • 2019 will represt the nextYearDonation
    • The modal will deep learn and elevate it self using those attributes

Normalization

In order to run the modal we need to normalization the data.

  • Number of floors:
    • Encode: n/100
    • Decode: n*100
  • prevYearDonation/nextYearDonation:
    • Encode: n/1000
    • Decode: n*1000
  • Neighbor ID:
    • Encode: n/100
    • Decode: n*100

Export

TBD

Setup local DB

Setup local DB and update the README.

DoD

Setup local DB (with migrations) and update the README.

Fix all forms action

In order for the server validation to actually fully work, we need to delete the url_for from all the <form action=""> tags.

Route Builder | Create route flow

We need to create route builder to mangar role, in this page we'll show the deep learning results.

Flow

  1. After a campain is created, the manager will see neighborhoods page - V
    1. #69
  2. The admin will pick a neighborhood to add and the number of teams to add - V
    1. #69
  3. For each team created a new user will be created and the login data will be shown to the admin - V
    1. #58
  4. Clicking neighborhood will show the neighborhood map + buildings
    1. #75
  5. The builds will be coloerd by the profitability (if the predicted value is more then the avarage value of the predicted values of the neighborhood).
    1. #76
  6. Clicking on the building will show the building data (address, number of floors, last year earnings and preidected earnings) and "add" button
    1. #75
  7. When the building was added, the color wil be changed to black
  8. The admin will save the route

DoD

The "create route flow" is done

Modify validation errors to be in hebrew

Try to find how to modify the content of wtforms normal validation errors (Those who are now created by a validation function)

Right now the errors are in English.

Route bilder | save and create routes

To Do

  • Add building to route
  • Remove building from route
  • Save using AJAX
  • Prevent leave when there are unsaved changes
  • Handle errors
  • Update the building list and colors
  • Show teams without routes

Push notification on new reports

When a user sends a report, the responsible manager will receive a notification.
When a report is closed by the manager, the user will receive a notification.

Manage Campaign | Frontend

This page will show all the available campaigns.
The user will be able to click a campaign in order to manage it

Bonus: Include a search box

Create Campaign | Backend

Use python flask and SQLAlchemy to:

  • add a route to the create_campaign page
  • add a visible route from the main page
  • add insertion of a campaign to DB

Lint all the files in the project

So we won't run into confusing PR's full of changes that are mostly lint changes.
and because lint is nice.

  • The best time to do this task is between slices!

Migrations in master are broken

We're getting an error when trying to run the migrations

Cause

The migration that was generated was a bad migration.

Logs

INFO  [alembic.runtime.migration] Running upgrade aaaef87dc519 -> 6173ee2d1267, empty message
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    cursor, statement, parameters, context
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.DuplicateTable: relation "campaigns" already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "manage.py", line 19, in <module>
    manager.run()
  File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/flask_migrate/__init__.py", line 96, in wrapped
    f(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/flask_migrate/__init__.py", line 271, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "migrations/env.py", line 96, in <module>
    run_migrations_online()
  File "migrations/env.py", line 90, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/runtime/migration.py", line 520, in run_migrations
    step.migration_fn(**kw)
  File "/app/migrations/versions/6173ee2d1267_.py", line 29, in upgrade
    sa.UniqueConstraint('name')
  File "<string>", line 8, in create_table
  File "<string>", line 3, in create_table
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/operations/ops.py", line 1252, in create_table
    return operations.invoke(op)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/operations/base.py", line 374, in invoke
    return fn(self, operation)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/operations/toimpl.py", line 101, in create_table
    operations.impl.create_table(table)
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/ddl/impl.py", line 258, in create_table
    self._exec(schema.CreateTable(table))
  File "/app/.heroku/python/lib/python3.6/site-packages/alembic/ddl/impl.py", line 140, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 984, in execute
    return meth(self, multiparams, params)
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1046, in _execute_ddl
    compiled,
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1288, in _execute_context
    e, statement, parameters, cursor, context
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1482, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    cursor, statement, parameters, context
  File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateTable) relation "campaigns" already exists
[SQL: 
CREATE TABLE campaigns (
	id SERIAL NOT NULL, 
	name VARCHAR(50) NOT NULL, 
	city VARCHAR(50) NOT NULL, 
	start_date DATE NOT NULL, 
	goal FLOAT, 
	creation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, 
	PRIMARY KEY (id), 
	UNIQUE (name)
)
]
(Background on this error at: http://sqlalche.me/e/f405)

Create dataset for last 2 years

We need to create dataset for all the buildings in the Tel Aviv City with the donations for the last 2 years.

To Do

  • Clean up the data from the Tel Aviv API - Remove non-residential buildings
  • Add data for each building with the donations for 2018
  • Add data for each building with the donations for 2019

Add support for using Pg

To Do

  • Add packages that allows us to query the DB
  • Add Alemic for migration managment
  • Add a simple data query in Flask

DoD

We can query data from DB

Route Builder | Add buildings

We need to add building modal and load the data from the TLV API.

DoD

We have building table and with the TLV API data

Create "Reply to report" page / feature

It can be implemented as a separate page, or as a button with a pop-up reply.

It will be available for the manager persona only.

It will change the report status to "answered"

Aquire needed data from TLV

We need to aquire data from TLV and clean it for future work

Data We Need

  • Buildings
  • Neighborhoods

DoD

We have all the data

Donation | "Select address" page

As a user, I want to be able to choose the address I'm currently at, from a list or a map, when I begin the donation process.

Groom this ticket

Update donation screen

We need to update the donation screen to fit our new project's requirements.

To Do

  • Remove credit card selection
  • Update "?" icon to lead to the "first steps" page
  • Donation link should move to the donation page, not the "first steps" page
  • Decide if we want to delete the bit selection as well
  • Don't forget to change the JS as well (Because it blocks some features)

DoD

All the To Do points are done

Fix progression bar

The main page's progression bar is looking very bad because of the bootstrap script, which we can't delete from the layout.

fix it so It'd look as It should when the script is not active

With bootstrap:
image

Without bootstrap (This is how it should look):
image

Add auto-deployments

When merging to master we need to deploy the latest version to Heroku.

DoD

Merge to master will deploy to production

Create Campaign | Frontend

You can (and probably should) use the basic layout we have from other pages.
The page will have a form with the following fields:

  • Campaign name
  • Financial target
  • City (Dropdown, try to get a list of all the cities in Israel. If you can't, use something like top 20)
  • Date (Can be a simple date field, but a calendar to choose a date from is preferred)

Notice that header&footer should be included with Jinja tags (look at other HTML files for examples)

Sketch (Ignore the lines):
Capture

Login

DoD

  • Users table
  • Login screen
  • Remeber me
  • Sessions
  • Add admin user

Route Builder | Update route flow

The admin wants to update the team route.

Flow

  1. Going to the neighborhood view
  2. Clicking on edit
  3. Remove buildings from the route
  4. Add new buildings to the route
  5. Save the updated route

Campaign Control Panel | Frontend

This page will be used as a control panel for a specific campaign:

  • It'll show the basic campaign details

  • It'll have buttons to edit the campaign and manage neighborhoods and routes

Add basic "hello world" flask app

We need to setup a basic "hello world" app using Flask.

To Do

  • Install flask
  • Setup flask server with GET / route
  • Update README file

DoD

We have a running a basic flask server

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.