Introduction
- Thank you for choosing the Growly app. We are pleased to have you with us. Enclosed is the documentation to help you set up and launch the app easily. Please read it carefully, as it contains important information. If you need any assistance or have questions, our support team is just a message away.
Extract Project Zip
- All setup is performed using Terminal (SSH).
- Connect to your AWS server using:
ssh ubuntu@YOUR_SERVER_IP
- Upload the backend zip file using WinSCP or SCP.
- Navigate to your project directory and extract:
cd /home/ubuntu/growly
unzip backend.zip -d backend
Create Instance In AWS
- Launch an AWS EC2 Instance.
- Instance Type: t3a.medium
- Operating System: Ubuntu 24.04 LTS
- Enable ports in Security Group:
- 22 – SSH
- 80 – HTTP
- 443 – HTTPS
- Attach key pair and launch the instance.
Setup Nginx
- Install Nginx:
sudo apt install nginx -y
- Check Nginx version:
nginx -v
nginx/1.18.0 (Ubuntu)
- Start and enable Nginx:
sudo systemctl start nginx
sudo systemctl enable nginx
Setup Node.js And PM2
- Install NVM (Node Version Manager):
curl -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh |
bash
- Reload terminal:
source ~/.bashrc
- Install Node.js version v20.19.4:
nvm install 20.19.4
nvm use 20.19.4
nvm alias default 20.19.4
- Verify Node and npm:
node -v
v20.19.4
npm -v
10.8.2
- Install PM2 globally:
npm install -g pm2
Setup MongoDB (Cloud – MongoDB Atlas)
- Create a MongoDB Cloud account:
Go to https://www.mongodb.com/cloud/atlas and sign up or log in.
- Create a new cluster:
- Select Shared Cluster (Free / M0) or paid plan as required.
- Choose your preferred Cloud Provider (AWS / GCP / Azure).
- Select the nearest Region for better performance.
- Click Create Cluster.
- Create a database user:
- Username: growly_user
- Password: growly_user_pass
- Role: Read and Write to any database
- Whitelist IP Address:
- Add your server IP address.
- For development/testing, you can allow 0.0.0.0/0 (not recommended for production).
- Get MongoDB connection string:
- Click Connect → Connect your application.
- Select Node.js driver and copy the connection URI.
mongodb+srv://growly_user:[email protected]/growly?retryWrites=true&w=majority
- Update backend backend\config\database.js file:
dbURI=mongodb+srv://growly_user:[email protected]/growly
Setup Project In Server
- Navigate to project directory:
cd /home/ubuntu/growly/backend
- Setup and configure the .env file:
mv .env.example .env
- Edit the .env file and update database, server, and app settings.
- Install project dependencies:
npm install
- Notification Setup (Firebase)
- Go to Firebase Console → Project Settings → Service Accounts.
- Click Generate new private key and download the JSON file.
- Upload the downloaded file to the backend config folder:
/home/ubuntu/growly/backend/config
- Rename the downloaded file to firebase.json:
mv firebase-adminsdk-xxxxx.json firebase.json
- Start backend using PM2:
pm2 start index.js --name growly
pm2 save
pm2 startup
- Restart backend after Firebase setup:
pm2 restart growly
Configure Nginx Reverse Proxy (Without SSL)
- All steps are performed using Terminal (SSH).
- Create a new Nginx configuration file for your domain:
sudo nano /etc/nginx/sites-available/growly.yourdworld.com
- Paste the following configuration (WITHOUT SSL):
server {
listen 80;
server_name growly.yourdworld.com;
access_log /var/log/nginx/growly.access.log;
error_log /var/log/nginx/growly.error.log;
# Main application proxy
location / {
proxy_pass http://127.0.0.1:7722;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
}
- Enable the site:
sudo ln -s /etc/nginx/sites-available/growly.yourdworld.com
/etc/nginx/sites-enabled/
- Test Nginx configuration:
sudo nginx -t
- Restart Nginx:
sudo systemctl restart nginx
- Verify your application is accessible at:
http://growly.yourdworld.com
SSL Certificate Setup (Let’s Encrypt + Certbot)
Step 1: Install Certbot
- Update package list:
sudo apt update
- Install Certbot with Nginx plugin:
sudo apt install certbot python3-certbot-nginx -y
Step 2: Generate SSL Certificate (Let’s Encrypt)
- Run the following command to generate SSL for your domain:
sudo certbot --nginx -d growly.yourdworld.com
- During the process:
- Enter your email address for renewal notifications
- Agree to the Let’s Encrypt terms
- Select the option to redirect HTTP to HTTPS
Step 3: Verify Auto-Renewal
- Test automatic renewal:
sudo certbot renew --dry-run
Final Access URL
https://growly.yourdworld.com
Admin Panel Setup
- Open Admin Code in Vs studio code
- Rename .env.example to .env
- Edit env file in admin
- update backend url to https://growly.yourdworld.com
- install Node modules
npm i
- Create production build:
npm run build
- Upload build files into backend admin directory.
- Access admin panel via configured domain.
Env File Explanation
- PORT: The port on which your Node.js server will run (e.g., 3000, 4000, 5000).
- TOKEN_KEY: Secret key for JWT-based authentication and secure API token generation.
- DATABASE_HOST: Hostname or IP address of your SQL server (e.g., localhost or a remote server).
- DATABASE_NAME: Name of the SQL database to which your application connects.
- DATABASE_USERNAME: Username required to authenticate and access your SQL database.
- DATABASE_PASSWORD: Password for the database user.
- DATABASE_PORT: The port number used by your SQL server (commonly 3306 for MySQL/MariaDB).
- APP_URL: Backend base URL that will be used by frontend/mobile apps to interact with APIs.
- SERVER: Defines the running environment of the application, such as development or production.
- REVENUE_CAT_PLAY_STORE_V1_API_KEY: RevenueCat API key for Google Play Store integration (Android in-app purchases).
- REVENUE_CAT_APP_STORE_V1_API_KEY: RevenueCat API key for Apple App Store integration (iOS in-app purchases).
- FIREBASE_WEB_APP_KEY: Firebase Web API key, used for authentication or handling dynamic links in your application.
- STORE_PREFIX: A prefix used to differentiate store-related data, typically helpful for multi-store setups.
- STORE_PREFIX_NAME: The readable name for your store prefix, used for identification in app logic.
- OLA_MAPS_API_KEY: API key for Ola Maps (or any mapping service) used for location, routing, and map-based operations.
- APP_PACKAGE_NAME: Your Android application package name required for certain store validations and integrations.
RevenueCat Configuration
- Navigate to https://www.revenuecat.com/.
- Log in using your RevenueCat credentials.
- Next, you need to add the App Store Key and Play Store Key to code. You can get these keys by going to the RevenueCat dashboard > API Keys > Secret Api Keys. Copy and paste these keys into the respective fields of code.
- Copied key paste to config > .env.
SMTP Configuration
- The first step of the process is to create an email account on your hosting package.
- Once you have your email account created, you can proceed with the actual configuration of your Rajkot Offers website. You need to access your website as administrator and go to SMTP settings from Admin Panel -> Plugin -> SMTP config
-
Edit the following options:
- SMTP Host -mail.example.com (change example.com to your actual domain)
- SMTP Username - Enter the email account created in the previous chapter
- SMTP Password - Enter the password for your email account
- SMTP Port - server port, most used 587 for TLS, and 465 for SSL encryption
- I made the changes above but my website is not sending any emails, what I can do?
- Please test your SMTP credentials at SMTPER, if the same config worked by the test, please contact us.
Dynamic Link
- Begin by visiting the Firebase website through the following link: https://firebase.google.com/
- If you do not already have a Firebase account, kindly sign up for one. Otherwise, proceed to sign in with your existing account credentials.
- Navigate to the "Project Overview" section and click the setting icon.