generator-identity-code-api

0.1.3 • Public • Published

generator-identity-code-api

Generates the identity code APIs

*Note: This project requires that you have Node and NPM installed on your computer. If you do not, click here.

Overview and Explanation

Read each instuction completely before you walk through the next step

The Identity Code APIs will be used in the near future to manage all the codes used in the BYU application process. On the webpage where one fills out an application, certain codes are used that represent values that the future student may select. For example: the future student will be asked about their native and secondary language abilities. They will select their native language, which will appear as the name of the language but in the computer, it is registered as a code such as EN for English.

There are 40 of these APIs that need to be created. This generator will help us create all that repeatable code a lot more quickly and we will have the assurance that the code is up-to-date with current BYU API standards. We will also appreciate the consistency of the 40+ APIs that we will create.

Let's get started!

Getting Started

Make sure you understand the data that your API will manage. Talk with Mark Crowther about locating the codes from a database.

Continue only when you have the codes located. We will organize them in a later step.

The GitHub Repository

Follow the instructions on how to create a GitHub Repository. Only do the section titled "Create A Repo". If you have questions about the tutorial, check below for an answer to your question before you ask for help.

  • The name will be 'identity-' + your code api name (e.g. state_codes)
  • The description will be 'Code API for managing ' and your code api name.
  • Choose private repository

Now follow the instructions to clone the repository to your computer. *Note: the repository will be cloned in the directory that your shell is currently in. Navigate to your projects directory before you clone the repository to keep everything organized.

Generator Installation

Install Yeoman and generator-swagger-node-byu-api using npm (we assume you have pre-installed node.js).

*Note: the global flag (-g) requires elevated shell access

npm i -g yo
npm i -g generator-identity-code-api

Then generate your new project by navigating to your project directory and entering:

yo identity-code-api

or simply:

yo 

then select Identity Code Api from the list using your arrow keys

Walk through the prompts and answer accordingly. If you do not know about a particular prompt, see the suggestions below:

  • You will need to supply some s3 bucket configurations, such as: the bucket name, the file where you will store the codes, and the file where you will store the logs.
  • Some questions may ask you to supply an answer in snake case.
  • Sort names are defined as a sub-grouping for codes. For example: if I were to make an API for international state codes, I would group the state codes by their country. Hence we get: UT, USA.
  • Pagination is not a requirement but can be useful for very large code APIs. If you do choose to use pagination, you will be asked if you want to use the defaults, which are: start page on element 1, page size defaults to 50 elements per page, max page size (for client queries) defaults to 100. If you choose not to use the defaults, you will then be asked to supply the 3 fields that were just mentioned.
  • Don't worry about raising events if you are just beginning to create your API. There is a tutorial about how to set up event raising that you should review later on. Any of these configurations can be changed in the api.js file created by this generator. If you need to modify the configurations, look in api.js under the controller function.

Readme

Keywords

Package Sidebar

Install

npm i generator-identity-code-api

Weekly Downloads

0

Version

0.1.3

License

Apache-2.0

Last publish

Collaborators

  • lmr99
  • grahamc32
  • stuft2