Skip to content
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
48d31ad
Switch from Yarn to npm
jake-low Jan 13, 2026
b96f262
Make .tool-versions use Node 22 (matches production Dockerfile)
jake-low Jan 13, 2026
d7e6da3
Switch from Flow to TypeScript
jake-low Jan 13, 2026
374b9dc
Switch from react-scripts to Vite
jake-low Jan 14, 2026
c863136
Remove enzyme
jake-low Jan 14, 2026
4bcd4f0
Switch from Jest to Vitest
jake-low Jan 14, 2026
d96cab6
Fix broken tests
jake-low Jan 14, 2026
74db0fa
Remove unused and unnecessary dependencies
jake-low Jan 14, 2026
ec66a1d
Add type: module to package.json
jake-low Jan 14, 2026
c5afa2a
Switch from ESLint to Biome
jake-low Jan 14, 2026
0a003b5
Fix Biome lint errors
jake-low Jan 14, 2026
d3fc194
Upgrade to React 18
jake-low Jan 14, 2026
fb14bd2
Migrate from redux + immutable.js to tanstack query + zustand
jake-low Jan 14, 2026
793d76d
Remove dead code
jake-low Jan 16, 2026
bc2cb24
Simplify vite code splitting config
jake-low Jan 16, 2026
3adf8fd
Remove lint-staged
jake-low Jan 16, 2026
841c48a
Support runtime configuration
jake-low Jan 16, 2026
b160e44
Fix some type errors and formatting
jake-low Jan 16, 2026
902d63e
Remove dead toastr.min.css file
jake-low Jan 16, 2026
ba6756c
Organize package.json
jake-low Jan 16, 2026
38ee9a1
Tweak Biome config
jake-low Jan 16, 2026
3176e20
Replace react-anchorify-text (unmaintained) with linkify-react
jake-low Jan 16, 2026
496b874
Make TypeScript annotations more idiomatic
jake-low Jan 16, 2026
458d953
Replace showdown with react-markdown; convert /about page to redirect
jake-low Jan 19, 2026
5ca7d17
Dismiss element info panel when switching changesets
jake-low Jan 19, 2026
54ad450
Refactor network layer to simplify auth and error handling
jake-low Jan 20, 2026
3461035
Remove unused (blank) stats page
jake-low Jan 21, 2026
dace4f1
Unify AppDesktop and AppMobile components
jake-low Jan 21, 2026
6e26f61
Port remaining JS files to TypeScript
jake-low Jan 21, 2026
5241736
Clean up utils
jake-low Jan 21, 2026
4896767
Upgrade to react-router v7
jake-low Jan 21, 2026
ab6c937
Refactor dropdown component; remove react-click-outside dependency
jake-low Jan 21, 2026
1d863bf
Upgrade diff to v8
jake-low Jan 21, 2026
a85dd23
Re-enable some linter checks (and fix existing violations)
jake-low Feb 4, 2026
7ee4449
Rename configuration env vars to all start with OSMCHA_
jake-low Feb 5, 2026
6bca629
Move toast position to top-left
jake-low Feb 5, 2026
8523475
Remove some unused CSS classes left over from changeset-map
jake-low Feb 5, 2026
dc41715
Remove dead code from app.tsx
jake-low Feb 5, 2026
691016e
Remove unused props from changeset/box.tsx
jake-low Feb 5, 2026
73a02e0
Improve type annotations for some components
jake-low Feb 5, 2026
2197ba6
Use file extensions in import paths
jake-low Feb 5, 2026
e475a04
Update README
jake-low Feb 6, 2026
c5f9374
Add GitHub Actions CI workflow (checks tsc, linting, test suite on PRs)
jake-low Feb 10, 2026
3616ebc
Remove legacy OAuth 1.0 code and safe_storage.ts (IE <8 compatibility)
jake-low Feb 11, 2026
9bae540
Fix navigation bug affecting 'My Reviews' link in nav menu
jake-low Feb 11, 2026
5858412
Fix tests failing in CI due to dependency on system timezone
jake-low Feb 11, 2026
bf052d4
Restrict GH token permissions for CI workflow
jake-low Feb 11, 2026
fa32975
Prevent trying to fetch changeset list when not logged in
jake-low Feb 19, 2026
2328ae0
Update README now that OAuth login works on localhost
jake-low Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# These values can be overridden at build time using an .env.local file, or at
# run time when using Docker, by setting environment variables on the container.

# API URL for OSMCha backend
OSMCHA_API_URL=https://osmcha.org/api/v1

OSMCHA_OSM_URL=https://www.openstreetmap.org
OSMCHA_OSM_API=https://api.openstreetmap.org/api/0.6

OSMCHA_ADIFF_SERVICE_URL=https://adiffs.osmcha.org
OSMCHA_OVERPASS_BASE=https://overpass-api.de/api/interpreter
OSMCHA_NOMINATIM_URL=https://nominatim.openstreetmap.org/search.php

OSMCHA_PAGE_SIZE=25

# default filter "from" (in days) and "to" (in minutes)
OSMCHA_DEFAULT_FROM_DATE=2
OSMCHA_DEFAULT_TO_DATE=5
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions .flowconfig

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
checks:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm clean-install

- run: npm run typecheck

- run: npx biome format .

- run: npm run lint

- run: npm test
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@

# misc
.DS_Store
.env
.env.*
.env.local
.env.*.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
public/env.json

