WayToHome is a web application for comfortable route tracking which allows setting up of notifications to get information about transport you want at desired time. The key features of the system are as follows:
- User can get optimal way from point A to point B.
- User can get an account which allows him to set up notifications.
- User has profile which contains google account photo, information about this user, his places, ways and active notifications;
- User can create places, ways and notifications;
- User can get notifications when he should go out to get on the transport;
- python - 3.7.1
- django - 2.1.4
- celery - 4.2.1
- redis - 3.0.6
- postgresql - 9.5.14
- nodejs - 10.15.0
- npm - 6.4.1
- reactjs - 16.6.3
# install
$ sudo apt-get install postgresql postgresql-contrib
# create user and database
$ sudo -i -u postgres
postgres=# CREATE USER <db_user> PASSWORD '<db_password>'";
postgres=# CREATE DATABASE <db_name> OWNER <db_user>;
postgres=# ALTER USER <db_user> CREATEDB;
# install
$ sudo apt-get install redis-server
# check connect with redis
$ redis-cli ping
PONG
# install
$ sudo apt-get install -y erlang
$ sudo apt-get install rabbitmq-server
# enable and start
$ systemctl enable rabbitmq-server
$ systemctl start rabbitmq-server
# check status
$ systemctl status rabbitmq-server
- Clone this repository.
- Create a new folder
easy_way_datain the project root directory. - Activate virtual environment.
- Go to the folder
requirements.txtand run command to install required dependencies:pip install -r requirements.txt - Create
localsettings.pyinway_to_home/way_to_home/with following settings:# Database settings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'HOST': 'localhost', 'USER': '<db_user>', 'PASSWORD': '<db_password>', 'NAME': '<db_name>', } } # Nexmo settings NEXMO_API_KEY = '<nexmo_api_key>' NEXMO_API_SECRET = '<nexmo_api_secret>' # SMTP settings EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = '<email_host_user>' EMAIL_HOST_PASSWORD = '<email_host_password>' EMAIL_PORT = 587 DEFAULT_FROM_EMAIL = '<default_from_email>' # JWT settings JWT_KEY = '<jwt_key>' JWT_ALGORITHM = 'HS384' # Celery settings CELERY_BROKER_URL = '<celery_broker_url>' # Telegram bot settings TELEGRAM_BOT_TOKEN = '<telegram_bot_token>' # Google settings CLIENT_ID = '<client_id>' CLIENT_SECRET = '<client_secret>' GOOGLE_API_KEY = '<google_api_key>'
- Go to the folder with
manage.pyfile and run migrate:python manage.py migrate
- Go to the folder with
package.jsonand run command:npm install - Create
settings.jsinway_to_home/static/srcwith following settings:// Required keys for Here App API export const HERE_APP_ID = '<here_app_api_id>'; export const HERE_APP_CODE = '<here_app_api_code>'; export const GOOGLE_MAP_API = '<google_map_api_key>'
-
Go to the project root folder and run watcher:
npm start -
Go to the folder
daemonsand run daemon:# daemon for preparing gtfs data from EasyWay python gtfs_daemon.py 11 # daemon for assigning celery tasks to prepare notifications python notifier_deamon.py -
Create file
way_to_home.login/var/log/directory, and add user permissions to that file.sudo touch /var/log/way_to_home.log sudo chown -R $USER:$USER /var/log/way_to_home.log -
Go to the folder with
manage.pyfile and run django server:python manage.py runserver -
Go to the django root folder run celery worker and beat:
celery -A way_to_home worker -l info celery -A way_to_home beat -l info -
Go to the folder
telegram_botand run telegram bot:python bot_handler.py
- To start up your Docker container
docker-compose up -d --build - To close down your Docker container
docker-compose down
- To see all available
makefilepossibilities run command in the project root folder:make help
- To start react server:
npm startserver - To build bundle.js:
npm build - To run watcher:
npm start
- To monitor redis changes:
redis-cli monitor - To purge messages from task queues run in django root folder:
celery -A way_to_home purge
-
- @PetrushynskyiOleksii
- @meelros
- @BoroviyOrest
- @Kardan1123
- @Sasha1152
- @dimigor
- @mizin4ik
- @vo333ua