GithubHelp home page GithubHelp logo

edgecaseberg / greenup Goto Github PK

View Code? Open in Web Editor NEW
3.0 14.0 3.0 44.97 MB

Vermont National Hack for Change day application

License: MIT License

OpenEdge ABL 0.07% Java 2.12% PHP 4.06% ApacheConf 0.85% CSS 10.52% JavaScript 36.54% HTML 35.40% Shell 0.01% Objective-C 10.35% C 0.10% Ruby 0.01%

greenup's Introduction

GreenUp WebClient - v0.01

Powered by XenonApps

GreenUp Repository for Client and Administration

A mobile-web client for GreenUp-VT

  • Tabbed menus
  • Interactive Maps
  • Discussion forum

###Dev Notes

#####Use of the proxy script:
For development: In order to bypass the browser's origin-based security measures, it is necessary to run a php script locally that proxies all HTTP requests to the live web-server.

Using the proxy is simple.
Instead of making requests to http://199.195.248.180:31337/api, I make a request to http://localhost/proxy.php?url=http://199.195.248.180:31337/api.

Whereas the live server would return: { "heartbeat": 1389547522 }
the proxied response looks like: { "status": "http_code": 200 }, "contents": { "heartbeat": 138954752 } }

Note: There will be a line in the ApiConnectors that identifies the origin and switches the proxy script in and out accordingly.

####Problems with SSL and Google OAuth:

The Admin dashboard uses Google Analytics data to feed some of the usage graphs, so when a user enters the admin dash he is prompted to login with google credentials. The dash uses these credentials to authenticate into google analytics, all over HTTPS. If you log in as you... you won't see analytics data, as the site will be looking for an anlytics profile for YOUR account. I am working on fixing this, but until I do, you have to log in as [email protected]

Furthermore, you have to connect to your localhost using https://127.0.0.1 meaning you'll have to configure Apache to listen for ssl traffic, and generate a certificate.
Mac users, see this tutorial

License

GPLv

greenup's People

Contributors

amilnarski avatar dewittcmd avatar edgecaseberg avatar joshuadickerson avatar justcadams avatar segfault802 avatar smacewan101 avatar the-hobbes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greenup's Issues

Subdomain redirects to wrong appspot domain

The greenup.xenonapps.com domain maps to greenupapi.appspot.com.

but it should redirect to greenupapp.appspot.com that way we have the web client available form the subdomain.

Duplicate Forum messages

To replicate:

Go to communication panel.
Click show all.
Click any other button. There will be leftover messages from the show all in the panel.

Push Alerts for GreenUp Organization

A way for the GreenUp organization to send push messages to client applications during GreenUp that would cause an audible and/or visual alert.

Organized campaigns

Organizations should be able to contribute to an individual campaign (GreenUpVT would be an example of a campaign)

Dynamic default zoom based on # of participants and size of participant coverage area.

The client's map should initially center and zoom on the most useful possible area.
Moving and zooming the map sucks. The more the map needs to me moved and zoomed, the more it sucks.

The server should use an "overview" of all client data for a given area to generate an initial center and zoom level for the client.

For instance: if thousands of participants were picking up garbage in Manhattan, the most useful zoom would be on a block-by-block basis, whereas participants cleaning up The Long Trail might want to see 60 miles of trail at an initial zoom.

Idea for reducing loading time

If, on the map page, we rendered a low-quality shitty "generic" map image, with a button over the ui offering to show the user his/her map after which we would ask for GPS and render the content, we could first load all the basic UI content needed for the slide effect and buttons to work responsively.

Need to use ajax on submits

We need to use ajax instead of form submits to post comments. Refreshing the page sucks and looks shitty.

Idea to reduce calls to the API

When we post the lawnchair data (currently every 30 seconds), the API should return the newest set of heatmap and icon coords, instead of making unique calls to get that data.

Coding Coherency and Conventions

We need to have some overall coding conventions. This issue is to provide an open forum for developers to voice which coding styles, practices, and style's they would prefer to use.

Add support for filtering by listed parameters for the heatmap datastore queries

We need to have some type of query to the heatmap that represents retrieving a bounding box size of heatmap gridpoints. For example:

