Skip to content

Technical Architecture

Step 1: Pre-installation Check

  • PHP Version - PHP >= 5.6
  • MYSQL
  • SSL (HTTPS must for Facebook login, paypal payout webhook url)
  • Php Extensions
    • GD Version - 2.x+
    • PCRE Version - 7.x+
    • cURL version - 7.x+
    • JSON version - 1.x+
    • mbstring
    • OpenSSL
    • PDO
    • geoip In case of php installed geoip need to add composer ("geoip/geoip": "~1.16")
    • iConv
  • php.ini settings
    • max_execution_time - 180 (not mandatory)
    • max_input_time - 6000 (not mandatory)
    • memory_limit - 128M (at least 32M)
    • safe_mode - off
    • open_basedir - No Value
    • display_error = On
    • magic_quotes_gpc = Off
    • max_file_uploads Default upload size set 2Mb how much you want change it.
    • post_max_size Default post size set 2Mb how much you want change it.
  • ffmpeg Install (Video conversion)
  • Nginx OR Apache (server)
  • Apache - 1+ (preferably 2+)
    • Modules
      • mod_rewrite
      • mod_deflate (not mandatory, but highly recommended for better performance–gzip)
      • mod_expires (not mandatory, but highly recommended for better performance–browser caching)
  • Recommended Linux distributions: Centos / Ubuntu / RedHat

Step 2: Initial Configurations

Unzip the zip file and unzipped files in server.

Need write permission for following folders

(Need write permission for php/apache; can be chmod 655 or 755 or 777 depending upon server configuration)

    /media
      |-- Certificate
      |-- CloudFront
      |-- CodingExercises
      |-- Course
      |-- CoursePromoVideo
      |-- CoursePromoVideoOrigin
      |-- Export    
      |-- GeoIP    
      |-- Help    
      |-- MessageContent    
      |-- OnlineCourseLesson    
      |-- Resume    
      |-- User    
      |-- temp    
    /tmp
    /server/php/plugins/VideoLessons/shell/convert_video.sh
    /server/php/plugins/Credit/credit.sh
    /server/php/plugins/Message/message.sh
    /server/php/plugins/News/news.sh
    /server/php/plugins/PaypalREST/payout.sh
    /server/php/plugins/MultiCurrency/currency_conversion.sh
    /server/php/plugins/Campaigns/course_campaign.sh
    /server/php/Slim/shell/course_user_complete.sh
    /server/php/Slim/shell/export.sh
    /server/php/plugins/PaypalREST/referral_commission_payment.sh
    /server/php/Slim/shell/congratulation_message.sh
    /server/php/Slim/shell/geoip.sh
    /client/assets/img
      |-- original
        |-- Course
        |-- User
        |-- Certificate
        |-- CoursePreview
        |-- Help
      |-- macro_thumb
        |-- Course
        |-- User
      |-- micro_thumb
        |-- Course
        |-- User
        |-- Help
      |-- small_thumb
        |-- Course
        |-- User
        |-- Help
      |-- normal_thumb
        |-- Course
        |-- User
        |-- Help
      |-- medium_thumb
        |-- Course
        |-- User
        |-- Help
      |-- big_medium_thumb
        |-- Course
        |-- User
      |-- large_medium_thumb
        |-- Course
        |-- Help
      |-- big_thumb  
        |-- Course
        |-- User
        |-- Help
      |-- large_thumb  
        |-- Course
        |-- Help
      |-- very_large_thumb  
        |-- Course
        |-- Help  
      |-- social_thumb
        |-- Course
        |-- User
        |-- Help 
        |-- Certificate 

There are few places where site logo are located. To change those logo, you need to replace your logo with exact name and resolution in the following mentioned directories.

  Logo: /client/assets/img/logo.png
  Logo: /client/assets/img/logo-600x315.png
  Favicon: /client/assets/favicon.ico
  Apple touch icon: /client/assets/apple-touch-icon.png
  Apple touch icon: /client/assets/apple-touch-icon-72x72.png
  Apple touch icon: /client/assets/apple-touch-icon-114x114.png
  Admin Logo: /client/ag-admin/images/logo.png

