Skip to content
You favorite book library
JavaScript Python CSS HTML Shell Makefile Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Move settings files to their own directory and create test settings Mar 12, 2019
.github Move PR template to .github Jan 3, 2019
.profile.d Added environment variables to Heroku Apr 6, 2017
assets remove unecessary prop Oct 30, 2019
books 🎨 move waitlist logic into its own class Oct 30, 2019
ci Added execute permission to script Oct 8, 2018
config add tests related to theme toggling on header Aug 24, 2019
dump_data
kamu Add ability for disabling SSL enforcement for prod like deployments Nov 2, 2019
public
screen shots Update first page screenshot for fixing Docker Hub description Nov 1, 2019
waitlist 🎨 fix linting issues Oct 30, 2019
.babelrc 🎨 change tests for App to use findByTestID new method Aug 25, 2019
.buildpacks Updating buildpacks Apr 6, 2017
.codeclimate.yml ignore jsx test files in code climate Mar 11, 2019
.coveragerc omit venv folder from test coverage Mar 18, 2019
.dockerignore Add volumes and prod like database to docker Nov 1, 2019
.eslintignore Revert "Functional tests" Aug 16, 2017
.eslintrc
.gitignore Add code coverage support to nodejs Jan 4, 2019
.hawkeyeignore More flexibility to the security check step Jan 14, 2018
.hawkeyerc More flexibility to the security check step Jan 14, 2018
.nvmrc
.profile Precompiling assets before the boot command Jan 14, 2018
Dockerfile Add development docker Nov 1, 2019
LICENSE Added MIT license May 18, 2017
Makefile Move settings files to their own directory and create test settings Mar 12, 2019
Procfile Change Docker base image to herokuish Oct 25, 2019
README.md
app.json Add deployment steps Jan 4, 2019
dev-server.js Update some hot module replacement configs Feb 16, 2019
docker-compose.dev.yml
docker-compose.yml Fix loop of redirects in docker-compose Nov 2, 2019
manage.py Move settings files to their own directory and create test settings Mar 12, 2019
package-lock.json Update react-testing-library to latest version Sep 1, 2019
package.json Update react-testing-library to latest version Sep 1, 2019
requirements.txt Refactor environment variables usage Nov 1, 2019
runtime.txt Upgrade Python runtime to 3.7.5 Nov 1, 2019
setup.cfg Change pep8 line width to 100 instead of default 79 Mar 18, 2019
webpack-stats-test.json Move settings files to their own directory and create test settings Mar 12, 2019
webpack.config.js fix linting issues Mar 3, 2019

README.md

Kamu

"Some books leave us free and some books make us free." – Ralph Waldo Emerson

Build Status Test Coverage Maintainability

Join the Telegram contributors chat at https://t.me/joinchat/AfhaV0XSlMTeaWgWcqALcQ

Kamu is an application that focus on managing a physical library where you can add books, borrow and return them.

In the main page you can see the libraries shared between users. The libraries can be different unities, cities or name of friends that wants to share books. In the Screenshoot bellow, you can see an example of multiple libraries.

Screenshoot for Kamu's multiple libraries

Requirements

  • Python 3.6+ for Django backend
  • Node.js 8+ for frontend assets

Installation / Getting started

Here is a quick step-by-step minimal setup, to get the app up and running in your local workstation:

MacOS specific

To install Node.js and npm you can either download it from the node.js homepage or install it using homebrew:

brew install node

Platform independent

Create Python virtual enviroment:

python3 -m venv venv

Activate virtual enviroment (this command can change based on OS):

source venv/bin/activate

Install backend dependencies using pip:

pip install -r requirements.txt

Install frontend dependencies using npm:

npm install

Create database tables:

python manage.py migrate

Create a super user:

python manage.py createsuperuser

You will use this super user to login as administrator in your local Kamu application.

Seed the database with initial dump data:

python manage.py loaddata dump_data/*.json

Start your local server:

npm start

Now just go to http://localhost:8000 in your browser :)

For local setup with Okta authentication: Use the OKTA_METADATA_URL environment variable, concatenating it with the usual commands. Examples:

  OKTA_METADATA_URL='url-of-okta-saml' npm start
  OKTA_METADATA_URL='url-of-okta-saml' python manage.py migrate

Another way is to export the var and then execute the commands:

  export OKTA_METADATA_URL='url-of-okta-saml'
  npm start
  python manage.py migrate

If you wish to disable Okta authentication again, execute:

  unset OKTA_METADATA_URL

Executing using Docker for local development

Remember to create a .env file with all the environment variables you need for spining up the environment.

For building the image:

  docker-compose build

Create database tables:

  docker-compose run --rm web python manage.py migrate

Create a super user (for non Okta based usage):

  docker-compose run --rm web python manage.py createsuperuser

You will use this super user to login as administrator in your local Kamu application.

Seed the database with initial dump data:

  docker-compose run --rm web python manage.py loaddata dump_data/*.json

Start your local server:

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

Now just go to http://localhost:8000 in your browser :)

For simulating a Heroku like environment:

  docker-compose up -d web

Access your local Heroku in the same link http://localhost:8000

Deployment

We have out of the box support for Heroku 🐉, Dokku 🐳 and Docker 🐳.

For deployment, create a new Python app and set the remote origin from Dokku or Heroku, push it and enable the Postgres plugin.

The buildpacks should configure all the necessary libraries for you.

Now, we need the following environment variables before running Kamu for the first time:

SECRET_KEY="django-secret-key" # https://duckduckgo.com/?q=django+secret+key+generator
DEBUG=true # Or false, depending if is a testing or production app
DJANGO_SETTINGS_MODULE="kamu.settings.prod" # If you plan to run a testing version
DATABASE_URL=postgres://dbhost/dbname # This variable should be automatically configured by the postgres extension.
ALLOWED_HOSTS="kamu.example.com, kamu.heroku.etc"
OKTA_METADATA_URL="SECRET-OKTA-STUFF" # On the case of Okta Authentication support
ANALYTICS_ACCOUNT_ID="UA-123456789-1" # Only if you want to enable Google Analytics, otherwise don't set it
SENTRY_DSN="SECRET-SENTRY-DSN" # Only if you want to enable Sentry, otherwise don't set it
SSL=false # Enabled by default in production like deployments

See Dokku environment variables or Heroku Config Vars for more details.

On non Okta based deployments, you should run either dokku run kamu /bin/bash or heroku run /bin/bash -a kamu (On this case, kamu is app name)

python manage.py createsuperuser

See #74

Thanks!

You can’t perform that action at this time.