Skip to content

Qrono-Labs/readme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Qrono

Building logistics infrastructure for the internet -- starting with bookable assets.

This is our monolithic backend repo, in Django.

Quickstart

  1. Clone the source git clone [email protected]:ajroberts0417/qrono.git

  2. Navigate into the project directory cd qrono

  3. Install dependencies (if you don't have pipenv and python installed, go to Installing Python) pipenv install

  4. Enter the pipenv virtual environment pipenv shell

  5. Copy the .env.example file into a new .env file.

  6. Run the server: python manage.py runserver

Boom! It's that easy -- you're now running Qrono locally.

Authentication

  • In order to hit some API endpoints, you must be authenticated.
  • To authenticate, create an API key AND add a user that's connected to the same account and classified as an "api robot"

Deployment

  • Our backend is deployed via Heroku
  • We use Netlify for our DNS
  • Qrono.dev is registered via Namecheap
  • Get the login credentials for accounts from 1Password

Contributing Code

  • New commits should always be proposed in a Pull Request
  • Every Pull Request requires at least one approval before merging
  • Each Pull Request should be merged by the author after approval and CI checks
  • Python code should follow PEP 8 as closely as possible
  • JavaScript code should be written as TypeScript
  • Pull requests should clearly describe changes in dependencies
  • See styleguide_example.py for an opinionated example on how to document and type python code

We use Black for code formatting. Before submitting code run: pipenv run black . to autoformat your code.

Dependencies

Installing Postgres using Homebrew (for MacOS)

Run this in your terminal:

brew install postgresql
brew services start postgresql

Postgres should start automatically. If you run into trouble, refer to this guide.

Installing Python

Managing python environments can be tricky, even for experienced developers. One easy tool to do so is pyenv. Here's how you can use a python 3.9 environment in your qrono directory:

  1. Install pyenv (see pyenv installer) curl https://pyenv.run | bash

1b. Restart your shell so the changes take effect: exec $SHELL

  1. Install the latest version of python 3.9 using pyenv pyenv install 3.9.2

  2. Use this version locally in your qrono project (Note: make sure you're in the qrono directory!) pyenv local 3.9.2

3b. Alternatively, if you want 3.9.2 to be your global version of python: pyenv global 3.9.2

  1. Install the latest version of pipenv: pip install pipenv

Troubleshooting Python Installs

OpenSSL

Openssl is a dependency for psycopg2, and the installation might fail if the linked library isn't the right version. If this command fails with clang error 1—and you are on macOS—ensure Xcode is installed with xcode-select --install and ensure openssl is linked by running:

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" make install-dev

If this command fails with clang error 1 and error: architecture not supported, add the ARCHFLAGS option as well:

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" ARCHFLAGS="-arch i386 -arch x86_64" make install-dev

About

For our readme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published