> For the complete documentation index, see [llms.txt](https://listing-nb.gitbook.io/olo-full-app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://listing-nb.gitbook.io/olo-full-app/installation/how-to-deploy-in-production.md).

# How to deploy in production

## Deploy Api-Server, Admin Web Dashboard, Mobile App in Production

### Installation Steps

* Download olo full app and extract it
* Open terminal in extracted folder

#### Api Server

1. &#x20;run **`cd olo-api`** in terminal
2. Set environment file (.env)\
   `NODE_ENV=production` \
   `PORT=8000` \
   `CONNECTION_STRING={DB Connection string}` \
   `RESET_PASSWORD_LINK=https://{Domain name}/auth/reset/?reset= SERVER_URL=https://{Domain name}/` \
   `NOTIFICATION_ON_CLICK=https://{Domain name}/dashboard`
3. Create an account on mongo atlas, then Create a database on mongo atlas, copy connection string and paste it in `.env` against the key `CONNECTION_STRING`. Read more about how to use mongo atlas [here](https://docs.mlab.com/)
4. run **`npm install`** or **`yarn install`**  to install packages
5. run **`pm2 start app.js`** in terminal to start server
6. You can further read about how to make it public or how to map it on your domain here <https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04>
7. How To Secure Nginx with Let's Encrypt (SSL):\
   <https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04>
8. If you have a different environment and previous instructions dont work for your requirement you can let us know we'll be happy to help you.
9. run this command in terminal on server **`chmod -R 777 food-delivery-api/*`** . This gives permission to read/write files, it is needed to upload food,profile images on server

**NOTE: For notifications to work on android you'll have to upload FCM token on expo server. Read more about it** [**here**](https://docs.expo.io/versions/latest/guides/using-fcm/#uploading-server-credentials)

#### Admin Web Dashboard

1. run **`cd olo-admin`** in terminal
2. Install packages by **`npm install`** or **`yarn install`**
3. update `server_url` in `/config/config.js` with the ip/domain of where you hosted api in last step
4. Replace keys in `index.js` file
5. replace "homepage": "<https://listing.ninjascode.com/dashboard>" in package.json with the url where you are going to deploy your admin.
6. &#x20;run **`npm run build`** it will create a build folder. here we can publish in many ways but we are going to mention one that we use if you want to know others you will find several tutorials on how to deploy react applications for production.
7. copy build folder into your api folder
8. restart api server by **`pm2 restart <App Id>`**. App id can be found by running **`pm2 list`**
9. you can now access admin dashbaord on **`www.domain.com/dashboard`**

#### Mobile App

1. Go to folder **`olo-app`**
2. Install packages by **`npm install`** or **`yarn install`**&#x20;
3. Replace these keys in `app.json` with live keys. You can find more about these by clicking on each key.

* [iosClientIdGoogle](https://docs.expo.io/versions/latest/sdk/google/)
* [androidClientIdGoogle](https://docs.expo.io/versions/latest/sdk/google/)
* [facebookAppId](https://docs.expo.io/versions/latest/sdk/facebook/)
* [amplitudeApiKey](< https://amplitude.com>)
* [stripePublicKey](https://stripe.com/docs)
* stripeImageUrl; logo image url for store
* stripeStoreName; store name&#x20;
