Giter Club home page Giter Club logo

kamu's Introduction

Kamu

"Some books leave us free and some books make us free." โ€“ Ralph Waldo Emerson

Build Status Test Coverage Maintainability Open Source Helpers

Join the Matrix.org contributors chat at https://matrix.to/#/#kamu:matrix.org

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

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:

  make docker-build

If you're not planning to use a heroku like build or touch docker files, you can also pull from Dockerhub:

  make docker-pull

Create database tables:

  make docker-migrate

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

  make docker-createsuperuser

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

Seed the database with initial dump data:

  make docker-loaddata

Start your local server:

  make docker-dev

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

For simulating a Heroku like environment (recommended to make build first):

  make docker-heroku

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

Stop your environment:

  make docker-down

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="core.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!

kamu's People

Contributors

ayr-ton avatar macecchi avatar mergify[bot] avatar dependabot[bot] avatar lucashanke avatar ritamoraes avatar edersonbadeca avatar rodbv avatar flavia-by-flavia avatar bitsapien avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.