This repository contains the code of the new openSenseMap frontend running at https://beta.opensensemap.org.
Originally, the openSenseMap was built as part of the bachelor thesis of @mpfeil at the ifgi (Institute for Geoinformatics, University of Münster). Between 2016 and 2022 development was partly funded by the German Ministry of Education and Research (BMBF) in the projects senseBox and senseBox Pro. This version has been developed by @mpfeil and @freds-dev.
If you do need to set the project up locally yourself, feel free to follow these instructions:
- Visual Studio Code
- Docker >= 27.0.0
You can configure the API endpoint and/or map tiles using the following environmental variables:
| ENV | Default value |
|---|---|
| OSEM_API_URL | https://api.testing.opensensemap.org |
| DATABASE_URL | <YOUR_POSTGRES_URL> |
| MAPBOX_ACCESS_TOKEN | <YOUR_MAPBOX_ACCESS_TOKEN> |
You can create a copy of .env.example, rename it to .env and set the values.
- Clone the repo:
git clone https://github.com/openSenseMap/frontend - Copy
.env.exampleinto.env - Run
npm installto install dependencies - Run
npm run dockerto start the docker container running your local postgres DB - Run
npm run build - Run
npm run devto start the local server
Simply open the project in Visual Studio Code. It should prompt and ask you if you would like to open the project in a DevContainer.
If you are not prompted hit Ctrl + Shift + P
(Shift+Command+P on Mac) and select
>DevContainers: Open Workspace in Container....
The DevContainer will now build (which will take a bit the first time your are
doing this) and the window will reload. For convenience npm install and
npm run build are executed for you on start.
For users of Visual Studio Code there is a
launch.json containing two options to debug the
application:
- Debug
- Starts the development task (
npm run dev) and attaches to process
- Starts the development task (
- Attach
- Use when you have started the development task elsewhere already
- Attaches to an existing task
- You will be prompted with running tasks. Depending on your setup you may
need to try a few until you find the correct one. Hint: Look out for the
arguments of the tasks and choose the one that contains
tsx watch
Debugging the application will allow you to set breakpoints and step through the
code. Additionally, you may set
logpoints
to eliminate the need for console.log in your code for debugging purposes.
We welcome all kind of constructive contributions to this project. Please have a look at CONTRIBUTING if you want to do so.
MIT - Matthias Pfeil 2015 - now