Configure Your Database

  • The sql file 'teachr_mysql_with_empty_data.sql' is also attached, which is located in 'sql/'. import the database through phpmyadmin or any other tool.
  • After importing the sql database, do not truncate any data directly from the database. All the data in the imported database are required.
  • In server/php/config.inc.php, we need to change host, login, password, database.
    define('R_DB_HOST', 'localhost');
    define('R_DB_NAME', 'DBNAME');
    define('R_DB_USER', 'DBUSER');
    define('R_DB_PASSWORD', 'DBPASSWORD');

Setting Up Cron

Video convert

* * * * * /html/server/php/plugins/VideoLessons/shell/convert_video.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Credit

* * * * * /html/server/php/plugins/Credit/credit.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Message

* * * * * /html/server/php/plugins/Message/message.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

News

* * * * * /html/server/php/plugins/News/news.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Payment Release to instructor

* * * * * /html/server/php/plugins/PaypalREST/release_payment.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Paypal payout

* * 1 * * /html/server/php/plugins/PaypalREST/payout.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Multi currency

* * 1 * * /html/server/php/plugins/MultiCurrency/currency_conversion.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Campaigns

* * * * * /html/server/php/plugins/Campaigns/course_campaign.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Course Complete

* * * * * /html/server/php/Slim/shell/course_user_complete.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Export

* * * * * /html/server/php/Slim/shell/export.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Referral commission payment

* * 1 * * /html/server/php/plugins/PaypalREST/referral_commission_payment.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Congratulation message

* * * * * /html/server/php/Slim/shell/congratulation_message.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Geoip dat

0 * 15 * * /html/server/php/Slim/shell/geoip.sh 1>> /html/tmp/logs/shell.log 2>> /html/tmp/logs/shell.log

Step 3: Manage site settings

Site Information

  • Site Name
    • This name will used in all pages and emails.
  • Site Dafault Language
    • This language will be used as default language all over the site.
  • Promotional Management Email
    • This is the email address to which you will receive the mail from Promotional Management.
  • Common From Email
    • This is the email address that will appear in the "From" field of all emails sent from the site.
  • Common Reply to Email
    • "Reply-To" email header for all emails. Leave it empty to receive replies as usual (to "From" email address).
  • Currency Code
    • This currency code will be used in courses list, transactions list and also for emails if the currency symbol is not available.
  • Currency Symbol
    • This currency symbol used as default currency symbol at courses list, transactions list and also for emails.
  • Site Languages
    • These are the site's available languages. The user can select any one of the language in the site and seeing the site content by their selected language
  • Site TimeZone
    • This is the site timezone that will used for all the time displaying.
  • Payout Date
    • Payout Date
  • Payout Threshold
    • Payout threshold amount
  • Days To Release Payment To Instructor Video Based Course
    • Days To Release Payment To Instructor Video Based Course
  • Days To Release Payment To Instructor Online And Onsite Based Course
    • Days To Release Payment To Instructor Online And Onsite Based Course
  • Enable Auto Login After Registration
    • On enabling this feature, users will be automatically logged-in after registration.
  • Country VAT Fee Percentage
    • VAT for countries (European Union (EU) Countries, UK, Japan, South Korea)
  • Instructor Team Email
    • Emails with comma separated
  • Newcomer Challenge Team emails
    • Emails with comma separated
  • Course Feedback Team Emails
    • Emails with comma separated
  • Receive Email
    • This is the email address to which you will receive the mail from contact resume form.
  • Help Topic Team Email
    • Emails with comma separated
  • Maximum Coupon Discount
    • MAXIMUM_COUPON_DISCOUNT
  • New User Join Email
    • New User Join Email
  • Certificate Pdf
    • Certificate Pdf

SEO And Metadata

  • Meta Keywords
    • These are the keywords used for improving search engine results of our site. (Comma separated for multiple keywords)
  • Meta Description
    • This is the short description of your site, used by search engines on search result pages to display preview snippets for a given page.

ZazPay

  • Zazpay Website Account created
    • Zazpay Website Account created
  • Zazpay Domain Secret Hash
    • Zazpay Domain Secret Hash
  • Site Enable Zazpay Plugin
    • Site Enable Zazpay Plugin

Withdrawal

  • Minimum Withdrawal Amount
    • This is the minimum amount a user can withdraw from their wallet.
  • Maximum Withdrawal Amount
    • This is the maximum amount a user can withdraw from their wallet.

