` The object of this project is to simulate a ATM and it interaction with a user, for demo purposes.
The project is dividade into 2 subprojects:
- /api: the API was made in nodejs and have no persistence: 1.1. /api/helper: general use helpers; 1.2. /api/models: atm model; 1.3. /api/tests: tests for atm model and api requests;
- /webclient: a Angular front end that render the user interface: 2.1. /webclient/src: source for webclient; 2.2. /webclient/dist: created on build, hold the webclient to be delivered to user internet browser;
The system was contructec to fullfill the following requirements:
- Always deliver the lowest number of possible notes;
- It’s possible to get the amount requested with available notes;
- The client balance is infinite;
- Amount of notes is infinite;
- Available notes $ 100,00; $ 50,00; $ 20,00 e $ 10,00
- Copy the folder to somewhere in yor computer;
- Go to / and
npm install
; - Go to /webclient and
npm install
; That's it
There is 2 sets of tests in this project:
- Back end tests: on / folder, use
npm test
; - Fron end tests: on /webclient, use
npm test
;
Once installed, only the webclient must be build:
- Go to /webclient and
npm build
;
Once installed and build, there is only one step to run the system:
- Go to / and
npm start
; ...and the system can be accessed on http://localhost:3000.
-
The API: ** Made using nodejs and express; ** The tests are made using mocha; ** The atm model is low coupled from API, improving reusability; ** The API catch any Exception from model and translates it to valid HTTP responses. In this way, any client can handle exception cases;
-
The Webclient: ** Made using Angular 5 and Angular/CLI; ** The tests use jasmine; ** A AtmService is implemented to handle the API, lowering the coupling from the rest of the system;
Security was not a concern for this project.
There a lot of things that can be done to superpass the current limitations of this project. Some are:
-
API: 1.1. Implement a CORS restriction for access to API; 1.2. Extract definition os kind of notes to outside of model; 1.3. Create and persist log of operations;
-
Webclient: 2.1. Create animations to notes and errors; 2.2. Improve the skin and colors; 2.3. Change dependency of tests to PhantomJS, instead of Chrome;