# Vite
dist/
*.local
.env.local
.env.*.local
3 changes: 1 addition & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
nodejs 18
yarn 1.22
nodejs 22
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
FROM node:22-alpine as builder

ENV DEBIAN_FRONTEND noninteractive

ARG BUILD_ENV=prod

WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn set version stable
RUN yarn install

COPY src/ /app/src
COPY public/ /app/public
ENV REACT_APP_PRODUCTION_API_URL /api/v1
RUN apk update && apk add curl git jq

# fix for openssl ERR_OSSL_EVP_UNSUPPORTED
# 'error:03000086:digital envelope routines::initialization error'
ENV NODE_OPTIONS --openssl-legacy-provider
COPY package.json package-lock.json .
RUN npm clean-install

RUN yarn run build:${BUILD_ENV}
COPY . .
RUN npm run build

FROM nginx:alpine

RUN apk update && apk add jq

COPY --from=builder /app/build /srv/www
COPY nginx.conf /etc/nginx/templates/default.conf.template
COPY docker/nginx.conf /etc/nginx/templates/default.conf.template
COPY docker/90-write-env-to-json.sh /docker-entrypoint.d

EXPOSE 80
43 changes: 14 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
# osmcha-frontend

OSMCha is composed by a group of softwares that together has the aim to make it
easier to monitor and validate the changes in OpenStreetMap. [Learn more …](ABOUT.md)
This is the web frontend for [osmcha.org](https://osmcha.org/), a tool for reviewing and analyzing edits to [OpenStreetMap](https://openstreetmap.org/about).

- Production instance: https://osmcha.org
- Test instance: http://osmcha-django-staging.tilestream.net/

This repository contains the frontend code. Other repositories are:
Other relevant repositories that contain parts of the OSMCha application are:
* [`osmcha-django`](https://github.com/OSMCha/osmcha-django) - the backend Django application
* [`osmcha` (python library)](https://github.com/OSMCha/osmcha) - used by the backend to analyse OSM changesets
* [`maplibre-adiff-viewer`](https://github.com/OSMCha/maplibre-adiff-viewer) - used to display the changeset on the main map

## Setting up editor

### Prettier

This repository uses [prettier](https://github.com/prettier/prettier) to keep the code consistent and formatted. You can config your favourite editor by the following links
- Atom users can simply install the [prettier-atom](https://atom.io/packages/prettier-atom) package and use Ctrl+Alt+F to format a file (or format on save if enabled).
- Visual Studio Code users can Search for Prettier - JavaScript formatter.
## Development

### Prerequisite
To set up a local development environment:

1. Install [asdf version manager](https://asdf-vm.com/guide/getting-started.html#getting-started)
1. `asdf install` to install the required tools from [.tool-versions](./.tool-versions)
1. `yarn install` (`brew install yarn` if required).

### Local development

1. `yarn start`
1. Install Node.js and npm. The recommended Node.js version is listed in [.tool-versions](./.tool-versions). Tool managers like [asdf](https://asdf-vm.com/) or [mise](https://mise.jdx.dev/) can read this file and install the right version for you if you want.
1. Run `npm install` to install the required JavaScript dependencies.
1. Run `npm run start` to start the frontend (it will rebuild automatically when you make changes)
1. Open [http://127.0.0.1:3000](http://127.0.0.1:3000)

Note: if you are running the frontend against the production backend (the
Expand All @@ -41,16 +27,15 @@ If you are running your own local copy of the
[`osmcha-django`](https://github.com/OSMCha/osmcha-django) backend, you'll
need to register your own OAuth app on openstreetmap.org, configure the backend
to use that secret key, and then point this frontend at your local backend by
setting the `REACT_APP_PRODUCTION_API_URL` environment variable. After that,
normal OAuth login through the frontend UI should work.

### Local testing
setting the `OSMCHA_API_URL` environment variable. After that, normal OAuth
login through the frontend UI should work.

Test the application before commiting any changes. If you encounter any error make sure you have `watchman` installed. [Installation Guide](https://facebook.github.io/watchman/docs/install.html).
### Testing and quality checks

```bash
yarn test
```
- `npm run typecheck` runs TypeScript to verify that the code does not have any type errors
- `npm run check` checks that the code is formatted correctly and runs the linter (it also runs typechecking)
- `npm run format` reformats code to match the expected conventions
- `npm run test` runs the automated test suite

## Releasing and Deployment

Expand Down
43 changes: 43 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!build", "!public", "!**/*.css"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "off"
},
"correctness": {
"noUnusedVariables": "error",
"noUnusedFunctionParameters": "off"
},
"style": {
"useTemplate": "off",
"noNonNullAssertion": "off"
},
"a11y": {
"useButtonType": "off",
"noSvgWithoutTitle": "off",
"noStaticElementInteractions": "off",
"useKeyWithClickEvents": "off",
"useSemanticElements": "off",
"noLabelWithoutControl": "off"
}
}
}
}
7 changes: 7 additions & 0 deletions docker/90-write-env-to-json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Convert env to json and write out to overrides file
jq -n 'env | with_entries(select(.key | startswith("OSMCHA_")))' > /tmp/env.overrides.json
# Merge overrides and defaults together
cp /srv/www/env.json /tmp/env.default.json
jq -s '.[0] * .[1]' /tmp/env.default.json /tmp/env.overrides.json > /srv/www/env.json
File renamed without changes.
32 changes: 0 additions & 32 deletions flow-typed/npm/animate.css_vx.x.x.js

This file was deleted.

Loading
Loading