Git Product home page Git Product logo

bitballs's Introduction

@page DoneJS @hide title @hide sidebar

DoneJS logo

npm version Build Status Build Status Coverage Status

DoneJS is the easiest way to get a high-performance, real-time, web and mobile application done! The framework provides a nearly comprehensive combination of technologies for building complex JavaScript applications.

If you are looking for the fastest way to get a fully modern development environment setup and produce a lightning fast application, you’ve come to the right place.

DoneJS is a combination of the following technologies:

  • StealJS — ES6, CJS, and AMD module loader and builder
  • CanJS — Custom elements and model-view-viewmodel (MVVM) utilities
  • jQuery — DOM helpers
  • jQuery++ — Extended DOM helpers
  • QUnit or Mocha — Assertion library
  • FuncUnit — Functional tests
  • Testee or Karma — Test runner
  • DocumentJS — Documentation
  • can-ssr — Server-side rendering utilities for CanJS

DoneJS is an npm package that simply installs all the previous technologies. Check out DoneJS.com for the collective benefits of these technologies and guides on how to use them together to build an amazing application.

Contributing

Greenkeeper badge

Check out the contribution guide on DoneJS.com.

bitballs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

bitballs's Issues

Add an "or register" link next to to the Login button

Add a "or register" link next to the login button that takes people to the "Create User" page.

localhost_5000_dev_html__user

