DBooks.org Backend Documentation 1; Basic Directory Structure Description

in #utopian-io6 years ago (edited)

Repository

https://github.com/feekayo/dbooks-api

Details

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

Screenshot (206).png

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

  1. The controllers Folder
  2. The models Folder
  3. The server Folder
  4. The app.js File
  5. 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

Screenshot (207).png

There are five controllers inside the controller folder. They include

  1. accounts.js:- Holds all account related controllers.
  2. create.js:- Holds all controllers used for creating things on the backend
  3. delete.js:- Holds all controllers used for deleting things on the backend
  4. read.js:- Holds all controllers used for fetching data on the backend
  5. update.js:- Holds all controllers used for updating data on the backend
The Models Folder

Screenshot (208).png
There are currently eight (8) models inside the models folder; and they contain the low level implementations of various functionality. They include

  1. books.js:- contains models for book functions
  2. coupons.js:- contains models for coupon functions
  3. favorites.js:- Contains models for favoriting functions
  4. ratings.js:- Contains models for rating functions
  5. rental.js:- Contains models for rental/purchase functions
  6. reviews.js:- Contains models for review functions
  7. subscriptions.js:- Contains models for Subscription functions
  8. users.js:- Contains models for User functions
The Server Folder

Screenshot (209).png
There are two (2) documents in the server folder. They include

  1. configure.js:- contains server configuration
  2. routes.js:- contains RESTful routes for client communication

Difference

N/A

Links

Official Documentation hosted on:

https://github.com/feekayo/dbooks-api/wiki/Basic-Folder-Description

Proof of Authorship

https://github.com/feekayo

Sort:  

Can you please add the documentation to the repository directly for all the contributions.

Oh.. Ok!