unknownanalytics is a minimalist analytics tool that protect user privacy.
This is the code source of the web application including the web sdk.
- Version
- ruby-2.7.2
- Rails 6.1.3
- pg 10
- redis
- Install libq-dev (native lib tool for pg). For alpine image we use
postgresql-devinstead .
bundle install
-
Create your database (develop only), please follow deployment instruction for docker compose deployment
-
Database initialization (migrations and so on)
run UNK_ANA_DATABASE_URI=<postgres://postgres_user:pg_password@host/your_db_name> UNK_ANA_REDIS_URI=<redis://host> (bundle exec) db migrate
- Generate migration
run UNK_ANA_DATABASE_URI=<postgres://postgres_user:pg_password@host/your_db_name> UNK_ANA_REDIS_URI=<redis://host> (bundle exec) rails g migration <add_new_attr>
Run server (dev only). See .env for full vars env list
The minimum required env are UNK_ANA_DATABASE_URI, UNK_ANA_REDIS_URI, UNK_ANA_SMTP_URI
UNK_ANA_DATABASE_URI=<postgres://postgres_user:pg_password@host/db_name> UNK_ANA_REDIS_URI=<redis://host> UNK_ANA_SMTP_URI=<your_smtp_local> rails s
For deployment process, see deployment
The sdk is build with rollup, inside web-sdk-cli
- Use
npm run watchto live reload compile - Use
npm run buildto build the sdk. This is step is done automatically when docker-compose is mounted. - Use index.html file to test the sdk.
- Use
unkAnalytics('api_key', {debug : true });for debugging
- TODO (job queues, cache servers, search engines, etc.)
