This is the part of the VidCloud project: the heart of the whole system.
- Provide SSO for all VC projects;
- Manage billing and provision user profiles with their subscriptions;
- Manage storage for all project entities;
- Provide logic for RESTful API.
Before first launch the following software must be installed:
- Node.js (8.9.x generation);
- MongoDB (v3.2+).
git clone git@github.com:strategic-limited/remix-api.git- to get project sources;npm install- to install Node.js submodules;gulp migrate- to run project migrations;gulporgulp default- to perform project launch. You're able to runnpm startornode runner.js serveras well.
| Variable | Affects on | Default value |
|---|---|---|
| PORT | Port that will be used to run this server | 1340 |
| MONGO_URL | Determines connection URL for MongoDB instance | 'mongodb://localhost/makeapi' |
| APP_PREFIX | Domain prefix for this module, in most cases should stay unchanged | 'api' |
| AWS_ACCESS_KEY_ID | AWS Key mostly for working with AWS S3 | '' |
| AWS_SECRET_ACCESS_KEY | AWS Secret paired with AWS_ACCESS_KEY_ID | '' |
| MAILER_FROM | Mail address that will be used as From value | 'no-reply@vidcloud.io' |
| MAILER_SERVICE_PROVIDER | Mail provider used to send emails | 'ses' |
| SES_REGION | Default AWS region if SES is using | 'us-west-2' |
| DEAL_GUARDIAN_SECRET | Secret for DealGuardian payment system | 'secret' |
| JVZOO_SECRET | Secret for JVZoo payment system | 'secret' |
| ZAXAA_SIGNATURE | Signature for Zaxaa payment system | 'signature' |
| INTERCOM_ENABLED | Determines if app should use Intercom | false |
| INTERCOM_APP_ID | App ID for Intercom | '' |
| INTERCOM_APP_API_KEY | API Key for Intercom | 'apiKey' |
| HEROKU_API_KEY | Heroku API Key, used to automatic linking of WhiteLabel domains | undefined |
| API_PREFIX | Default domain prefix for remix-api module | 'api' |
| API_APP_NAME | Name of remix-api Heroku instance | 'remix-api-staging' |
| EDITOR_PREFIX | Default domain prefix for remix-editor module | 'app' |
| EDITOR_APP_NAME | Name of remix-editor Heroku instance | 'remix-editor-staging' |
| PROJECTS_PREFIX | Default domain prefix for remix-projects module | 'projects' |
| PROJECTS_APP_NAME | Name of remix-projects Heroku instance | 'remix-projects-staging' |
| FALLBACK_DOMAIN | Domain that will be used if no WhiteLabel domain detected | 'vidcloud.io' |
| SUPPORT_LINK | Default Support link | 'http://digistrats.zendesk.com/' |
| DEFAULT_TUTORIALS_LINK | Default Tutorials link | 'http://dashboard.vidcloud.io/tutorials' |
| DEFAULT_REPLY_TO | Default value for Reply-To mail field | 'support@videoremix.mail.intercom.io' |
| FACEBOOK_SECRET | Facebook Secret used for Facebook API | '' |
| APP_HOSTNAME | Legacy Login: Hostname for local service | 'http://localhost:3000' |
| LOGINAPI | Legacy Login: Hostname for local service with credentials | 'http://testuser:password@localhost:3000' |
| SESSION_SECRET | Legacy Login: Cookie Session secret | 'dummy secret value' |
| FORCE_SSL | Determines if we're using HTTPS | false |
| COOKIE_DOMAIN | Cookie domain used for session | undefined |
| ALLOWED_USERS | A list of users that allowed to use basic auth | 'testuser:password' |
| ALLOWED_CORS_DOMAINS | A list of domains for CORS | undefined |
Since VidCloud system supports WhiteLabels, it is important to simulate WhiteLabel behaviour for local machine. It may be achieved with HTTP-proxy forwarding via nginx or Apache. For example, proxying setting for Remix API and Apache will be the following:
<VirtualHost *:80>
ServerName api.vidcloud.io
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:1340/
ProxyPassReverse / http://127.0.0.1:1340/
</VirtualHost>
And /etc/hosts also should redirect this endpoint to loopback:
127.0.0.1 api.vidcloud.io
To run tests:
- Run migrations for testing environment:
node runner.js migrate-dbwithNODE_ENV=test; - Launch testing environment:
node runner.js serverwithNODE_ENV=test; - Run tests with Mocha.js:
node runner.js test/testwithNODE_ENV=test.
