# Basic Setup

Project Zero is a base for rapidly building feature-rich e-commerce sites. It is powered by [Django](https://docs.djangoproject.com/en/3.1/) framework, [Jinja](https://jinja.palletsprojects.com/en/2.11.x/) templating engine, [jQuery](https://api.jquery.com/) JS library and [SASS](https://sass-lang.com/documentation) CSS preprocessor.

### <mark style="color:red;">Installation​</mark> <a href="#installation" id="installation"></a>

It is recommended to use yarn as your package manager.

```
brew install yarn # only for mac users
```

```
npm i -g yarn # for non-mac users
```

Initiate and update git submodule :

```
git submodule update --init
```

Create and activate a virtual environment using Python 3.x:

```
python3 -m venv venv
source venv/bin/activate
```

Install pip packages:

```
pip install wheel # for ubuntu users
pip install -r omnife_project/requirements.txt
# if project includes additional libraries such as pz-otp
# (you can validate this by checking if a requirements.txt exists in project root)
pip install -r requirements.txt
```

Copy example environment file:

```
cp .env.example .env
```

Run migrations:

```
python manage.py migrate
```

Start local Django development server:

```
# port number can be changed but make sure to use "0:"
python manage.py runserver 0:8000
```

Setup node modules (on a new terminal/tab):

```
cd templates/
yarn install # npm install
```

Start development server:

```
# with live reloading and clean webpack output
yarn dev # npm run dev
```
