This document describes at full length the details of the DBooks-api in the repository stated above
This is the first piece of documentation in a series of documentation that would help guide the design, implementation, integration and testing of the Dbooks webAPI
Components
As shown in the image above, there are three (3) folders and seven (7) files in the repository.
Of these, those of direct concern to a contributor include
The controllers Folder
The models Folder
The server Folder
The app.js File
The package.json file
To get started with development. Clone or Download the repository
On cloning the repository switch to the directory of the application on terminal or command prompt
On switching. Run
npm install
From the project root directory. To install all the node dependencies from package.json
Then run
node app.js
To get the application running on your local device
The folder schema of the application is quite simple
The Controllers folder contains the controllers
The Model Folder Contains the Models
The Server Folder contains the nitty gritties of the server
Let’s get a bit deeper into the each folder
The Controllers Folder
There are five controllers inside the controller folder. They include
accounts.js:- Holds all account related controllers.
create.js:- Holds all controllers used for creating things on the backend
delete.js:- Holds all controllers used for deleting things on the backend
read.js:- Holds all controllers used for fetching data on the backend
update.js:- Holds all controllers used for updating data on the backend
The Models Folder
There are currently eight (8) models inside the models folder; and they contain the low level implementations of various functionality. They include
books.js:- contains models for book functions
coupons.js:- contains models for coupon functions
favorites.js:- Contains models for favoriting functions
ratings.js:- Contains models for rating functions
rental.js:- Contains models for rental/purchase functions
reviews.js:- Contains models for review functions
subscriptions.js:- Contains models for Subscription functions
users.js:- Contains models for User functions
The Server Folder
There are two (2) documents in the server folder. They include
configure.js:- contains server configuration
routes.js:- contains RESTful routes for client communication