# Setting up the server locally

To create a local development setup of the care backend and frontend projects, perform the following steps.

## Care Backend

* Install PostgreSQL on your machine. The instructions for the same can be found at <https://www.postgresql.org/download/>
  * Change the authentication method to `md5` instead of `peer`. The instructions for the same can be found in this [StackOverflow Answer](https://stackoverflow.com/a/12670521/4385622)
* Install the GDAL and Geos libraries. ( This is required because Care Uses a PostGis database Connection by default, this is to power location fields which can be later be used for better location-based queries   ) On Debian/Ubuntu systems, run `sudo apt-get install libgdal-dev libgeos-dev python-dev`&#x20;
* Clone the project: `$ git clone https://github.com/coronasafe/care`
* `$ cd care`
* Create a virtual environment: `$ virtualenv -p $(which python3) venv`
* `$ source venv/bin/activate`
* `$ pip install -r requirements/local.txt`
* Set the DATABASE\_URL environment variable for your Postgres database. ( By default it expects a database with the name "care", only change this variable if your database is named something else )
* Run the database migrations: `$ python manage.py migrate`
* Create a superuser: `$ python manage.py createsuperuser` &#x20;

  `$ python manage.py runserver`
* The project should be running at <http://localhost:8000>\
  API Specs are available at <http://localhost:8000/redoc> and <http://localhost:8000/swagger>

## Care Frontend

* Make sure you have Node v10 or above installed on your machine.
* Clone the project: `$ git clone https://github.com/coronasafe/care_fe`
* `$ cd care_fe`
* `$ git checkout master`
* `$ npm install`
* `$ npm run start`

The project should be running at <http://localhost:4000> In order to connect the backend to the frontend, modify proxy target for `/api` in webpack.config.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://deploydocs.coronasafe.network/local.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.
