stock-exchange-express-api is a sample Node.js application which simulates the purchase of stocks.
I worked on the stock-exchange-api for a coding assessment. This was done in Java / Spring Boot, and I made this project to reimplement it in node.js to get some hands-on experience.
- Relative paths suck when importing modules. This plugin was useful to define directory aliases that can be used when importing stuff: babel-plugin-module-resolver. See the
module-resolver
plugin in .babelrc for configuration details. - This was my first experience with sequelize. I'm particular with how I organize my projects, so I liked how I can customize paths for Important Sequelize Things. See: .sequelizerc.
- A relatively recent version of node.js and npm. I used node v12.2.0 and npm v6.9.0.
- Open a command prompt or terminal window.
- Clone this repo.
- Navigate to the stock-exchange-api root directory.
npm install
npm test
to run the test suite.npm start
to run the server, which runs on port 3000 by default.
You can use this Postman collection to interact with the API: stock-exchange-express-api.postman_collection.json
This application uses sqlite. Database files are stored in a data
directory, so they will survive app restarts.
This application uses a library, iex-api, to fetch stock information from a free public API by IEX Trading.