a investment game Inspired by Monopoly and Paper Trading
https://investors-game.herokuapp.com/
yarn install
bundle install && rails db:setup
rails db:seed
to seed the datagem install foreman
foreman start
to runrails db:drop && rails db:create && rails db:migrate && rails db:seed
run rails g model user && rails g scaffold_controller api/user --api
(for pure api resource) (replace api/user with your model name), it will generate the following files for you:
// ComponentDidMount()
useEffect(() => {
fetchAllTicks('2009-01-02 07:06:00', '1d', 'AAPL');
}, []);
// ComponentDidMount() and ComponentDidUpdate()
useEffect(() => {
fetchAllTicks('2009-01-02 07:06:00', '1d', 'AAPL');
});
// ComponentWillUnMount()
useEffect(() => {
fetchAllTicks('2009-01-02 07:06:00', '1d', 'AAPL');
return () => alert('unmounting')
});
rails g react:component Users users:array
based on react component name and props it takes. reference: https://github.com/reactjs/react-rails#component-generatorRoute
to wherever your routes defined for your new top-level componentajax
yarn add react-redux redux redux-logger redux-thunk
if you need redux, and add provider to root.jsx
foreman start
and it will load webpack as well, supports auto-reloading when there's code changeyarn global add npm-check-updates && npm-check-updates -u && yarn upgrade
GET /
StaticPagesController#root
ticks
GET /api/ticks
- return all ticks matching conditions
start_time
, end_time
and symbols
ticks
column name | data type | details |
---|---|---|
id |
integer | |
tick_time |
datetime | |
open |
float | |
close |
float | |
low |
float | |
high |
float | |
volume |
integer |