Accounting notebook API REST Service and React Client according to Coding Challenge definitions.
Server based on generator-express-no-stress generator. Client based on simple-react-full-stack
In order to properly run this project you must have installed Node v8 or newer and GIT
Obtain the project
git clone https://github.com/narigondelsiglo/accounting-notebook
Install dependencies and launch both frontend and backend
./launch.sh
Install dependencies and launch both frontend and backend
docker build -t accounting-notebook .
docker run -p 5000:5000 -p 3000:3000 --name accounting-notebook -d accounting-notebook
React frontend connection listens on port 3000 NodeJs REST API backend listens on port 5000
Install backend dependencies (one time operation):
npm install
Install frontend dependencies (one time operation):
cd client
npm install
cd ..
Runs the application is development mode. Should not be used for production. In project root directory:
npm start
- Open you're browser to http://localhost:3000
- Invoke the
transactions
endpoint
curl http://localhost:5000/api/v1/transactions
- Check the account
balance
curl http://localhost:5000/api/v1/balance
- Swagger UI: Access to automatic generated API explorer in your browser http://localhost:5000/api-explorer/
npm run dev:debug
# random amount credit
curl 'http://localhost:5000/api/v1/transactions' -H 'Content-Type: application/json' --data-binary "{\"type\": \"credit\", \"amount\": $RANDOM}"
# 10 bucks debit
curl 'http://localhost:5000/api/v1/transactions' -H 'Content-Type: application/json' --data-binary "{\"type\": \"debit\", \"amount\": 10}"