# Sidecar Tutorial: Server-side

{% hint style="info" %}
Python 3.10 Is required to follow the Quick Start Tutorial.
{% endhint %}

In this part of the Quick Start tutorial, the server-side API will be made. Follow the steps below to complete the server-side tutorial.

Create a directory for your application project:

`QuickApp`

Inside the project directory create a directory named `server` and create:

* requirements.txt

```
fastapi
uvicorn
```

In terminal `cd` into server directory and run commands:

```bash
# Create virtual environment for python project.
python -m venv venv
```

```bash
# Activate virtual environment
source venv/bin/activate 
```

```bash
# install required dependencies
pip install -r requirements.txt
```

Once these commands have been executed and dependencies have been installed, create and copy in the main.py file as illustrated below:

{% code title="main.py" %}

```python
# FastApi Setup for the Quick Start Tutorial
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn

# Initiates the FastApi instance
app = FastAPI()

# Enabling CORS to allow access for the Client-side App.
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Route for our API on index page to send over a simple message.
@app.get("/")
async def index():
    return {"message": "Welcome to IndustryApps!"}
```

{% endcode %}

This is a minimal setup to run a FastApi stateless Restful compliant API, this simply returns a message `"Welcome to IndustryApps!"` when fetched later on the client-side.

The command `uvicorn main:app` starts the API in case you'd like to test it, which refers to:

* `main`: the file `main.py` (the Python "module").
* `app`: the object created inside of `main.py` with the line `app = FastAPI()`.

By following the link which pops up on terminal you should see the message displayed on the browser window:

<div align="left"><img src="/files/NdELnYCH0FSDFiAg9uHf" alt=""></div>

FastApi automatically documents its endpoints. By adding `/docs` endpoint to your API url, the available endpoints of the API will be visible.

![GET endpoint inside /docs of FastAPI](/files/ybtTXdTfqaLDi4UJWQvj)

The application will be built and run through docker-compose later in the tutorial. The next step will be building the client-side app with <img src="/files/cVz6GWnXoVbLbGgZhhTa" alt="" data-size="line">Vue /Nuxt js.


---

# Agent Instructions: 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:

```
GET https://docs.industryapps.net/fundamentals/deploy-an-app-via-pre-defined-sidecar/sidecar-tutorial-server-side.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
