> For the complete documentation index, see [llms.txt](https://docs.ionicfirebaseapp.com/restaurantbackend/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionicfirebaseapp.com/restaurantbackend/nodejs/project-requirements.md).

# Project Structure

There are 2 main folder structures in api directory.

* **Client:** Client has all the files needed for Swagger Docs.
* **Server:** Here you can see all the API modules and their setting and connections.

#### SERVER <a href="#server" id="server"></a>

![](/files/-LCllHV9xZn4AbUhN9wJ)

**API:**

Inside API directory you can see several module menuItem, Category etc. Each module has there own API and their route, controller files. Let's take example of Category modules.

**index.js**

It’s contains all the route or API for that modules. We defined API url path and there controller function corresponding to that route and with user access like which route access by user or admin or if we can any different role we can assign there.

**category.controller.js**

You can see, it has all the function controller that we defined in our API route index.js. Each API get or post and there DB query implement within that function. Function run all the business logic needed and return back json to client.

**category.event.js**

We use this file for event based logic. Let's say somewhere we need a do something once any data save into DB or we want to trigger any event if DB update. It mostly used with socket . We have used this Event based mechanism in some module like Chat and Notification.

**category.model.js**

We defined all the Data model Schema and their type inside this file. We are using Mongoose to validate our Data model.

#### category.socket.js <a href="#categorysocketjs" id="categorysocketjs"></a>

If there any event occurs like save/update we can connect our socket event with it. We create a socket event and trigger if any model event happen.

* **AUTH:**

Inside **api > auth** directory we do all the user authentication. Passport module is used for user authentication. We have 4 authentication Local for normal email, password based authentication. Facebook, G+, Twitter used for social authentication. You can add any other authentication as needed.

* **CONFIG:**

Inside **api > config > environment** directory you can update MongoDB url and nodeJS ENV like development or production etc.

**CLIENT**

It has all the Swagger docs required file. Once you will deploy you need to change URL of swagger.

*index.html*

![](/files/-LClmE_KkBe4Pu8wkcJe)

\
\&#xNAN;*You also need to update Swagger.json file to your Server url path .*

![](/files/-LClmLTlw-vVe3SjYSwz)

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionicfirebaseapp.com/restaurantbackend/nodejs/project-requirements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
