Challenge Overview
Challenge Objectives
- Setup and configure the NodeJS back-end API project structure
- Develop/implement the back-end API as described in the provided architecture and Swagger specification
- Create Postman tests of APIs in scope
Project Background
Welcome to "ASoD Economic Calculator App - Swagger REST API Implementation #1". Application Security on Demand (ASoD) is a service that we offer to our customer and currently, we use a manual excel document as an “Economic calculator” to calculate the economic benefit to our customer. In this series of challenges, we convert the excel application to web application.This challenge aims to set up, configure and implement the back-end API project that will support the ASoD Economic Calculator App.
In part #1 we are creating the project's structure/code base, basic models, endpoints related to them and etc.
We will continue with calculation logic in next challenge #2 of this series.
Technology Stack
- NodeJS
- MongoDB
- MongooseJS
- Express
- Swagger
- Heroku
Individual Requirements(all major)
1. Setup and configure a NodeJS RESTful API project following NodeJS best practices. Use proper structure to separate config, models, routes, controllers and etc. to folders.- Use Express
- Mongoose for ODM
- Add linting to project via "eslint"
- Add proper error handling
- Use "joi" module for validation of request payloads and schemas described by the swagger spec
- Use "config" module and extract important variables(PORT, MongoURI and etc) to environment variables
- Add proper logging with "morgan" module for requests and "winston" module for logs to console
- Your project should be able to run on Heroku. Therefore add all needed files like Procfile and etc.
2. Implement models from the ERD/Swagger
- All models except "EconomicCalculatorReport" are in scope. We will handle it in #2 following challenge.
- Follow proper field types as specified.
- Add needed validations on model level.
3. Implement Swagger specification
- All groups of API endpoints except "Reports" are in scope.
- Follow spec and add validation to requests as specified(required, types, etc).
- Implement the JWT Authorization and enforce it for secured endpoints as per spec
4. Create Postman tests
- Use Postman to create environment and collection files for tests
- All APIs in scope should be created with example requests
5. Create documentation
- README.md - describing the following sections: Prerequisites, Installation/Deployment(also on Heroku), Configuration, Starting, Developing
- Validation.md - describing how to validate your submission
Review phase
This project has a faster review(24h) phase. Please, plan accordingly.Final Submission Guidelines
- NodeJS project source code
- Project documentation(no video required)