diff --git a/LICENSE b/LICENSE index e69de29..c0d0959 100644 --- a/LICENSE +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Danny van Kooten + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b66be09..bb150c2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ Ana. Open Source Web Analytics. ============================== -This is nowhere near being usable, let alone stable. Treat as a proof of concept. +This is nowhere near being usable, let alone stable. Please treat as a proof of concept while we work on getting this to a stable state. ![Screenshot of the Ana dashboard](https://github.com/dannyvankooten/ana/raw/master/assets/img/screenshot.png?v=6) -## Usage +## Installation + +For getting a development version of Ana up & running, please go through the following steps. + +1. Rename `.env.example` to `.env` and set your database credentials. +2. Run the database migrations: `./do database_migrate up` +3. Install Go dependencies: `./do install_dependencies` +3. Compile into binary: `./do bin` +4. Create your user account: `./ana -create_user -email="johndoe@email.com" -password="...."` +5. Run default Gulp task to build static assets: `gulp` +6. Start the webserver: `./ana` & visit **localhost:8080** to access your analytics dashboard. + +To start tracking, include the following JavaScript on your site and replace `ana.dev` with the URL to your Ana instance. ```html @@ -24,3 +36,7 @@ ana('trackPageview'); ``` + +## License + +MIT licensed. diff --git a/do b/do index 65f1fca..6c30640 100755 --- a/do +++ b/do @@ -1,10 +1,20 @@ #!/bin/bash -bin() { - go run ana.go +install_dependencies() { + go get "github.com/gorilla/sessions" + go get "golang.org/x/crypto/bcrypt" + go get "github.com/mssola/user_agent" + go get "github.com/gorilla/mux" + go get "github.com/Pallinder/go-randomdata" + go get "github.com/gorilla/handlers" + go get "github.com/go-sql-driver/mysql" } -migrate() { +bin() { + go build +} + +database_migrate() { export $(cat .env | xargs) $GOPATH/bin/migrate -url mysql://$ANA_DATABASE_USER:$ANA_DATABASE_PASSWORD@$ANA_DATABSE_HOST/$ANA_DATABASE_NAME -path ./db/migrations $1 $2 $3 }