Analytics

  • Google Analytics Profile ID
    • It is the site's google analytics profile ID.
  • Facebook Pixel ID
    • It is the site's facebook analytics pixel ID.
  • Enabled Google Analytics?
    • It is for enable/disable the google analytics by giving 0 or 1.
  • Enabled Facebook Pixel?
    • It is for enable/disable the facebook pixel by giving 0 or 1.

MOOC Affiliate

  • Affiliate ID
    • This the MOOC affiliate ID.
  • Affiliate Api Key
    • This the MOOC affiliate api key.
  • Course Limit
    • Course Limit

Follow Us

  • Facebook Page URL
    • This is the site's "Facebook" page url to follow the site.
  • Twitter URL
    • This is the site's "Twitter" url displayed in the footer.
  • Google Plus URL
    • This is the site's "Google+" url displayed in the footer.
  • Foursquare URL
    • This is the site's "foursquare" url displayed in the footer.
  • Pinterest URL
    • This is the site's "Pinterest" url displayed in the footer.
  • Flickr URL
    • This is the site's "Flickr" url displayed in the footer.
  • Instagram URL
    • This is the site's "Instagram" url displayed in the footer.
  • Tumblr URL
    • This is the site's "Tumblr" url displayed in the footer.
  • YouTube URL
    • This is the site's "Youtube" channel url displayed in the footer.
  • Vimeo URL
    • This is the site's "Vimeo" url displayed in the footer.

Course

  • Allow Lecturer Publish Their Course?
    • It is for allowing the lecturers to publish their course.
  • Maximum Course Fee
    • This is the maximum course fee a teacher can set price for their own course

Comments

  • Facebook Admin User ID
    • This is the site admin's facebook user ID.
  • Disqus Comment - Short Name
    • This is the disqus comment short name.
  • Facebook API Key
    • This is the facebook comment api key.
  • Enabled Facebook Comment in Course Page?
    • It is for enable/disable the "Facebook Comment in Course Page" by giving 0 or 1.
  • Enabled Disqus Comment in Course Page?
    • It is for enable/disable the "Disqus Comment in Course Page" by giving 0 or 1.
  • Default Limit To Show The Facebook Comment in Course Page?
    • How much Facebook Comment limit in Course Page

Plugins

  • Enabled Plugins
    • Enable Plugins this project
  • Banner All Page Top
    • Banner for all page top in the site.
  • Banner All Page Bottom
    • Banner for all page bottom in the site.
  • Banner Profile Page Sidebar
    • Banner for profile page sidebar in the site.
  • Banner Course Page Sidebar
    • Banner for course page sidebar in the site.

Video

  • Promo Video
    • This to enable/disable promo video for courses by giving 0 or 1.
  • Video File Size Limitation
    • Here you can set the maximum file size for videos and the file size should be in megabytes(MB).
  • Keep Original Video File
    • This is to keep/delete original video files in server by giving 0 or 1.
  • Allowed Video Extensions
    • Here you can set allowed video extension. for example ".txt", ".png", etc.You should add MIME types for each video extension, for example, "text/plain", "image/jpg", etc.Video upload is working only based on MIME Types not an extensions. Extensions are used to display allowed extension information in user end.
  • Allowed Video MIME Types
    • Here you can manage MIME types for each video extensions. for example, "text/plain", "image/jpg", etc.Video upload is working only based on MIME Types not an extensions. Extensions are used to display allowed extension information in user end.

Downloadable File

  • Allowed Downloadable File Extension
    • Here you can set allowed downloadable file extension. for example ".txt", ".png", etc.You should add MIME types for each downloadable file extension, for example, "text/plain", "image/jpg", etc.File upload is working only based on MIME Types not an extensions. Extensions are used to display allowed extension information in user end.If MIME Type is empty it will allows all the file formats.
  • Allowed Downloadable MIME Types
    • Here you can manage MIME types for each downloadble file extensions. for example, "text/plain", "image/jpg", etc. File upload is working only based on MIME Types not an extensions.Extensions are used to display allowed extension information in user end.If MIME Type is empty it will allows all the file formats.
  • Downloadable File Size Limitation
    • Here you can set the maximum downloadable file size and the file size should be in megabytes(MB).
  • Theme
    • Theme
  • Here you can set the maximum image file size and the file size should be in megabytes(MB).
    • Here you can set the maximum image file size and the file size should be in megabytes(MB).
  • Allowed Extension
    • Allowed Extension

