Merge pull request #215 from datagovsg/update-readme-missing-bower-cmd
Update readme missing bower cmd
This commit is contained in:
commit
082289c50c
58
README.md
58
README.md
|
@ -18,6 +18,7 @@ TellForm 2.0.0
|
||||||
- [Quickstart](#quickstart)
|
- [Quickstart](#quickstart)
|
||||||
- [Deploying with Docker](#deploying-with-docker)
|
- [Deploying with Docker](#deploying-with-docker)
|
||||||
- [Testing your Application](#testing-your-application)
|
- [Testing your Application](#testing-your-application)
|
||||||
|
- [FORMA](#forma)
|
||||||
- [Where to Get Help](#where-to-get-help)
|
- [Where to Get Help](#where-to-get-help)
|
||||||
- [Sponsors](#sponsors)
|
- [Sponsors](#sponsors)
|
||||||
- [Backers](#backers)
|
- [Backers](#backers)
|
||||||
|
@ -155,6 +156,63 @@ To calculate your client-side test coverage with Istanbul, run the coverage task
|
||||||
$ grunt coverage:client
|
$ grunt coverage:client
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## FORMA
|
||||||
|
|
||||||
|
#### Prerequisite:
|
||||||
|
Before you start, make sure you have
|
||||||
|
1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379
|
||||||
|
2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all)
|
||||||
|
3. [Docker](https://docs.docker.com/engine/installation/) installed and running
|
||||||
|
|
||||||
|
Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX)
|
||||||
|
|
||||||
|
|
||||||
|
#### Install dependencies:
|
||||||
|
```
|
||||||
|
$ npm install
|
||||||
|
$ bower install
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Prepare .env file:
|
||||||
|
Create .env file at project root folder. Fill in MAILER_SERVICE_PROVIDER, MAILER_EMAIL_ID and MAILER_PASSWORD.
|
||||||
|
```
|
||||||
|
APP_NAME=forma
|
||||||
|
APP_DESC=
|
||||||
|
APP_KEYWORDS=
|
||||||
|
NODE_ENV=development
|
||||||
|
BASE_URL=localhost:5000
|
||||||
|
PORT=5000
|
||||||
|
username=forma_admin
|
||||||
|
MAILER_SERVICE_PROVIDER=
|
||||||
|
MAILER_EMAIL_ID=
|
||||||
|
MAILER_PASSWORD=
|
||||||
|
MAILER_FROM=forma@data.gov.sg
|
||||||
|
SIGNUP_DISABLED=false
|
||||||
|
SUBDOMAINS_DISABLED=true
|
||||||
|
DISABLE_CLUSTER_MODE=true
|
||||||
|
GOOGLE_ANALYTICS_ID=
|
||||||
|
RAVEN_DSN=
|
||||||
|
PRERENDER_TOKEN=
|
||||||
|
COVERALLS_REPO_TOKEN=
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Deploy with Docker:
|
||||||
|
Create and start mongo & redis docker container.
|
||||||
|
```
|
||||||
|
$ docker run -p 27017:27017 -d --name forma-mongo mongo
|
||||||
|
$ docker run -p 127.0.0.1:6379:6379 -d --name forma-redis redis
|
||||||
|
```
|
||||||
|
|
||||||
|
After code changes, build and start docker containers.
|
||||||
|
```
|
||||||
|
$ docker start forma-mongo && docker start forma-redis
|
||||||
|
$ docker build -t forma-tellform .
|
||||||
|
$ docker stop forma-tellform
|
||||||
|
$ docker run --rm -p 5000:5000 --link forma-redis:redis-db --link forma-mongo:db --name forma-tellform forma-tellform
|
||||||
|
```
|
||||||
|
|
||||||
|
Your application should run on port 5000 or the port you specified in your .env file, so in your browser just go to [http://localhost:5000](http://localhost:5000)
|
||||||
|
|
||||||
|
|
||||||
## Where to get help
|
## Where to get help
|
||||||
|
|
||||||
|
|
1
config/env/development.js
vendored
1
config/env/development.js
vendored
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
baseUrl: process.env.BASE_URL || 'http://localhost:5000',
|
baseUrl: process.env.BASE_URL || 'http://localhost:5000',
|
||||||
|
port: process.env.PORT || 5000,
|
||||||
db: {
|
db: {
|
||||||
uri: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || '0.0.0.0') +'/mean',
|
uri: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || '0.0.0.0') +'/mean',
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -93,11 +93,7 @@ module.exports = function(db) {
|
||||||
urlPath = url.parse(req.url).path.split('/');
|
urlPath = url.parse(req.url).path.split('/');
|
||||||
if (urlPath.indexOf('static') > -1) {
|
if (urlPath.indexOf('static') > -1) {
|
||||||
urlPath.splice(1, 1);
|
urlPath.splice(1, 1);
|
||||||
if(process.env.NODE_ENV === 'development'){
|
|
||||||
req.root = req.protocol + '://' + config.baseUrl + ':' + config.port + urlPath.join('/');
|
|
||||||
} else {
|
|
||||||
req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/');
|
req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/');
|
||||||
}
|
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,8 +363,8 @@ module.exports = function(grunt) {
|
||||||
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']);
|
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']);
|
||||||
|
|
||||||
// Lint task(s).
|
// Lint task(s).
|
||||||
grunt.registerTask('lint', ['jshint', 'csslint']);
|
// grunt.registerTask('lint', ['jshint', 'csslint']);
|
||||||
grunt.registerTask('lint:tests', ['jshint:allTests']);
|
// grunt.registerTask('lint:tests', ['jshint:allTests']);
|
||||||
|
|
||||||
// Build task(s).
|
// Build task(s).
|
||||||
grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'closure-compiler', 'html2js:main', 'html2js:forms']);
|
grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'closure-compiler', 'html2js:main', 'html2js:forms']);
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
<uib-tab index="0" heading="{{ 'CREATE_TAB' | translate }}">
|
<uib-tab index="0" heading="{{ 'CREATE_TAB' | translate }}">
|
||||||
<edit-form-directive myform="myform"></edit-form-directive>
|
<edit-form-directive myform="myform"></edit-form-directive>
|
||||||
</uib-tab>
|
</uib-tab>
|
||||||
<uib-tab ng-repeat="tab in tabData" index="{{$index}}+1" heading="{{tab.heading}}">
|
<uib-tab ng-repeat="tab in tabData" index="{{$index+1}}" heading="{{tab.heading}}">
|
||||||
<div class='row' data-ng-include="'/static/modules/forms/admin/views/adminTabs/'+tab.templateName+'.html'" onload="form_url = trustSrc(formURL)"></div>
|
<div class='row' data-ng-include="'/static/modules/forms/admin/views/adminTabs/'+tab.templateName+'.html'" onload="form_url = trustSrc(formURL)"></div>
|
||||||
</uib-tab>
|
</uib-tab>
|
||||||
<uib-tab index="2" heading="{{ 'ANALYZE_TAB' | translate }}">
|
<uib-tab index="2" heading="{{ 'ANALYZE_TAB' | translate }}">
|
||||||
|
@ -187,6 +187,55 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</uib-tab>
|
</uib-tab>
|
||||||
|
<uib-tab ng-if="tabData" heading="{{ 'ANALYZE_TAB' | translate }}" index="{{tabData.length+2}}">
|
||||||
|
<edit-submissions-form-directive myform="myform" user="myform.admin"></edit-submissions-form-directive>
|
||||||
|
</uib-tab>
|
||||||
|
<uib-tab ng-if="tabData" heading="{{ 'SHARE_TAB' | translate }}" index="{{tabData.length+3}}">
|
||||||
|
<div class="config-form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<uib-tabset active="activePill" vertical="true" type="pills">
|
||||||
|
<uib-tab index="0" heading="{{ 'SHARE_YOUR_FORM' | translate }}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'TELLFORM_URL' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-8 form-input">
|
||||||
|
<span ngclipboard data-clipboard-target="#copyURL"> <input id="copyURL" ng-value="actualFormURL" class="form-control ng-pristine ng-untouched ng-valid"> </span>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<button class="btn btn btn-secondary view-form-btn" ngclipboard data-clipboard-target="#copyURL">
|
||||||
|
{{ 'COPY' | translate }} <i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</uib-tab>
|
||||||
|
<uib-tab index="1" heading="{{ 'EMBED_YOUR_FORM' | translate }}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'COPY_AND_PASTE' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-8 form-input">
|
||||||
|
<span ngclipboard data-clipboard-target="#copyEmbedded">
|
||||||
|
<textarea id="copyEmbedded" class="form-control ng-pristine ng-untouched ng-valid" style="min-height:200px; width:100%; background-color: #FFFFCC; color: #30313F;">
|
||||||
|
<!-- {{ 'CHANGE_WIDTH_AND_HEIGHT' | translate }} -->
|
||||||
|
<iframe id="iframe" src="{{actualFormURL}}" style="width:100%;height:500px;"></iframe>
|
||||||
|
<div style="font-family: Sans-Serif;font-size: 12px;color: #999;opacity: 0.5; padding-top: 5px;">{{ 'POWERED_BY' | translate }} <a href="https://www.tellform.com" style="color: #999" target="_blank">TellForm</a></div>
|
||||||
|
</textarea>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<button class="btn btn btn-secondary view-form-btn" ngclipboard data-clipboard-target="#copyEmbedded">
|
||||||
|
{{ 'COPY' | translate }} <i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</uib-tab>
|
||||||
|
</uib-tabset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</uib-tab>
|
||||||
</uib-tabset>
|
</uib-tabset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -585,10 +585,11 @@
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px;" >
|
<div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px;" >
|
||||||
<div class="panel-group tool-panel text-center">
|
<div class="panel-group tool-panel text-center">
|
||||||
<div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if="!field.deletePreserved">
|
<div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if="!field.deletePreserved">
|
||||||
<div class="panel-heading" style="padding: 10px 10px; height: 37px;" ng-click="deleteField($index)">
|
<div class="panel-heading" style="padding: 10px 10px;" ng-click="deleteField($index)">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<a href="" class="fa fa-trash-o"></a>
|
<a href="" class="fa fa-trash-o"></a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -599,7 +600,7 @@
|
||||||
<div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px;">
|
<div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px;">
|
||||||
<div class="panel-group tool-panel text-center">
|
<div class="panel-group tool-panel text-center">
|
||||||
<div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if="!field.deletePreserved">
|
<div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if="!field.deletePreserved">
|
||||||
<div class="panel-heading" style="padding: 10px 10px; height: 37px;" ng-click="duplicateField($index)">
|
<div class="panel-heading" style="padding: 10px 10px;" ng-click="duplicateField($index)">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<a href="" class="fa fa-files-o"></a>
|
<a href="" class="fa fa-files-o"></a>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue