A simple project for managing people's contact details using Vue.js (vue-cli 3.0
scaffold), Django (REST API), PostgreSQL, Docker, nginx-proxy
, TDD/BDD testing tools (chai
, mocha
, mamba
, expects
), a few things from 12-factor (such as .env
configuration files). For a full list, see Built with.
This project uses Docker to make initial setup easy for development, deployment, and testing purposes. See deployment for notes on how to deploy the project on a live system.
If you don't have docker
and docker-compose
installed, get it (available for Linux/OS X/Windows).
To build and run basic development environment, run
$ docker-compose up
Press ctrl+c
to stop containers. Another way to do it is
$ docker-compose down
If you need to rebuild containers, use
$ docker-compose up --build
Next thing you need is /etc/hosts
and .env.example
. Copy .env.example
to .env
$ cp .env.example .env
Then add FRONTEND_HOST
and BACKEND_HOST
values (from .env
file) to your /etc/hosts
file, example
127.0.0.1 localhost contacts.local api.contacts.local
Please note, in case you are using Docker toolbox it would run under Vagrant VM, so you have to find IP of your docker machine:
$ docker-machine ip dev
192.168.99.104
In that case you have to add a different record to the /etc/hosts
192.168.99.104 contacts.local api.contacts.local
If you did everything right up to this point, you should now be able to access http://contacts.local and http://api.contacts.local
To run backend development environment with unit/integration tests (reload on file changes), execute
$ docker-compose -f docker-compose.yml -f docker-compose.test-backend.yml run backend-test
To run frontend development environment with unit/integration tests (reload on file changes), execute
$ docker-compose -f docker-compose.yml -f docker-compose.test-frontend.yml run frontend-test
Make sure there is an output from them by changing files inside ./backend/spec
or ./frontend/tests
. Otherwise, there could be a problem. Feel free to open any issues.
.. To-do ..
- alpinelinux - A security-oriented, lightweight Linux distribution.
- axios - Promise based HTTP client for the browser and
node
. - chai - TDD/BDD assertion library for
node
. - django - Backend framework.
- djangorestframework - Django REST framework.
- docker-alpine - A super small Docker image based on Alpine Linux.
- docker - Containerization.
- expects - TDD/BDD assertion library for Python.
- factory-girl - A factory library for Node.js and the browser.
- factory_boy - A test fixtures replacement for Python.
- faker.js - Generate massive amounts of fake data in the browser and
node
. - faker - A Python package that generates fake data.
- gunicorn - Python WSGI HTTP server.
- mamba - BDD-style test runner for Python.
- mocha - Javascript test framework for
node
& the browser. - moxios - Mock
axios
requests for testing. - nginx-proxy - Automated
nginx
proxy for Docker containers. - nginx - HTTP and reverse proxy server.
- postgres - PostgreSQL DBMS.
- vue.js - The frontend library used.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Thanks to fago for his awesome
inotifywait
script. It just works. - Database diagrams created with QuickDBD
- BPMN diagram created with BPMN Viewer and Editor