This is an open-source node server app for vigo-shop online store.
- Node
- Express
- Mongo DB, mongoose
- AWS S3 as file storage (aws-sdk, multer-s3)
- JWT token auth, (jsonwebtoken, passport)
- Mailgun for emailing
- Joi, validator for validation
- Eslint, Postman, Newman, Travis CI
- GIT, GitHub, Jira as a workflow
You must have your own environment variables. Just add .env
file to project root folder.
Use .env.example
file with guiding comments in it.
To do that you should have your AWS, MailGun, Mongo, LiqPay accounts for filling API keys.
After proper configuration run the command below:
npm run start
To test REST APIs just import ../postman/VigoShop_postman_collection.json
file in your locally installed Postman.
Or fork public Postman collection.
Set environment variables in ../postman/VigoShop_postman_collection.json
and import the environment into Postman.
After proper configuration you may test APIs using Postman UI or just run the command below:
npm run integration-tests
To have some initial data for testing as server starts, set an environment variable PERFORM_INITIAL_DATA_IMPORT in .env file to 'true'.
Install globally:
npm i -g node-inspector
Open chrome and type in:
about:inspect
Then in opened window press on the link:
Open dedicated DevTools for Node
Ensure your localhost:port is in the list for debugging.
The default ports for node debugging are 9229
and 9222
.
You can add yours here.
More info you can find here and here.
Now you can start this command in the terminal window:
npm run start:debug
ESLint check
will run by default by running start:dev
or start:debug
commands.
If there are some troubles with code linting, server will NOT start properly.
ESLint and Postman integration tests are using in Travis CI. See the .travis.yml file.