You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,16 @@ Ready to use it ? Jump to the [documentation](https://openfoodfacts.github.io/se
14
14
15
15
This is an Open Source project and [contributions are very welcome](https://openfoodfacts.github.io/search-a-licious/#contributing) !
16
16
17
+
## 🚀 Quick Start for Developers
18
+
19
+
Want to contribute? Get started in minutes with our [Developer Installation Guide](https://openfoodfacts.github.io/search-a-licious/devs/how-to-install/)
This project has received financial support from the NGI Search (New Generation Internet) program, funded by the 🇪🇺 European Commission. Thank you for supporting Open-Souce, Open Data, and the Commons.
Copy file name to clipboardExpand all lines: docs/devs/how-to-install.md
+56-23Lines changed: 56 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,42 @@
1
1
# How to install for local development
2
2
3
-
## Pre-requisites
3
+
## Option 1: Dev Containers (Recommended)
4
+
5
+
The easiest way to get started is using Dev Containers, which provides a fully-configured development environment.
6
+
7
+
### Prerequisites
8
+
9
+
-[Docker](https://www.docker.com/products/docker-desktop) installed and running
10
+
-[VS Code](https://code.visualstudio.com/) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
11
+
- Or use [GitHub Codespaces](https://github.com/features/codespaces) for browser-based development
12
+
13
+
### Getting Started
14
+
15
+
1. Clone the repository
16
+
2. Open the folder in VS Code
17
+
3. When prompted, click "Reopen in Container" (or use the command palette: `Dev Containers: Reopen in Container`)
18
+
4. Wait for the container to build (first time takes a few minutes)
19
+
5. You're ready to develop! All dependencies are pre-installed.
20
+
21
+
The dev container automatically:
22
+
23
+
- Sets up Python 3.11 with Poetry and all backend dependencies
24
+
- Installs Node.js LTS with npm and all frontend dependencies
25
+
- Configures Docker-in-Docker for running compose commands
26
+
- Installs helpful VS Code extensions
27
+
- Starts Elasticsearch, Redis, and other services
28
+
- Sets up pre-commit hooks
29
+
30
+
You can now use all `make` commands and start developing immediately. Skip to the [Importing data](#importing-data-into-your-development-environment) section to load sample data.
31
+
32
+
## Option 2: Manual Installation
33
+
34
+
### Pre-requisites
4
35
5
36
First, follow same [prerequisite as for normal installation](../users/how-to-install.md#prerequisites):
6
-
* configuring mmap count
7
-
* installing docker and docker compose
8
37
38
+
- configuring mmap count
39
+
- installing docker and docker compose
9
40
10
41
## Installing Pre-commit
11
42
@@ -16,10 +47,9 @@ to install pre-commit on your machine.
16
47
17
48
### Auto-fixing linting issues in Pull Requests
18
49
19
-
For Pull Requests, you can automatically fix linting issues by commenting `/fix-linting` on the PR.
50
+
For Pull Requests, you can automatically fix linting issues by commenting `/fix-linting` on the PR.
20
51
This will trigger a GitHub Action that runs the linting tools and commits any fixes directly to the PR branch.
21
52
22
-
23
53
## Installing Direnv
24
54
25
55
Direnv is a tool to automatically set environment variables depending on the current directory.
@@ -30,6 +60,7 @@ For Linux and macOS users, You can follow our tutorial to install [direnv](https
30
60
## Setting up your environment
31
61
32
62
You have several options to set up your environment:
63
+
33
64
1. use direnv, and thus use the `.envrc` file to set up your environment
34
65
2. add a .envrc that you source in your terminal.
35
66
3. modify the .env file directly, in which case you should be careful to not commit your changes
[^winEnvrc]: For Windows users, the .envrc is only taken into account by the `make` commands.
53
84
54
-
55
85
## Building containers
56
86
57
87
To build the containers, you can run the following command:
88
+
58
89
```bash
59
90
make build
60
91
```
@@ -69,38 +100,40 @@ After that run the following command on another shell to compile the project: `m
69
100
70
101
Do this for next installation steps and to run the project.
71
102
72
-
73
103
> [!NOTE]
74
-
> * You may encounter a permission error if your user is not part of the `docker` group, in which case you should either [add it](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) or modify the Makefile to prefix `sudo` to all docker and docker compose commands.
75
-
> * Update container crash because we are not connected to any Redis, this is not a problem
104
+
>
105
+
> - You may encounter a permission error if your user is not part of the `docker` group, in which case you should either [add it](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) or modify the Makefile to prefix `sudo` to all docker and docker compose commands.
106
+
> - Update container crash because we are not connected to any Redis, this is not a problem
76
107
77
108
Docker spins up:
109
+
78
110
- Two elasticsearch nodes, one being exposed on port 9200 [^localhost_expose]
79
-
* test it going to http://127.0.0.1:9200
111
+
- test it going to http://127.0.0.1:9200
80
112
-[Elasticvue](https://elasticvue.com/) on port 8080
81
-
* test it going to http://127.0.0.1:8080
113
+
- test it going to http://127.0.0.1:8080
82
114
- The search service on port 8000
83
-
* test the API going to http://search.localhost:8000/docs
84
-
* test the UI going to http://search.localhost:8000/
115
+
- test the API going to http://search.localhost:8000/docs
116
+
- test the UI going to http://search.localhost:8000/
85
117
86
-
[^localhost_expose]: by default we only expose on the localhost interface.
87
-
This is driven by the `*_EXPOSE` variables in `.env`.
118
+
[^localhost_expose]:
119
+
by default we only expose on the localhost interface.
120
+
This is driven by the `*_EXPOSE` variables in `.env`.
88
121
89
-
Congratulations, you have successfully installed the project !
122
+
Congratulations, you have successfully installed the project !
90
123
91
124
You will then need to import from a JSONL dump (see instructions below).
92
125
93
126
## Importing data into your development environment
0 commit comments