Code Monkey home page Code Monkey logo

vibelink's Introduction

VibeLink

VibeLink - Share links to music with your friends once a day.

Setup

Environment variables

Create a env directory with following dotenv files:

env/backend.env

DJANGO_SETTINGS_MODULE=core.settings.base
DEBUG=True
SECRET_KEY=randomsecretkey
ALLOWED_HOSTS=backend,localhost,127.0.0.1,host.docker.internal,*
SIMPLE_JWT_ISSUER=vibelink
FRONTEND_SITE_NAME=VibeLink

DB_ENGINE=django.db.backends.postgresql
DB_NAME=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=postgres_db
DB_PORT=5432

REDIS_HOST=redis_db
REDIS_PORT=6379

USE_SMTP=True
EMAIL_HOST=...
EMAIL_PORT=...
EMAIL_HOST_USER=...
EMAIL_HOST_PASSWORD=...
EMAIL_USE_TLS=True

# Spotify API keys
# https://developer.spotify.com/dashboard
SPOTIPY_CLIENT_ID=...
SPOTIFT_CLIENT_SECRET=...

# Google API key
# https://console.cloud.google.com/apis/credentials
GOOGLE_CLOUD_API_KEY=...

env/postgres.env

POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres

env/redis.env

TZ=Europe/Warsaw

Virtual environment

Create a virtual environment in the current directory and install dependencies:

mkdir .venv

pipenv shell

pipenv install

Set your Python interpreter to the one in the virtual environment.

Docker

Make sure Docker Engine is running.

While in root directory, build docker images and run them with docker-compose. This might take some time depending on your internet speed. Rebuilding image is crucial after installing new packages via pip.

docker compose build

To start containers run:

docker compose up

To stop containers run:

docker compose down

To run commands in an active container:

docker compose exec -it CONTAINER_NAME COMMAND

Django commands to run

Prepare migrations (if there are any changes to db schema):

docker exec -it vibe-link-backend python manage.py makemigrations

Apply migrations:

docker exec -it vibe-link-backend python manage.py migrate

Create superuser:

docker exec -it vibe-link-backend python manage.py createsuperuser

To run an interactive python shell:

docker exec -it vibe-link-backend python manage.py shell_plus

To run unit tests:

docker exec -it vibe-link-backend coverage run manage.py test

To get coverage report from unit tests run:

docker exec -it vibe-link-backend coverage report -m

vibelink's People

Contributors

alschn avatar

Watchers

 avatar  avatar

Forkers

anhtudotinfo

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.