Next:

  • Change the routing so the /user page is now `/register.
  • Instead of saying "Create User", it says "Register new user".
  • Change the "Create" button to "Register".

cursor_and_localhost_5000_dev_html__user

Make User, Session and Player Model tests that test the server.

  • - move all Bookshelf models in to Models.
  • - Make the first user that signs in the admin, not "[email protected]" #16 .
  • - protect player service CUD methods unless someone is logged in
  • - Make a "dev" folder in services. This is where services that are only supported in DEV might go.
    • A service that allows clearing all users.
    • A service that allows clearing all players.
  • - Add any necessary methods (createListData) to data-url and can/map, and update can-connect's docs.
  • - Write a test that does the following:
    1. In setup, clears all users, players, and logs the person out.
    2. Creates a user (which will be admin), logs them in, creates a player, is able to get that player.

Code Review all the things

We will need to review every module and identify and prioritize any problems with it. Problems may include:

  • less than ideal code
  • lack of tests
  • lack of docs
  • lack of demo page

Report error when you can't register a user.

If I try to create a user without an email or password, the server doesn't let me. But I should see the reason why.

cursor_and_localhost_5000_dev_html__user

The same thing should happen if you try to update a user's password.

Login errors

Related to #71, if someone logs in with the wrong username / password, we should report this.

Tournaments must have a date

Similar to #51, we should make sure tournaments must have a date on the DB level. Then we should propagate that error to the client and show it next to the create button.

Setup CI and CD the way the PMO guide suggests.

Good testing and dev workflows are one of the most important things we can provide. Lets get them in place asap.

Here's what's needed:

  • - Figure out what tests are working and have public/src/test.js load them:

For example: http://localhost:5000/components/game/details/test.html currently passes. There will be other passing tests inside the src/components folder. Make sure they are all imported by public/src/test.js. Make sure src/test.html runs and passes all tests.

  • - setup testee to pass locally

Something like this testee script should work. It should probably be in public/package.json. But then make sure package.json's test script runs public/package.json's test script.

  • - setup CI

Setup continous integration as is shown in the PMO guide

Then make sure everyone knows and starts using it to submit pull requests!

  • - setup CD

Finally, when master is merged, we want a deploy to heroku and firebase. The instructions for this are in the PMO Guide. As server-side rendering isn't turned on yet, you'll probably have to change index.html to point at firebase. I'd create a prod.html that loads local production files. This would make it easy for a developer to run in production with local production files.

At the end of this, we should be able to submit pull requests to master, have all the tests pass, and when we merge into master, push out the latest production code.

Allow a tag value replacement in docs

When linking to code, we need some way of specifying the tag version in one place. This will make it easy to keep the guide pointing at stable code.

Players must have a name

Prevent a player from being created if he/she doesn't have a name.

cursor_and_localhost_5000_dev_html__players

This should be done by making it a required field in the DB by creating a migration that does it. Then the error from bookshelf should be sent back to the client. Hopefully the client can put it near the create button.

Also, if you try to update a player and remove the name, it should not work.

Make live-reload work again

Currently, live-reload isn't working.

As this is a donejs app, we should make donejs develop start the node server, and live-reload correctly.

We aren't going to be using can-serve like place-my-order does.

Instead, we need to probably need to add a script to bitball's package.json that calls node index.js with an additional --develop option.

index.js needs to be updated to start live-reload. Here's how can-serve calls steal-tools live-reload: https://github.com/canjs/can-ssr/blob/master/bin/can-serve#L43. My guess is that @James0x57 did something similar for RoomPlanner.

I'm not a fan of having to spawn another process and having to depend on infanticide to kill it correctly. Findout from @matthewp if there's a way to programmatically. Perhaps a single node can only be one one process, hopefully not.

Bonus points if you can make this work in windows. Everything will have to work in windows eventually.

Handle model/server errors

For #46, #48, #51, and #53, we need to propagate server errors to display them on the client.

Since we're in the "make it work" phase and not the "make it pretty" phase, this should just include an error message by the submit button on the relevant forms.

Protect CUD services on the server

Only a logged in admin should be able to create, update and destroy:

  • tournaments
  • games
  • teams
  • stats
  • players

Anyone should be able to create a user. Admins should be able to do anything to a user. A user should be able to edit their info and delete themselves.

Make the first user that signs in the admin, not "[email protected]".

Currently, the only user marked isAdmin is a user with an email address of [email protected] or [email protected]. This happens here: https://github.com/donejs/bitballs/blob/master/services/users.js#L26

To close this issue:

  • - Change the service layer to check the number of users. If there are 0 users, that user is the admin. If there are more than one user, the user is not the admin. You can use Bookshelf's count to check how many users there are.

Guide Outline

  • - Write a guide outline
  • - Review it with everyone

Build is breaking.

OPENING: /Users/justin/dev/bitballs/public/package.json!npm
Potentially unhandled rejection [6] Error: Error loading "can-wait" at file:/Users/justin/dev/bitballs/public/can-wait.js
Error loading "can-wait" from "[email protected]#autorender" at file:/Users/justin/dev/bitballs/public/index.stache
ENOENT: no such file or directory, open '/Users/justin/dev/bitballs/public/can-wait/index.js'
    at Error (native)

Logout is broken.

Steps to reproduce:

  1. Clear your database ./node_modules/.bin/db-migrate down --count 5
  2. Restore your db ./node_modules/.bin/db-migrate up
  3. Go to #!user and create a new user. You will also be logged in.
  4. Hit Logout. Refresh the page. You are not kept logged out.

No ajax request is actually made.

Make file organization match guide.

  • remove db_client, app.json
  • move bookshelf.js, is it possible to use database.json?
  • move app.js into services
  • rename post_install to install.js
  • rename public/styles.less to public/app.less
  • remove stylesheets folder
  • remove .yo-rc, lang-logo.png, node.svg,
  • Organize fixtures and models into final folder pattern. #121

Identify bugs / QA pass

Someone needs to do a review of the app and identify any bugs it currently has. Fixing these bugs with tests will be priority.

Make server-side rendering work.

Here's what I think needs to happen to make server-side rendering work.

Make sessions work.

This site allows users to login and establish cookies. On future page requests, those cookies should be used by server-side rendering to render what a "logged in" user should see.

Everytime the client code runs, the app view model makes a request for the current session to the session service. This brings back the current user and if they are an admin.

This same code needs to run server-side. For example if a user goes to /players without having gone to any other page.

The problem is that while you can listen to /players with express, and even get the cookie, currently
there's not a good way to make the "client app running in node" see that cookie and make a request to GET /api/session with the same cookie information.

This should all happen automatically without bitballs really having to change code.

There are two things needed to make this happen.

  • - 1. Make sure the cookies from the incoming express request object are put on the "virtual DOM".

Somewhere here https://github.com/canjs/can-ssr/blob/master/lib/index.js#L55 we need something like:

doc.cookie = request.getHeader("cookie")
  • - 2. Make sure XHR requests in the "client app running in node" include the current document's cookies.

Somewhere in https://github.com/canjs/can-ssr/blob/master/lib/middleware/xhr.js we might need something like:

XMLHttpRequest.prototype.send = function(){
  // add document.cookie as a header

}

Turn on pushstate

  • - public/src/app.js should be importing can/route/pushstate/.

Setup ssr

Somewhere in index.js we need to setup the pushstate service. To keep things organized, it would be nice if the code that setup ssr was actually in a ssr.js file in this folder: https://github.com/donejs/bitballs/tree/master/services that was imported by index.js.

Importantly, we should only be rendering what the "client app running in node" understands. @daffl and @matthewp should know how to set this up.

Make the youtube embed a no-op

The components/game/details page loads youtube. This code should probably not run on the server.

Rough Draft of Guide

Write a rough draft of guide, with an emphasis on identifying the parts of Bitballs that need to be perfect.

Publish documentation to github pages

Make a script that generates the documentation and publishes it to a gh-pages branch.

This makefile serves as a good example.

The script should:

  • checkout gh-pages
  • run documentjs
  • force add the docs folder and selective parts of node_modules needed for demo and test pages to run: can, jquery, steal, can-connect, there's probably a lot more.
  • make a commit and force push it to gh-pages
  • check back out master or better would be the old working branch
  • delete gh-pages

This should run with CD and be pushed out every time someone merges into master.

Quickly creating tournaments doesn't show

There might be a problem with can-connect.

If you enter a date in the New Tournament Date field and hit "Create" twice quickly, only one tournament shows up despite making two requests.

Likely this is due to .save() being called twice on the same instance.

This is probably fixed by using {{isSaving}} to disable the create button.

cursor_and_localhost_5000_dev_html__

Unable to update user's password.

Steps to reproduce.

  1. Restart your server so you are logged out.
  2. Login as a user.
  3. Go to #!user and enter a new password.
  4. In the "network" tab, you'll notice a 404 error.

Show placeholder text instead of 0s.

Currently, the players page Weight and Height inputs default to showing 0 instead of their placeholder values as is shown below.

localhost_5000_dev_html__players

This almost certainly has to do with a type converter changing the empty string input.value into 0.

We might need a good solution for this, even adding a feature to CanJS.

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.