A boilerplate for React projects, honed over several internal and client projects for speed of work and collaborative working. Ideally used in conjunction with Docker (example Dockerfile provided) for simple, disposable development environments and super quick deploys to Docker based staging/live servers.
- Componentised by default with example provided
- Components contain jsx, css and optionally tests
- Components can be developed in isolation using a sandbox.jsx and hitting '/components' url
- Uses browserify for modularisation
- Data flow adheres to the flux model using a single store to hold the whole state
- Served over HTTP but HTTPS can be manually configured
- Stylus is compiled on request
- Full suite of commands provided (with a heavy slant towards Docker)
- Rethinkdb spun up automatically in separate linked container when using commands
- Stylus extended with the Nib library
- Normalize for baselining css and some optional resets in '/helpers'
- OSX
- git
- node
- VirtualBox
- docker-machine
- docker
- dockerhub account
- Install
VirtualBox
- Install
docker-machine
- Install
docker
client docker-machine create --driver virtualbox dev
to create a new docker service running locally within VirtualBox$(docker-machine env dev)
to point your docker client to the newly created docker servicedocker login
to enable us to fetch images from dockerhub (please sign up if you do not have an account)
- Open VirtualBox and open the settings for the newly created
dev
vm - Under the 'Network' tab click 'Port Forwarding'
- Leave any existing entries and add the following...
Name Protocol Host IP Host Port Guest IP Guest Port
================================================================
app TCP 0.0.0.0 8888 0.0.0.0 8888
db TCP 0.0.0.0 8080 0.0.0.0 8080
- Clone repo and
cd
in rm -Rf .git
to remove association with react-project-base git repo- Update manifests (
package.json
,bower.json
) with project details (most importantlyname
andversion
) alias t="./bin/tasks"
to create a shortcut to the project task runner in the current shellt build
to prepare the app imaget run
to initialise the db/app containerst compile
to compile the application code
http://localhost:8888/
for the applicationt compileApp
after any change to application jst compileVendors
after any new vendor libs addedt restart
after any change to server js- The stylus will recompile automatically on each request
http://localhost:8080/
for the lovely rethinkdb web interface
- If
docker
is giving you a socket error ensure your docker server VM is runningdocker-machine ls
to view the state of your VMdocker-machine start dev
to start up VM nameddev
- If
docker
seems to not be responding ensure you have associated your docker client with a docker server.$(docker-machine env dev)
to point your docker client to your docker server instance running in VMdev