Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint commits

on: [pull_request]

jobs:
lint:
name: Commit Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: toggle-corp/commit-lint@main
3 changes: 3 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on:
pull_request:
push:
branches:
- "main"

jobs:
pre_commit_checks:
Expand Down
6 changes: 6 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
https://slack.com/shortcuts/Ft09CHNNHZNX/8d0d6f7d69a1350a91b2ef33fc6d5704
https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword
https://www.mdpi.com/2072-4292/8/10/859

# 404
https:\/\/backend-(\d+)\.mapswipe\.dev\.togglecorp\.com
https://backend-stage.mapswipe.org
https://backend.mapswipe.org
4 changes: 2 additions & 2 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
### Old Architecture
<figure>
<IMG
src="/assets/images/overview/old_architecture.png"
src="/assets/docs/overview/images/old_architecture.png"
alt="Prev arch"/>
<figcaption>Previous MapSwipe Architectural Flow</figcaption>
</figure>
Expand All @@ -31,7 +31,7 @@ Furthermore, A background worker periodically synchronized (partially) the 2 dat
### New Architecture
<figure>
<IMG
src="/assets/images/overview/new_architecture.png"
src="/assets/docs/overview/images/new_architecture.png"
alt="New architecture"/>
<figcaption>New MapSwipe Architectural Flow</figcaption>
</figure>
Expand Down
1 change: 1 addition & 0 deletions examples/mapswipe-backend-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
87 changes: 87 additions & 0 deletions examples/mapswipe-backend-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## Background

This script is provided as an example for interacting with the MapSwipe backend.

> [!CAUTION]
> Ongoing updates to the backend might render this script **out-of-date**.

## Getting started

> [!NOTE]
> You will need Manager account credentials to run this script.

- Create `.env` file.
- Define the following variables:
- `MANAGER_URL`: URL for Manager Dashboard
- `BACKEND_URL`: URL for Backend
- `CSRFTOKEN_KEY`: CSRF Token Key
- `ENABLE_AUTHENTICATION`
- `FB_AUTH_URL`: Authentication URL
- `FB_USERNAME`: Manager account username
- `FB_PASSWORD`: Manager account password
- For `FB_AUTH_URL`,
- Sign-in on the Manager Dashboard and open Dev Console.
- Look for the URL which starts with https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword
<img width="1305" height="228" alt="image" src="https://github.com/user-attachments/assets/332e6673-f0e3-48c4-8420-13ef5d648f21" />

### Alpha Instance

> [!CAUTION]
> The alpha instance is running inside Togglecorp's domain for internal testing.

Your final `.env` for alpha instance should look like this:

```dotenv
MANAGER_URL=https://manager-2.mapswipe.dev.togglecorp.com
BACKEND_URL=https://backend-2.mapswipe.dev.togglecorp.com
CSRFTOKEN_KEY=MAPSWIPE-ALPHA-2-CSRFTOKEN

ENABLE_AUTHENTICATION=true
FB_AUTH_URL=https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Your web-app login credential
FB_USERNAME=me@example.com
FB_PASSWORD=my-very-good-password
```

### Staging Instance

Your final `.env` for staging instance should look like this:

```dotenv
MANAGER_URL=https://managers-stage.mapswipe.org
BACKEND_URL=https://backend-stage.mapswipe.org
CSRFTOKEN_KEY=MAPSWIPE-STAGE-CSRFTOKEN

ENABLE_AUTHENTICATION=true
FB_AUTH_URL=https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Your web-app login credential
FB_USERNAME=me@example.com
FB_PASSWORD=my-very-good-password
```

### Production Instance

Your final `.env` for production instance should look like this:

```dotenv
MANAGER_URL=https://managers.mapswipe.org
BACKEND_URL=https://backend.mapswipe.org
CSRFTOKEN_KEY=MAPSWIPE-PROD-CSRFTOKEN

ENABLE_AUTHENTICATION=false
FB_AUTH_URL=https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Your web-app login credential
FB_USERNAME=me@example.com
FB_PASSWORD=my-very-good-password
```

## Running the script

Run the example script using uv

```bash
uv run run.py
```

> [!NOTE]
> To install uv, visit https://docs.astral.sh/uv/getting-started/installation/
Loading