http://greenup.xenonapps.com/api/heatmap?latDegrees=23.45&latOffset=2.0&lonDegrees=40.3&lonOffset=5.12

Will ask for all the coordinates from lat: 23.45 - 25.45 and lon: 40.3 - 45.3
You don't need to worry about handling the offsets yourself, that will be handled by the heatmap.py file while parsing the request. But currently we only have a precise query for heatmap points (lat=, and lon= ). and we need support for x < lat < y && i < lat < j

I can call the GridPoints.all().filter.... myself, but I was hoping to abstract all database logic to the datastore class to keep them seperate (if we ever change the database backend)

nametypedescription
latDegreesfloatThe latitude boundary of the grid of points to retrieve,only values between -90.0 and 90.0 will be accepted.
latOffsetunsigned floatOffset to add to the latitude point to create a bounding rectangle on the points retrieved. Required if latDegrees is used
lonDegreesfloatThe longitude boundary of the grid of points to retrieve, only values between -180.0 and 180.0 will be accepted.
lonOffsetunsigned floatOffset to add to the longitude point to create a bounding rectanlge on the points retrieved. Required if lonDegrees is used
precisionunsigned integerThe integer precision for rounding degrees. It is recommended to leave this blank unless you know what you're doing.

Weird response from a POST to API (/pins)

WebApp:

When I POST a serialized pin object to the API, I get a 503 response. However, using Chrome's network inspector: click on the call to /pins that returned 503, inspector shows 200 (and the correct json-formatted response).

Note: if I send a serialized Pin with an incorrect "type" field, I get the appropriate error:
{"Error_Message" : "Pin type not a valid type." }

Degrading heatmap

Over a user-adjustable period of time, the heat-map points should degrade, such that areas that were formerly visited will eventually show that they weren't visited.

Map UI

The dialog that pops up when you have to add a point is poorly styled -> needs better buttons, and better centering of content.

Pin submission flow

With the newest pull from develop I'm experiencing a couple of things.

  1. My browser is locking up a bit and dying a miserable death. I assume this is just it not having a good time and all the testing we're doing is killing it a bit.
  2. When I click on the map to send a pin, the pin is submitted when I click the button. Then the message dialog pops up for me to write a message. When I click OK there is no pin pushed. Shouldn't we pop up the message, get the message, and then submit the pin when the OK button on the dialog box is clicked?
  3. When I click OK the dialog to select a pin doesn't go away anymore.

I think I need to get on gchat with @JoshuaDickerson or hang out and code with him in get a feel for how everything is working together. I'm not expecting everything to be done, but I think I need a bit of information on how the whole UI is working before I can be sure that everything is working on the js apiconnector side.

iOS ignore file

Josh,

Can you create an ignore file for ignoring x code files and DS_STORE's and whatnot from the ios branch? I'd prefer not to pull down iOS specific clutter onto my machine. And then remove the ignored files from the repository so they're not cluttering up the repository listings?

(API) Comment pagination strange results

The result from a GET to /api/comments returns 20 results and a link to page 2.. that then returns 3 results and a link to page 3... that then returns 5 results and a link to page 4.

Page 4 has no result, but does include a link to page 5 which in turn includes a link to page 6... and on

I did this with POSTMAN (local appEngine runtime) and the API spec after battling with the pagination issue #50. I think pagination, from a UI perspective is working, but can't be sure.

