You can find the development documentation on the website.
Check out the Postman docs, Swagger or Redoc.
The documentation is divided into several sections:
- No Installation (with gitpod)
- Installation inside Docker (easier)
- Installation in your local machine (a bit harder but more performant)
Creating a workspace is as easy as prefixing any GitHub URL with gitpod.io/#
.
Gitpod provide the extension for:
For convenience, Gitpod developed a Gitpod browser extension. It adds a button to GitHub, GitLab or Bitbucket that does the prefixing for you - as simple as that.
For mac and pc users install docker desktop, else, for linux find a guide to install Docker and Docker Compose in your linux distribution uname -a
.
# Check which dependencies you need install in you operating system
python -m scripts.doctor
# Generate the BreatheCode Dev docker image
docker-compose build bc-dev
# Open the BreatheCode Dev, this shell don't export the port 8000
docker-compose run bc-dev fish
# Testing
pipenv run test ./breathecode/activity # path
# Testing in parallel
pipenv run ptest ./breathecode/activity # path
# Coverage
pipenv run cov breathecode.activity # python module path
# Coverage in parallel
pipenv run pcov breathecode.activity # python module path
# open BreatheCode API as a service and export the port 8000
docker-compose up -d bc-dev
# open the BreatheCode Dev, this shell don't export the port 8000
docker-compose run bc-dev fish
# create super user
pipenv run python manage.py createsuperuser
# Close the BreatheCode Dev
exit
# See the output of Django
docker-compose logs -f bc-dev
# open localhost:8000 to view the api
# open localhost:8000/admin to view the admin
Install docker desktop in your Windows, else find a guide to install Docker and Docker Compose in your linux distribution uname -a
.
# Check which dependencies you need install in your operating system
python -m scripts.doctor
# Setting up the redis and postgres database, you also can install manually in your local machine this databases
docker-compose up -d redis postgres
# Install and setting up your development environment (this command replace your .env file)
python -m scripts.install
# Testing
pipenv run test ./breathecode/activity # path
# Testing in parallel
pipenv run ptest ./breathecode/activity # path
# Coverage
pipenv run cov breathecode.activity # python module path
# Coverage in parallel
pipenv run pcov breathecode.activity # python module path
# Collect statics
pipenv run python manage.py collectstatic --noinput
# Run migrations
pipenv run python manage.py migrate
# Load fixtures (populate the database)
pipenv run python manage.py loaddata breathecode/*/fixtures/dev_*.json
# Create super user
pipenv run python manage.py createsuperuser
# Run server
pipenv run start
# open localhost:8000 to view the api
# open localhost:8000/admin to view the admin