Credits

  • Amount Per Credit
    • Amount Per Credit
  • Winner Selection Days After End Date
    • Winner Selection Days After End Date

Coupon

  • Min Coupon Amount
    • Minimum coupon amount

ThirdParty

  • Captcha Site Key (Create)
    • Here you can set the Captcha Site Key

AWS

  • Access Key
    • Enter the created Access Key for your bucket.
  • Secret Key
    • Enter the created Secret Key for your bucket.
  • AWS REGION
    • Enter the AWS REGION provided by AWS
  • Bucket URL
    • Enter the URL to which the file to be get stored. eg., e.g., https://s3-us-west-2.amazonaws.com/your_bucket_name where “your_bucket_name}” is the name given in the previous input.
  • max File Size
    • Enter the max File Size upload in AWS
  • AWS CLOUDFRONT URL
    • Enter the AWS BASE URL
  • AWS PIPELINE ID
    • Enter the AWS PIPELINE ID
  • AWS PRESET ID
    • Enter the AWS PRESET ID
  • Save In Amazon?
    • If the value is set as “Yes” mean, uploaded media files will get stored in amazon s3 server. Otherwise files will be stored in the local server alone.

Step 4: Manage payment gateways

PayPalREST

  • Client ID
    • PayPal Client ID
  • Client SECRET
    • PayPal Client SECRET
  • Paypal Mode
    • PayPal Mode ( live / sandbox )
  • Info
    • Create app url https://developer.paypal.com
    • return url Update ex: YourDomain/api/v1/users/paypal_email/update
      • Go to https://developer.paypal.com/developer/applications/edit/YourApplication and update return url picture
    • Credentials picture
    • Payout webhook URL : https://YourDomain/api/v1/checkPayoutBatch (https must)
    • picture

Braintree

  • Braintree Environment
    • Braintree Environment
  • Merchant ID
    • Braintree Merchant Id
  • Public Key
    • Braintree Public Key
  • Private Key
    • Braintree Private Key
  • Info
    • Get app url sandbox https://sandbox.braintreegateway.com/login or live https://braintreegateway.com/login
    • Credentials picture

Stripe

  • Stripe Secret Key
    • Stripe Secret Key
  • Stripe Webhook Secret Key
    • Stripe Webhook Secret Key
  • Stripe Publishable Key
    • Stripe Publishable Key
  • Webhook URL http://YourDomain/server/php/Slim/public/stripe_ipn.php
  • Info
    • Get app url https://dashboard.stripe.com/account/apikeys
    • Credentials picture

Step 5: Manage ThirdParty

Google ReCaptcha

  • Url https://www.google.com/recaptcha/admin#list
  • How to add domain name picture

Google+

  • Url https://console.cloud.google.com/ picture
  • Redirect Url YourDomain/redirect.html

Facebook

  • Url https://developers.facebook.com/ picture
  • Redirect Url YourDomain/redirect.html

Twitter

  • Url https://developer.twitter.com/en.html picture
  • Redirect Url YourDomain/redirect.html

Linkedin

  • Url https://www.linkedin.com/developer/apps picture
  • Redirect Url YourDomain/redirect.html

Customizing original script

  • Almost same like build` script mentioned above. But the file path should be with lead with /source/ folder name in nginx conf file or .htaccess file.
  • Update a line in /source/client/scr/index.html -> to
  • Goto /source/client and run grunt build:teachr command. (Before make sure, we must run npm install in this path), after successfully run, build folder will be created in source/client folder.
  • In conf or .htaccess file, we must route index path as root /home/nginxpg/html/source/client/build instead of root /home/nginxpg/html/client
  • For every changing of source file, we must run grunt build:teachr to reflect changes
  • Once changes are mode, then we must build the source code to minified version for uploading into production version.
  • For making build version, we need to revert a line in /source/client/scr/index.html -> to . then run grunt dev1:teachr:eloquent. It makes build.zip file, then we need to upload it to server's and make it unzip.