Also.. The results are frequently inconsistent with what is expected (messages that I POSTed aren't returned), but I'm not sure this is a bug, or the result of my incidental testing

Optimizations for large amounts of coordinate points

As of right now the query to get the points is for ALL data. which is not a good idea if 100,000 people suddenly use this application all at once. We need to query the map' zoom level or coordinates around the edge of the map in order to restrict the query to the nearest boundary point of our self defined grid. This can be done once everything else is done, but needs to be done before deployment of the application .

Route JS requests on Apache to a local AppEngine instance

Problem: When testing the webApp locally in Apache (port 80), you also need to run the API on an AppEngine instance, which must run on a different port thus violating the same-origin rule for JS requests to the AppEngine.

Solution: Configure mod_proxy to forward requests to a given folder to the port the AppEngine serves.

See a section of my http.conf (Mac OSX) here

API Forwarding issue.

Steps to reproduce:

  1. open POSTMAN Rest client or some method of sending HTTP requests
  2. Send POST method to ANY resource endpoint to greenup.xenonapps.com/api
  3. See that you get a response as if you had sent a GET request
  4. Send POST method to ANY resource endpoit at greenupapi.appspot.com/api
  5. See that you get a valid POST response.

The problem here is that somehow the forwarding is somehow changing the POST requests into GET's which makes no sense and I have no idea how that's even possible. Doesn't a simple redirect send along the HTTP method as well?

Need to optimize the JS

  • remove JQuery
  • events should happen serially
  • don't need to constantly poll the GPS while performing GUI animations

Persistence for individual data points

If we move to individual campaigns and more personalized data, should we persist each datapoint (as well as incrementing a rounded lat/lon set) in the DB?

Cleaning up UI

Change UI on home page to show that you are in fact cleaning up after you press cleaning up

Strange behavior with Python ulrlib.openurl

Steps to reproduce:

  1. Open a python shell
  2. f=urllib.urlopen('http://greenup.xenonapps.com/api')
  3. print f.read()
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br/>   "http://www.w3.org/TR/html4/strict.dtd"><br/><html><br/><br/><head><br/>  <title>GreenUp-VT API </title><br/>  <META name="description" content="Application for the organization of GreenUp-VT activities"><META name="keywords" content="greenup, greenup-vt, greenupvt, xenonapps, xenon, app, android, ios, webapp"><br/></head><br/><frameset rows="100%,*" border="0"><br/>  <frame src="http://greenupapi.appspot.com/api" frameborder="0" /><br/>  <frame frameborder="0" noresize /><br/></frameset><br/><br/><!-- pageok --><br/><!-- 06 --><br/><!-- --><br/></html>

This however works perfectly fine:

  1. Open a python shell
  2. f=urllib.urlopen('http://greenupapi.appspot.com/api')
  3. print f.read()
    {"version": 1.0, "powered by": "Xenon Apps"}

lat-long coords

Currently, the map is not centered on the user's lat-long, and the heat map data is not being populated from the DB. (Use AJAX to get the data so as to make the app more modular/universal)

A unified way to update client configurations

Client updates:

  • It is almost certain that the clients will need to be updated from time to time (e.g. server host, new features)*

If we rely on updates being pulled from the respective app-stores, we'll have to provide legacy support for those apps that don't get updated (or let them die). If instead we have the clients pulling config data from the server, we will either need an auth mechanism, or else send all data via cleartext json.

android/eclipse ignore file

@milus16

Can you make sure that when you're creating an android branch that no project files from your eclipse configuration and all that get pushed to the repository? There should be some good resources floating around with a quick google search for good ignore files.

Historical markers / heat-map

Users should be able to view the map as a function of history.
Users can see what areas were covered in the previous day/month/year.

Documentation per folder

It would be a good idea to include readme.md files in each of the folders and subfolders to provide documentation on the files and methods within.

On a related note:
Collin discussed a tool that they use at their work that forces coding conventions and helps provide documentation during development. I think most of us use Sublime Text 2 to create code, so I don't know if we can have anything that forces us to code a certain way, but once we've decided on coding conventions we could possibly right some kind of script that generates documentation for us (like the javadoc tool). I've written one for one of my own projects before that generated some pretty simple markup and html files. Once we've decided on conventions we can possibly work on something that checks the format of those type of comments and provide it as a script to run to verify that your code is written to standards.

memcache structure

I've been giving some thought to implementing caching for the API: We have a different namespace for each potential project in memcache (eg for this one, Greenup). Then we have each key in memcache associate with a particular entitiy (for example, making a request with the key Pins would retrieve and store all of the pins from the datastore into memcache). Each time new information is inserted into the entity, memcache is updated. This way the user always requests data from the cache, and never the database. The only issue with that is the granularity of user queries: if a user wants to get all pins from a certain time period of example, he would hit memcache, memcache would supply all of the pins, and then we would need to implement a function to retrieve a certain range of pins (a similar procedure would be needed for other entities). Is that ok? I am not sure about the speed of such a structure.

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.