Pre-render (for SEO)

Download source here Run $ npm install to install Edit index.js file and change your default port Use pm2 to start prerender server. Like $ pm2 start index.js –name=”pre-render-server” Modify your nginx config (for web only) to content below (you can see all content in the README.MD file) server {    listen 443;  ssl    on;  ssl_certificate […]

Read More

Other

– Use pm2 Check pm2 services $ pm2 ls Reload your api app $ pm2 reload [app-id]

Read More

Testing

– Open your browser and test Web user: https://yourapp.com Seller: https://seller.yourapp.com Admin: https://admin.yourapp.com – Default admin account: admin@example.com with password admin – Default language: English (en), Spain (es)

Read More

Seed Data

CD to API folder Run $ export NODE_ENV=production (or environment you are using) Open file server > migrations > user.js and change default account you want Copy server > migrations > translation > en.json to another file with your new language (eg cn.json – add in the same migrations > translation folder). Then edit value […]

Read More

Config Nginx

Create new config file for your app in the /etc/nginx/sites-enabled folder. Like /etc/nginx/sites-enabled/yourapp.com.conf Edit your config look like this server {  listen 443;    ssl    on;  ssl_certificate    /path/to/ssl/web/fullchain.pem;  ssl_certificate_key    /path/to/ssl/web/privkey.pem;    server_name yourapp.com;    location / {    root /var/www/yourapp.com/web;    index index.html index.htm;      try_files $uri $uri/ /index.html?$query_string;  }    location /api {    proxy_pass http://localhost:8080;    proxy_http_version […]

Read More

Build Web

– Create your application folder in www like this Web: $ mkdir /var/www/yourapp.com/web Seller: $ mkdir /var/www/yourapp.com/seller Admin: $ mkdir /var/www/yourapp.com/admin API: $ mkdir /var/www/yourapp.com/api 1. Web Note: Must use node js 9 to build the app CD to web app Edit file src > environments > environment.prod.ts file Change all config by your api […]

Read More

Server

  API   CD to API folder Create [environment].json file in the server/config folder by copy development.json file (change [environment] by your environment) Create file .env in the root api folder. Then copy all content in to env.example file. Change all config by your config # If live, it should production NODE_ENV=development APP_NAME=Genstore ALLOW_CORS=true # […]

Read More

Softwares

1. NodeJS Version >= 8.1 More information you can check here Install Open your terminal and run these commands $ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash – $ sudo apt-get install -y nodejs After that you can check install $ node -v 2. MongoDB Version >= 3.6 More information you can check here Install […]

Read More

Getting Started

– OS: Recommend Linux system – Guide for Ubuntu system – Need 4 domains and https for all. You should register wild card for SSL. Go to your DNS manager and point 4 domains above to your server Web user: https://yourapp.com Seller: https://seller.yourapp.com Admin: https://admin.yourapp.com API: https://api.yourapp.com

Read More