Skip to content

Latest commit

 

History

History
executable file
·
96 lines (70 loc) · 2.36 KB

README.md

File metadata and controls

executable file
·
96 lines (70 loc) · 2.36 KB

The-toolbox

Features

  • Hours counting (calendar style).
  • Project management (Linking documents, following time left, members, task affectation, ...).
  • Fully responsive, progressive app.

Structure

The repository uses npm & bash for automation.

The folders & files :

  • client : Frontend code (Angular 2+).
  • deployments : Deploy scripts examples, Docker images & workbench schema.
  • requirements : The requirements of the App (Python pip). Two files : dev and prod.
  • tasks : Automated bash tasks.
  • config.py : App configuration. Only a dummy example.
  • notification_config.py : Configuraton for email notifications.
  • main.py : Entry point of the Python API.

Setup the dev environment

To setup the project, you need the angular cli, Python 2, pip, and virtualenv.

Server

virtualenv -p python2 venv
source venv/bin/activate
pip2 install -r requirements/dev.txt

Client

cd client
npm install

The database

This application uses MySQL. To develop localy, install docker and a Mysql image.

# Install docker
sudo apt-get install docker
# Pull the image
sudo docker pull mysql
# Start the local server
sudo docker run --name hours-count -p 3306:3306 -e MYSQL_ROOT_PASSWORD=localroot1234 -d mysql
# Install MySql Client
sudo apt-get install mysql-client
# Connect to DB
mysql -h 127.0.0.1 -u root -p

If you change the login and / or the passowrd, don't forget to update it in the config.py file.

Start

From the root of the project :

Start the CLI dev server.

cd client
npm run watch

In another terminal :

source venv/bin/activate
python2 main.py

MySQL database provisionning

The repo contains an ansible script to create the MySQL database starting from a Ubuntu 17.04.

The command to start the script is :

ansible-playbook ansible/mysql-setup.yaml -i '<machine-ip>,' --extra-vars "mysql_toolbox_password=<password>"

Build

The repo supplies a build.sh files in the tasks folder to generate a final folder with only the necessary dependencies.

Usage :

./tasks/build.sh user_api_login user_api_password user_api_secret user_api_host db_api_login db_api_password db_api_host