diff --git a/README.md b/README.md index 83b02624323a738cdcb4c6326743283b30666c52..95e947d6441b3e85442ff530ef4d54b045b3294c 100644 --- a/README.md +++ b/README.md @@ -2,44 +2,61 @@ Cicer is a web based software to manage the stock, purchases and balance of a consumer association. It has being created for the needs of the [Garbanzo Negro](http://garbanzonegro.org). -## deploy it +## Requirements + +* Golang >= 1.12 +* Node.js + +## Deployment Build a copy using make: -``` -$ make build + +```shell +make build ``` Create a secret for the authentication tokens: -``` -$ head -c 21 < /dev/urandom | base64 + +```shell +head -c 21 < /dev/urandom | base64 ``` Now you can copy the build folder and the cicer binary to your server and run it like: -``` -$ ./cicer -assets 'path/to/build' -secret 'scret' -addr ':8000' -``` -Instead of flags all the params can be passed as env variables see the names between `{` and `}` in: -``` -$ ./cicer -h + +```shell +./cicer -assets 'path/to/build' -secret 'scret' -addr ':8000' ``` -## run for development +Instead of flags all the params can be passed as env variables. See the names between `{` and `}` in: -To run it in develop mode build and run the backend: -``` -$ go build -$ ./cicer +```shell +./cicer -h ``` -And run the frontend with npm: +## Running it for development + +To run Cicer in development mode, build and run the backend: + +```shell +go build +./cicer ``` -$ npm start + +And then run the frontend with npm: + +```shell +npm start ``` -This will open a browser pointing to `http://localhost:3000` where you will see any changes you do in the javascript side (the backend side needs recompilation). + +The backend API will be listening on port 8080, while the frontend will be on port 3000. + +Open a browser and visit `http://localhost:3000`. You will be able to see any changes you do in the javascript side as you go (the backend side needs recompilation). ## Initialize data -When you run cicer it will print an authentication token that we can use to set up some initial data, see `setup.sh`: -``` -$ ./setup.sh the.hexadecimal.token +When you run cicer, it will print an authentication token. +Use this token to seed some initial data (such a few users and products): + +```shell +./setup.sh the.token.string ```