2022-10-31 06:37:36 -05:00
---
2022-12-21 16:01:50 -05:00
sidebar_position: 2
2022-10-31 06:37:36 -05:00
---
2022-12-21 16:01:50 -05:00
# Setup
2022-11-03 22:26:09 -05:00
2022-12-21 16:01:50 -05:00
## Environment
2022-11-03 22:26:09 -05:00
### Server and web app
This environment includes the following services:
2023-06-08 11:01:07 -04:00
- Core server - `/server/src/immich`
2022-11-03 22:26:09 -05:00
- Machine learning - `/machine-learning`
2023-06-08 11:01:07 -04:00
- Microservices - `/server/src/microservicess`
2022-11-03 22:26:09 -05:00
- Web app - `/web`
- Redis
- PostgreSQL development database with exposed port `5432` so you can use any database client to acess it
- NGINX Proxy - `nginx/nginx.conf`
All the services are packaged to run as with single Docker Compose command.
2022-11-17 00:30:58 -05:00
### Instructions
1. Clone the project repo.
2023-01-24 16:26:58 +01:00
2. Run `cp docker/example.env docker/.env` .
2023-01-27 20:50:07 +00:00
3. Edit `docker/.env` to provide values for the required variable `UPLOAD_LOCATION` .
2022-11-17 00:30:58 -05:00
4. From the root directory, run:
2022-11-03 22:26:09 -05:00
```bash title="Start development server"
make dev # required Makefile installed on the system.
```
2022-11-17 00:30:58 -05:00
5. Access the dev instance in your browser at http://localhost:2283, or connect via the mobile app.
2022-11-03 22:26:09 -05:00
All the services will be started with hot-reloading enabled for a quick feedback loop.
2022-11-16 23:15:26 -06:00
You can access the web from `http://your-machine-ip:2283` or `http://localhost:2283` and access the server from the mobile app at `http://your-machine-ip:2283/api`
2022-11-03 22:26:09 -05:00
### Mobile app
The mobile app `(/mobile)` will required Flutter toolchain to be installed on your system.
Please refer to the [Flutter's official documentation ](https://flutter.dev/docs/get-started/install ) for more information on setting up the toolchain on your machine.
2023-04-07 21:44:56 -04:00
### Connect to a remote backend
If you only want to do web development connected to an existing, remote backend, follow these steps:
1. Enter the web directory - `cd web/`
2. Install web dependencies - `npm i`
3. Start the web development server
```
2023-11-17 23:13:36 -05:00
IMMICH_SERVER_URL=https://demo.immich.app/api npm run dev
2023-04-07 21:44:56 -04:00
```
2022-11-03 22:26:09 -05:00
## IDE setup
### Lint / format extensions
2022-11-06 22:27:14 -05:00
Setting these in the IDE give a better developer experience, auto-formatting code on save, and providing instant feedback on lint issues.
2022-11-03 22:26:09 -05:00
2023-11-19 05:17:08 +00:00
### Dart Code Metris
The mobile app uses DCM (Dart Code Metrics) for linting and metrics calculation. Please refer to the [Getting Started ](https://dcm.dev/docs/getting-started/#installation ) page for more information on setting up DCM
Note: Activating the license is not required.
2022-11-03 22:26:09 -05:00
### VSCode
2023-11-19 05:17:08 +00:00
Install `Flutter` , `DCM` , `Prettier` , `ESLint` and `Svelte` extensions.
2022-11-03 22:26:09 -05:00
in User `settings.json` (`cmd + shift + p` and search for `Open User Settings JSON` ) add the following:
```json title="settings.json"
{
"editor.formatOnSave": true,
"[javascript][typescript][css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.formatOnSave": true
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode",
"editor.tabSize": 2
},
"svelte.enable-ts-plugin": true,
"eslint.validate": ["javascript", "svelte"],
"[dart]": {
"editor.formatOnSave": true,
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false,
"editor.defaultFormatter": "Dart-Code.dart-code"
}
}
```