Skip to content

yaseralnajjar/debtor-administrator

Repository files navigation

Debtor Administration

A simple app manage (CRUD) debtors, their bank account data (IBAN) and invoices.

Existing Models and APIs

The models.txt file and the api.txt file contains all the models and the APIs that we have in the app, respectively.

Both of the models and the APIs are built upon the wireframe file

Setup

yarn install
virtualenv venv
call venv\Scripts\activate
pip install -r requirements_dev.txt
python manage.py migrate

Running Development Servers

python manage.py runserver

From another tab in the same directory:

yarn serve
  • Before running yarn serve, you will need to write .env file with GOOGLE_OAUTH_CLIENT_ID and run yarn build to bake in your Google client id for development.

The Vuejs application will be served from localhost:8080 and the Django Api and static files will be served from localhost:8000.

Docker Support

To run the app using Docker just add 127.0.0.1 debtor.admin into your hosts file (in system32/drivers/etc folder).

After that, add your .env file similar to sample.env file

Then you're ready to launch your development containers:

docker-compose -f docker-compose-dev.yml up -d

For staging containers:

docker-compose -f docker-compose.yml -f docker-compose-staging.yml up -d

You will find the app on http://debtor.admin

Deploy on Your Own Server

For full guide about deployment and management in your own server, please refer to this guide from Dorm Portal project (which has very similar setup to this one).

Deploy on Heroku

You can use the "one-click deploy" button below to try it out on Heroku, but you would still to do the following:

  1. Add admin user

Simply by running these commands, you will get an admin account with "admin" password.

DONT FORGET TO CHANGE PASSWORD LATER

heroku git-remote -a YOUR_APP_NAME
heroku run python manage.py shell
from django.contrib.auth.models import User
User.objects.create_superuser('admin', 'admin@example.com', 'admin')
  1. Adding Social App

You need to add your Google OAuth credentials to the app through the Django admin.

  1. ENJOY!
Heroku One Click Deploy

Deploy