Skip to content
/ wa Public

Typical ERP (Erlang, Redis, PostgreSQL) web application

Notifications You must be signed in to change notification settings

relabsoss/wa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goals

This project was targetting on creation the starting point for web-developers for using Erlang + PostgreSQL + Redis as platform.

Installation quest

You need install PostgreSQL (9.4 or higher), Erlang (better R17, R18 has some unpleasand issues with deps). Redis currently not used, but we can. :)

Next - install and build application:

git clone https://github.com/mkrentovskiy/wa.git
cd wa
make
...
(here we can get troubles with merl cause some rebar species. Just cd deps/merl; make; nano ebin/merl.app 
and add merl_tests.beam to modules, after that repeat make in application top)
...
cp priv/sys.config priv/local.sys.config
make run-local

... and its not work! :) We need some configuration steps:

Configure database:

sudo su postgres -c psql
postgres=# CREATE DATABASE wa ENCODING 'utf8';
postgres=# CREATE USER wa WITH PASSWORD 'wa';
postgres=# GRANT ALL PRIVILEGES ON DATABASE wa TO wa;
postgres=# \q

Next, Mailgun. Go to https://mailgun.com/, register, add some domain, confirm it and get API access params - URL, public and private keys. Write it to local.sys.config at mail_sender section. (Some lyrics: most of public services are block templated messages as a spam. If you need SMTP sender, you can take this one - https://github.com/mkrentovskiy/onelogin/blob/master/src/mail_sender.erl)

ReCAPTCHA 2 is using for auto-registration block. You need open and secret key for it. Go to https://www.google.com/recaptcha/admin#list, add your application, put localhost to allowed domains. Than replace open key in https://github.com/mkrentovskiy/wa/blob/master/priv/www/index.html#L92 and add secret key to local.sys.config into recaptcha_key param.

Next step - http://dadata.ru/ (data quality as a service). If you don't need its suggestions, just remove it code from https://github.com/mkrentovskiy/wa/blob/master/priv/www/index.html#L143-L147 and https://github.com/mkrentovskiy/wa/blob/master/priv/www/js/app.js#L30-L40. Otherwise you must get your own personal API key from it site. Don't be a jerk using my one. :) Key must be writen to https://github.com/mkrentovskiy/wa/blob/master/priv/www/index.html#L147.

Now main external API is done. Lets go for OAuth providers.

Almost done? Yep.

make run-local
1> persist:init_db(pgdb).

Now you can try to open http://localhost:8080 in your browser. Must work.

About

Typical ERP (Erlang, Redis, PostgreSQL) web application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •