Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Jun 19, 2024
1 parent 6dc508e commit d6f670c
Showing 1 changed file with 16 additions and 46 deletions.
62 changes: 16 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ Table of Contents:
- [Development](#development)
- [Environment variables](#environment-variables)
- [Python virtual environment](#python-virtual-environment)
- [Installing dependencies](#installing-dependencies)
- [Virtual environment sanity check](#virtual-environment-sanity-check)
- [Installing dependencies](#installing-dependencies)
- [Poe the Poet](#poe-the-poet)
- [Installing git hooks](#installing-git-hooks)
- [New Relic integration](#new-relic-integration)
- [Running the project](#running-the-project)
- [Running tests](#running-tests)
- [Docker](#docker)
- [App only](#app-only)
- [With Supabase](#with-supabase)
- [Interactive API docs](#interactive-api-docs)
- [Docker \[OPTIONAL\]](#docker-optional)
- [Contribution Guidelines](#contribution-guidelines)
- [Deployment](#deployment)

Expand All @@ -30,7 +27,7 @@ Table of Contents:
### What you'll need

- [VSCode](https://code.visualstudio.com/) / [Pycharm](https://www.jetbrains.com/pycharm/)
- [Python 3.12](https://www.python.org/) (Please check [`pyproject.toml`](./pyproject.toml) for the latest supported python version)
- [Python 3.12.3](https://www.python.org/) (Please check [`pyproject.toml`](./pyproject.toml) for the latest supported python version)
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) for dependency management
- [Docker Desktop](https://docs.docker.com/desktop/) [OPTIONAL]

Expand All @@ -39,16 +36,11 @@ Table of Contents:
### Environment variables

- In project root, create a copy of `.env.example` as `.env`.
- run `cp .env.example .env` for UNIX.
- run `copy .env.example .env` for Windows.

### Python virtual environment

#### Installing dependencies

```sh
poetry config virtualenvs.in-project true # OPTIONAL
poetry install --sync --no-root --with dev,lint,test
```

**Note**: Ensure that the python interpreter in your IDE is set to the newly created virtual environment by poetry. If you have not modified poetry configuration, you can find the virtual environment location as stated [here](https://python-poetry.org/docs/configuration/#cache-directory).

#### Virtual environment sanity check
Expand All @@ -60,10 +52,15 @@ poetry install --sync --no-root --with dev,lint,test
- Run `poetry shell` <u> ***OR*** </u>
- Execute the `/Scripts/Activate` script from the virtual environment located [here](https://python-poetry.org/docs/configuration/#cache-directory).

#### Installing dependencies

```sh
poetry install --sync --no-root --with dev,lint,test
```

#### Poe the Poet

https://github.com/nat-n/poethepoet
A task runner that works well with poetry. https://github.com/nat-n/poethepoet.

1. Check available tasks:
```sh
Expand Down Expand Up @@ -92,20 +89,15 @@ poetry run poe git-hooks-setup
### Running the project

- Open up a terminal in your IDE.
- If you're not in the python virtual environment, run `poetry shell` to activate it.
- Run `python run.py` to start the server.
- Open your browser at [`http://localhost:8081`](http://localhost:8081).
### Running tests

```sh
poetry run poe tests
```

### Docker
### Interactive API docs
In `/docker`, create a copy of `.env.example` as `.env`.
- Once the server is running, open your browser at [`http://localhost:8081/docs`](http://localhost:8081/docs).
#### App only
### Docker [OPTIONAL]
- Build image
```sh
Expand All @@ -117,26 +109,8 @@ In `/docker`, create a copy of `.env.example` as `.env`.
```
- Open your browser at [`http://localhost:8081`](http://localhost:8081).
#### With Supabase

- Bring up the services
```sh
cd docker
docker compose --file compose.dev.yaml up --detach
```
- Open your browser at
- [`http://localhost:8081`](http://localhost:8081) for app
- [`http://localhost:8000`](http://localhost:8000) for supabase dashboard
- Username: `supabase`
- Password: `this_password_is_insecure_and_should_be_updated`

For other docker commands, see [useful_commands.md](./useful_commands.md).
### Interactive API docs

- Once the server is running, open your browser at [`http://localhost/docs`](http://localhost/docs).
- Alternate docs can be found at [`http://localhost/redoc`](http://localhost/redoc), provided by [redoc](https://github.com/Redocly/redoc).

### Contribution Guidelines
- <u> ***NEVER MERGE YOUR OWN CODE; ALWAYS RAISE A PR AGAINST `main`!*** </u>
Expand Down Expand Up @@ -169,8 +143,4 @@ For other docker commands, see [useful_commands.md](./useful_commands.md).
## Deployment
We currently have a test deployment in linode. The deployment is done manually.

We're using pm2, a process manager for Node.js applications, to run the application. The configuration for pm2 can be found in the `process.config.js` file.
For pm2 commands, see [useful_commands.md](./useful_commands.md).
App is deployed via Heroku.

0 comments on commit d6f670c

Please sign in to comment.