Start the automated app producer script

To start the script that will work on creating and publishing apps, while you sleep :) follow this guide. 


Configuration


Video is outdated  - follow written docs 


Edit the File "Mobile App/Producer/config.js"

And make isSaas to true

exports.isSaaS=true;


Go in your Firebase Functions. 

cah3cTBBGZsVB667hVMnJcQOzWJ2Ox5RdO5FPBgl.png

Check the area of your cloud function. If it is different than us-central1, change that in config.js

exports.cloudFunctionsArea='us-central1';


SENDGRID_API_KEY - Used for the send mail to the clients


  1. Create SendGrid account and get an API_KEY.
    motvmRBSJF9v7PNswGS3b4uRKqrCKMOnHKOEvim9.png

    L4q4fsYfeM7KusV8lN1IdzANFyWZgLnnQlnPwatH.png
  2. Put that key in YOUR_SENDGRID_API_KEY


//The Sendgrid KEY --- CHANGE THEM WITH YOUR OWN SENDGRID
exports.SENDGRID_API_KEY="YOUR_SENDGRID_API_KEY";


fromEmail - Email that will be the sender of the emails. Should be validated email in SendGrid

//Email Config
exports.fromEmail="contact@mobidonia.com";


Cloud Functions Area - Change if your cloud functions server is in a different location

exports.cloudFunctionsArea="us-central1";


Email Subject and Email Text

Then you will find Email Subject and Email Text variables for ios and android. 

These values are used when we notify the user that their app is created. 

You can modify them to suit your needs. 

They have  one placeholder fields

{userName} - Client Name

{androidAppLink} - Link to android apk file



Open the folder Mobile App in the terminal. 

and execute the commands

npm install
npm run produce

Then you should see this

ngVX7snNaxRjfVfDm1oyywiDUZXldiTV8y1a0tt1.png

Select Start build cycle

This will start listening for upcoming apps that need to be compiled and delivered to the client. 

Or if you wish, you can manually make some app by selecting the process of Make Android App or Make iPhone App


Run the process NON Stop. - Server Environment

The Expo CLI can work on Window, Mac, and Linux. 

So it means that you can make apps from Linux Server. 

Together with PM2 you can have a server that never stops.

With FreshPing you can get notified when the server stops.

Let's start



Create Server and Install WebMin ( Example with Cent OS 7 ).


Step1. Install WebMin  ( Video )

Documentation on Installing WebMin.

Step 2. Install Node, NPM, GIT, and EXPO

You will need Node + NPM to build the phone apps, GIT for version control, and Expo for development testing.

  1. Install node and npm: Read about it here.
  2. Install GIT: Read about it here.
  3. Install Expo: Follow instructions.
  4. Install PM2: Follow instruction.
  5. Install ZIP:  yum install zip
  6. Install UNZIP: yum install unzip
  7. Restart Webmin -> /etc/init.d/webmin restart

To verify your installation run

  • node --version
  • npm --version
  • git --version
  • expo --version
  • pm2 --version

Step 3. Upload mobile app source code and install node packages

  1. exports.isServer=true; Change isServer to true in Mobile App/Producer/config.js
  2. Via the WebMin FileManager, upload the Mobile App Folder ( without the node_modules and package_lock)
  3. Run npm-install in the place where it is uploaded
  4. Run expo login and login with your Build Account. NOTE!!!: This step is not recorded in the video.
  5. [UPDATED: REQUIRED] You may need to run this. If you get ENOSPC: System limit for number of file watchers  (REBOOT NEEDED)
  6. Run the production script with pm2 start ./Producer/produce.js --name AppProducer
  7. Create Freshping.io notification. Port 8989

Next

 Clone our docs, for your own Support Portal