> For the complete documentation index, see [llms.txt](https://sayyidkhan92.gitbook.io/fashionshopdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sayyidkhan92.gitbook.io/fashionshopdocs/configuration/project-config.md).

# Project Configuration

Project configuration of the entire project is governed using the "default.js" file in the config directory.

## Directory

**Directory to file from root directory:**

config/default.js

## JSON Structure

The JSON structure of the "default.js" file is broken down into four parts:

* **app** - stores the configuration required to be used generally for the application&#x20;
* **db -** store the configuration required to be used for the app to connect to database
* **dataset\_filename -** the dataset which will be used for the insertion script for the project
* **swaggerOptions -** the endpoint test API configuration page

These contents are injected into the project at runtime, rendering the values over here.

```javascript
module.exports = {
    app : {
        port : 5000
    },
    db: {
        host: "localhost",
        port : 3306,
        /* change your username */
        username :  "root",
        /* change your password */
        password : "rootroot",
        database : "fashionshop"
    },
    dataset_filename : "clothing_dataset.csv",
    swaggerOptions : {
        title : "FashionShop Backend API",
        description : "API Endpoints for backend catalog",
        version: "1.0",
        product_api : "Product API",
        pagination_api : "Product Pagination API",
        swagger_api_url : "swagger-ui",
    }
}
```

{% hint style="info" %}
&#x20;**Example:** To change the port number of the project setup change the value 5000 to another value.
{% endhint %}

### **SwaggerOptions**

**Configuring Swagger API options in fashionshop.**

![Swagger API Page](https://3513986377-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McJYWrPuL1jNwC_YWKs%2F-McJpGo4w0jiVhMq8ald%2F-McJx7rR7gsUivjx8fOQ%2FScreenshot%202021-06-16%20at%209.13.20%20PM.png?alt=media\&token=70659f65-f7d8-4bb7-b645-8b6c0eda8465)

Swagger is a feature added to allow us to test API endpoints dynamically. Whenever new backend api endpoint's are created, swagger framework will pick it up and insert the API endpoint into the swagger API page in order for us to test it. The image above is the example when you successfully run swagger that you will be able to see this page above.

Making changes to swagger API is through the swaggerOptions JSON. Here is the list of details for each JSON key : value pair in the swaggerOptions.

|                     |                                                                 |
| ------------------- | --------------------------------------------------------------- |
| Title               | the title of the backend api project                            |
| Description         | the description of the backend api project                      |
| Version             | displays the current version                                    |
| product\_api        | displays all the product api that falls under the product api   |
| pagination\_api     | displays all the pagination api that falls under pagination api |
| swagger\_*api*\_url | the api endpoint which the swagger UI will be rendered on       |

## Setup Configuration File in Project

This is meant as an additional info and not entirely required to the project but if you would like to know how to setup the configuration file in the project in more detail you can navigate to the link below.

[youtube link](https://www.youtube.com/watch?v=vi17cFQFQHM) to understanding on how to setup configuration file.&#x20;
