Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bortoz committed Sep 28, 2024
1 parent c552530 commit 4e81231
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ The frontend is written with Next.js and at build time it reads all the JSON fil

1. Clone this repository

```
```bash
$ git clone https://github.com/algorithm-ninja/oii-stats.git
```

2. Enter the `frontend/` directory

```
```bash
$ cd frontend
```

3. Start the dev Next.js server

```
```bash
$ yarn dev
```

Expand All @@ -40,28 +40,27 @@ $ yarn dev

2. Enter the `utils/make_db` directory

3. Login to gcloud with

```
gcloud auth application-default login --scopes=openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets
gcloud auth application-default set-quota-project A_GCP_PROJECT_ID
```bash
$ cd utils/make_db
```

4. Generate the new database by running
3. Login to gcloud with

```bash
$ gcloud auth application-default login --scopes=openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets
$ gcloud auth application-default set-quota-project A_GCP_PROJECT_ID
```
$ ./run $SPREADSHEET_ID ../../data --drop
```

> If it's the first time you follow this guide you may need the `token.pickle` file. To obtain it add `--request-credentials` to the command above.

## Rebuilding the docker image locally
4. Create a virtual environment

After each push to `master` the CI will build the docker image.
The image is published at `ghcr.io/algorithm-ninja/oii-stats-frontend:$tag` where `$tag` is the [version of the application](https://github.com/algorithm-ninja/oii-stats/pkgs/container/oii-stats-frontend).
```bash
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
```

If you want to build the image locally you can use the following helper script:
5. Generate the new database by running

```
$ ./utils/docker_build.sh
```bash
$ ./run.py $SPREADSHEET_ID ../../data --drop
```
6 changes: 3 additions & 3 deletions utils/make_db/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-api-python-client==2.33.0
google-auth-oauthlib==0.4.6
numpy==1.24.3
google-api-python-client~=2.147.0
google-auth-oauthlib~=1.2.1
numpy~=2.1.1

0 comments on commit 4e81231

Please sign in to comment.