Building logistics infrastructure for the internet -- starting with bookable assets.
This is our monolithic backend repo, in Django.
-
Clone the source
git clone [email protected]:ajroberts0417/qrono.git -
Navigate into the project directory
cd qrono -
Install dependencies (if you don't have pipenv and python installed, go to Installing Python)
pipenv install -
Enter the pipenv virtual environment
pipenv shell -
Copy the
.env.examplefile into a new.envfile. -
Run the server:
python manage.py runserver
Boom! It's that easy -- you're now running Qrono locally.
- 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"
- 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
- 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.
- A version of python 3.9 installed and added to your PATH (for help: install python 3)
- A version of pipenv installed
- Postgresql
Run this in your terminal:
brew install postgresql
brew services start postgresqlPostgres should start automatically. If you run into trouble, refer to this guide.
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:
- Install pyenv (see pyenv installer)
curl https://pyenv.run | bash
1b. Restart your shell so the changes take effect:
exec $SHELL
-
Install the latest version of python 3.9 using pyenv
pyenv install 3.9.2 -
Use this version locally in your qrono project (Note: make sure you're in the
qronodirectory!)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
- Install the latest version of pipenv:
pip install pipenv
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-devIf 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