GithubHelp home page GithubHelp logo

code9000's People

Contributors

dive-michiel avatar drobbo avatar nicoverbruggen avatar stefchri avatar tobmav avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

code9000's Issues

Fix for messages

Currently, when an error occurs (for instance, when you are not logged in) you are redirected to "/Code9000/login/please login first", which is not optimal.

I propose you replace this by doing this:

In api.php:

 else {
    $_SESSION["msg"] = "Please login first.";
    $app->redirect('/code9000/login');
    }

Check on the page if a message needs to be displayed. If so, show it and empty the session variable (so that upon refresh your message doesn't show again).

if (isset($_SESSION["msg"])){
echo "<ul><li class='danger alert'>" . $_SESSION["loginmsg"] . "</li></ul>";
$_SESSION["msg"] = null;
}

This way messages are handled better than attaching extra text to the URI.

README.md

Don't forget to complete your README.md file with installation and other instructions.

API improvements

Switch to UNIX timestamps
Better coördinates (geoJSON, WKT)
echo int(s)

Test drive the site

Test drive the site on code9000.gent.be. Before we can do this we need to put the site live of course!

Prevent crossdomain attacks

add token to session and check if this is the same as posted with each form.

  1. Add session var TOKEN (randomly generated)
  2. Add TOKEN to each form (same as in session)
  3. Check if both are the same

Remove composer.phar from the repository

This executable should not be inside the repository, everybody needs to install it to test your project. Explain this in the README.

Add it to the .gitinore, and move your composer.phar to a directory in your PATH, so you can execute is with compser instead of php composer.phar ....

User account creation

You should be able to create a new user account.

Passwords need to be hashed and salted. (We need to implement security)

Path to config/connectiondetails is invalid

It seems that on OS X & Linux the path to connectiondetails.php doesn't seem to be correct.

Warning: include_once(/config/connectiondetails.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/Code9000/utils/connectiondb.php on line 21

Security improvements

Here's some improvements:

  • Data returned from the database should be escaped, so that injections into the HTML are not possible (URGENT)
  • Use Blowfish or at least SHA512 for security algorithm (less important, still recommended)
  • Move authentication files (make use of variables in auth)

API status codes

Status codes need to be added to the API. Working on this right now.
screen shot 2013-07-09 at 11 59 52

API calls for comments, spots, city projects, locations

We need to add more API calls to api.php.

For example, when you add a comment, JSON is sent to /api/comments, which you can access using:

$app->post('/api/comments/', function () use ($app){
$requestBody = $app->request()->getBody();
// Do things
});

We need to do this for all major data types, and allow additions, edits, deletions and of course getting the data. Data should be returned in JSON.

Note that we need a partially working front-end with AJAX calls to test out the API.

Image uploader additions

Front-end additions

  • It should be possible to tap on an image in the uploader (when uploading multiple images) to see that image enlarged in the box where the latest uploaded image is right now.
  • It should be possible to remove items from the uploaded list.

Back-end additions

  • A cronjob should take care of images not found in the database (cleanup procedure)

apply fix to other parts in API. Follow example of cityproposals (for voting and commenting)

$app->get('/api/cityproposals/:id', function ($id) use ($app) {
  $app->response()->header('Content-Type', 'application/json');
  $execute = array(":id"=>$id);
  $sql = "SELECT c.cityproposal_id, c.name, c.description, c.upvotes,        c.downvotes, c.createddate, l.coords 
          from cityproposals c 
          inner join locations l on c.location_id = l.location_id 
          where c.deleteddate IS NULL AND cityproposal_id = :id";
  $data = GetDatabaseObj($sql, $execute);


//CHECK IF USER ALREADY VOTED
 $uid = $_SESSION['9K_USERID'];
$sqlcheck = "SELECT * FROM 
    (
        SELECT * from users_like_cityproposals uls 
        where uls.user_id=:user_id and uls.cityproposal_id = :cityproposal_id 
    UNION 
        SELECT * from users_dislike_cityproposals uds 
        WHERE uds.user_id=:user_id and uds.cityproposal_id = :cityproposal_id 
    ) result";

$vars = array('user_id' => $uid, 'cityproposal_id' => $id);
$check = GetDatabaseObj($sqlcheck, $vars);
if (empty($check)) {
    $data["voted"] = false;
}else{
    $data["voted"] = true;
}
CheckIfEmpty($data, $app);
});

Sort all spottings by popularity

All spottings need to be sorted by popularity. This has to be done inside the Javascript files spots_all.js & spots_user.js where the spottings are inserted into the DOM. (Branch: api)

Add all API calls (GET, POST) for images

We need to add API calls to index.php.

For example, when you add pictures using the uploader, JSON is sent to /api/photo, which you can access using:

$app->post('/api/photo', function () use ($app){
$requestBody = $app->request()->getBody();
// Do things
});

We need to do this for all major data types, and allow additions, edits, deletions and of course getting the data. Data should be returned in JSON.

API documentation page

Create a documentation portal to easily browse the api calls that are possible.

Also description of PUT and POST must be detailed.

Deployment documentation

Please check the deployment documentation that I uploaded and verify if it is good enough, thanks.

Initial database structure

The initial database structure needs to be prepared. This includes tables like "projects", "locations", "proposals," "users", "comments", etc

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.