Setup Web Development Environment
The following section describes the lightweight setup process for the web app, which allows faster development and testing. For native features and not web related bug fixes, refer to the full setup guide, which includes the setup of the mobile app environment.
Prerequisites
-
Fork the repository and clone it to your local machine.
-
Install the required software:
- Visual Studio Code
- Docker Desktop (optional, for CORS proxy)
-
Install the required dependencies:
-
In addition is recommended to use the Biome extension for your IDE to get real-time feedback on your code.
-
Install project dependencies by running the following command in the project directory:
bun install -
Copy the
.env.local.examplefile to.env.localand fill in the variables.
See the notes on the API key.
EXPO_PUBLIC_THI_API_KEY=abc123Development
-
Create a new branch from your fork to contribute to the project. Use a descriptive branch name.
-
Make your changes and ensure that the code follows our coding style and conventions.
-
Run the app locally with Expo by running the following command in the project directory:
bun web
Detailed information about contributing to the project and the code style can be found in the full setup guide.
Due to the CORS rules of the THI API, which do not allow localhost, you need to use a proxy or a browser extension to use the API in the browser.
Setting up the CORS Proxy
To use the THI API during local development, it is recommended to use the Neuland CORS Proxy .
The proxy is intended for local development only and should not be used in production environments!
Using Docker (Recommended)
The easiest way to run the proxy is using Docker:
docker run -p 3001:3001 ghcr.io/neuland-ingolstadt/neuland-next-proxy:latestThe proxy is now running on http://localhost:3001.
Optional: Use a different port:
docker run -p 8080:8080 -e PORT=8080 ghcr.io/neuland-ingolstadt/neuland-next-proxy:latestManual Installation
Alternatively, you can install the proxy manually:
-
Clone the proxy repository:
git clone https://github.com/neuland-ingolstadt/neuland-next-proxy.git cd neuland-next-proxy -
Install the dependencies:
pnpm install -
Start the proxy server:
pnpm dev
Configuring Neuland Next Web
Add the following environment variable to your .env.local file:
EXPO_PUBLIC_ENDPOINT_HOST=http://localhost:3001Now you can start the web app with bun web and the THI API will be accessed through the proxy.