How to deploy in production
- Open terminal in extracted folder
- 1.run
cd enatega-multivendor-api
in terminal - 2.Set environment file (.env)PORT=8001CONNECTION_STRING=<db connection string>RESET_PASSWORD_LINK=https://<admin's live url>/auth/reset/?reset=SERVER_URL=https://<live url>/STRIPE_WEBHOOK_ENDPOINT_SECRET=<stripe's webhook endpoint secret>DASHBOARD_URL=https://<admin dashboard's live url>/WEB_URL=https://<web live url>:3006/ORDER_DETAIL_WEB_URL=order-detail/
- 3.Create an account on mongo atlas , then Create a database on mongo atlas, copy connection string and paste it in
.env
against the keyCONNECTION_STRING
. Read more about how to use mongo atlas here - 4.run
npm 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 if needed
NOTE: For notifications to work on android you'll have to upload FCM token on expo server. Read more about it here
- 1.run
cd enatega-multivendor-admin
in terminal - 2.Install packages by
npm install
oryarn install
- 3.update
SERVER_URL, WS_SERVER_URL, CLOUDINARY_UPLOAD_URL, CLOUDINARY_CATEGORY, CLOUDINARY_FOOD, CLOUDINARY_PROFILE
in/config/config.js
with the ip/domain of where you hosted api in last step - 4.Replace keys in
index.js
file with live ones - 5.replace "homepage": "https://enatega.com/dashboard" in package.json with the url where you are going to deploy your admin.
- 6.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 available in
enatega-multivendor-admin
directory intoserver
directory then deployserver
directory on your live server and usepm2 start index.js
to run the dashboard. - 8.you can now access admin dashboard on
www.domain.com/dashboard
- 1.Go to folder
enatega-multivendor-app
- 2.Install packages by
npm install
oryarn install
- 3.Replace these keys in
app.json
with live keys. You can find more about these by clicking on each key.
- stripeImageUrl; logo image url for store
- stripeStoreName; store name
Make the android build using
expo build:android --release-channel production
Make the ios build using expo build:ios --release-channel production
NOTE: we are using release channel production because we have setup environment against production
keyword in environment.js.
We can also using release channelstaging
here if you are not deploying on live yet but need to make the builds for testing.- 1.run
cd enatega-multivendor-web
in terminal - 2.Install packages by
npm install
oryarn install
- 3.Update
SERVER_URL
WS_SERVER_URL
GOOGLE_CLIENT_ID
FACEBOOK_SCHEME
FACEBOOK_ID
STRIPE_PUBLIC_KEY
PAYPAL_KEY
FACEBOOK_NAME
GOOGLE_MAPS_KEY
in/enatega-mutlivendor-web/src/config/constant.js
' - 4.Replace keys in
index.js
file with live ones - 5.There are several ways to deploy react application one of the easiest ways is to deploy it using Netlify. You can read through its guide by going through this documentation.
- 1.Explore demo version on https://amplitude.com get amplitude key and replace it with amplitudeApiKey in app.json of mobile app.
- 2.You can further explore dashboard by following amplitude documentation. https://developers.amplitude.com/
Last modified 1yr ago