Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

better readme and example env file

goenning8be3c00f4028
diff --git a/.example.env b/.example.env
new file mode 100644
index 000000000..1924030e7
--- /dev/null
+++ b/.example.env
@@ -0,0 +1,8 @@
+DATABASE_URL=postgres://wechy:wechy-pw@localhost:5555/wechy?sslmode=disable
+JWT_SECRET=hsjl]W;&ZcHxT&FK;s%bgIQF:#ch=~#Al4:5]N;7V<qPZ3e9lT4'%;go;LIkc%k
+
+OAUTH_FACEBOOK_APPID=
+OAUTH_FACEBOOK_SECRET=
+
+OAUTH_GOOGLE_CLIENTID=
+OAUTH_GOOGLE_SECRET=
\ No newline at end of file
diff --git a/README.md b/README.md
index a4dd0b7f9..e6ee173f3 100644
--- a/README.md
+++ b/README.md
@@ -7,23 +7,26 @@
Visit http://we.canhearyou.com for information on what it is and how to use it.
-# How to run it locally?
+# How to run it locally for development purpose?
-WeCanHearYou is mainly written in Go and TypeScript, but we're also using things like Node.js, React and PostgreSQL. So if you know these technologies or would like to learn, you came to the right place.
+WeCanHearYou is mainly written in Go and TypeScript, but we're also using things like Node.js, React and PostgreSQL.
+If you know these technologies or would like to learn them, lucky you! This is the right place!
Tools you'll need:
- Go 1.8+ (https://golang.org)
- Node.js 6+ (https://nodejs.org/)
- Docker (https://www.docker.com/)
+- github.com/codegangsta/gin (https://github.com/codegangsta/gin)
Step by step:
-1) clone this repository into `$GOPATH/src/GitHub.com/WeCanHearYou/wechy`
-2) run `npm install` to install froentend packages
-3) run `npm run build:watch` to pack the froentend source into a bundle. It'll
-4) run `docker-compose up -d` to start a local PostgreSQL database on Docker.
-5) run `make watch` to start the application.
-6) Navigate to `http://orange.dev.canhearyou.com:3000` and boom! Welcome to your new local WeCanHearYou development copy!
+1) clone this repository into `$GOPATH/src/github.com/WeCanHearYou/wechy`
+2) run `npm install` to install front end packages
+3) run `npm run build:watch` to pack the front end source into a bundle. It'll
+4) run `docker-compose up -d pgdev` to start a local PostgreSQL database on Docker.
+5) run `cp .example.env .env` to create a local Environment configuration file.
+6) run `make watch` to start the application.
+7) Navigate to `http://demo.dev.canhearyou.com:3000/` and boom! Welcome to your new local WeCanHearYou development copy!
Change some code, fix some bugs, implement some features and send us your Pull Request!
diff --git a/app/pkg/env/env.go b/app/pkg/env/env.go
index b97dcca49..51eb299fb 100644
--- a/app/pkg/env/env.go
+++ b/app/pkg/env/env.go
@@ -33,8 +33,7 @@ func IsSingleHostMode() bool {
// CurrentDomain returns Wechy domain based on current environment variables
func CurrentDomain() string {
- env := os.Getenv("GO_ENV")
- switch env {
+ switch Current() {
case "test":
return "test.canhearyou.com"
case "development":
diff --git a/docker-compose.yml b/docker-compose.yml
index 3430f93c3..60cc53b07 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,6 +1,6 @@
version: '2'
services:
- postgres:
+ pgdev:
restart: always
image: postgres:9.6
volumes: