Skip to content
/ books Public

A decentralized library for people who read paper books.

Notifications You must be signed in to change notification settings

rm66103/books

Repository files navigation

books

A decentralized library for people who read paper books.

Design

Terminology

Google Docs

User Journey Maps

Miro Board

Wireframes

figma prototype

figma project file

Running the app

python manage.py runserver

Updating sass files

This command monitors the scss folder for changes and compiles it to css.

python manage.py sass app/static/app/scss/ app/static/app/css/ --watch

Running the tests

python manage.py test

Initial configuration

I reccomend using pyenv virtualenv to manage your python version and environment. This project

learn more about pyenv virtualenv

Install python build requirements.

instructions Install the packages.

Install pyenv with homebrew

brew update
brew install pyenv

Add pyenv init to your shell to enable shims and autocompletion. Please make sure eval "$(pyenv init -)" is placed toward the end of the shell configuration file since it manipulates PATH during the initialization.

# zsh
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc

Restart your shell so the path changes take effect. You can now begin using pyenv.

exec "$SHELL"

Install Python versions into $(pyenv root)/versions. For example, to download and install Python 2.7.8, run:

pyenv install 3.8.0
Troubleshooting
Mac os System Version: macOS 11.2.3 (20D91) has experienced build problems with this version of Python. These instructions have been helpful.

Create you python environemnt with the correct version.

pyenv virtualenv 3.8.0 books

Activate your virtual environment.

pyenv activate books

Install the project requirements.

pip install -r requirements.txt

run the migrations

python manage.py migrate

Export GOOGLE_APPLICATION_CREDENTIALS for google cloud vision API.

In a bash console...

export GOOGLE_APPLICATION_CREDENTIALS="/PATH/TO/YOUR/PROJECT/google_credentials.json" 

SMS These environment variables are required to configure the SMS client for text message notifications.

TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=
TEST_PHONE=                         # Receives SMS during tests.

Ask Mav if you need them as they are currently associated with a personal account.

Environment Variables

ENV=development                     # production, development, TODO: staging
BASE_URL=http://127.0.0.1:8000      # You do not want a trailing slash
SECRET_KEY=                         # Get from mav
SMS_VERIFICATION=True               # Requires users to confirm SMS for their account
TEST_SMS=                           # Send SMS to TEST_PHONE during tests
DEBUG=                              # Always False for production

Common Patterns

SMS

from app.sms import SMS

# As a one off message
SMS.send('<TO_PHONE_NUMBER>', '<MESSAGE>')

# Extending the client for a particular app
class AccountSMS(SMS):
    @classmethod
    def send_book_return_reminder(cls, account):
        message = "This is my message for this text" 
        cls.send(account.phone_number, message)

account = Account.objects.get(email="jeffers@gmail.com")
AccountSMS.send_book_return_reminder(account)

Troubleshooting

Migrations

Screen Shot 2021-04-03 at 1.05.08 PM.pngimage

make sure your migrations are up to date.

python manage.py migrate

About

A decentralized library for people who read paper books.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published