|
1 |
| -This page describes the steps needed to start with frontend development. It is assumed that you are using Ubuntu Linux and you will need Docker, docker-compose, and git. |
| 1 | +# Frontend development setup |
2 | 2 |
|
3 |
| -## Step 1: Clone the repository |
| 3 | +This page describes the steps needed to start with frontend development. |
4 | 4 |
|
5 |
| -Clone the frontend repository |
6 |
| -``` |
7 |
| -git clone [email protected]:gramps-project/gramps-web.git |
8 |
| -cd gramps-web |
9 |
| -``` |
| 5 | +## Prerequisites |
10 | 6 |
|
11 |
| -## Step 2: Build and start the development containers |
| 7 | +The recommended development setup uses Visual Studio Code with devcontainers. This approach will create a preconfigured development environment with all the tools you need. |
12 | 8 |
|
13 |
| -To build and start the containers running the Gramps Web backend with the Gramps example database, as well as the frontend in development mode, simply run |
| 9 | +See [Backend development setup](../backend/setup.md#prerequisites) for the prerequisites needed. |
14 | 10 |
|
15 |
| -```bash |
16 |
| -docker compose up -d |
17 |
| -``` |
| 11 | +## Getting started |
18 | 12 |
|
19 |
| -Options for logging in are: owner, editor, contributor, guest or member (use same word for both username and password). |
| 13 | +1. Open the [Gramps Web frontend repository](https://github.com/gramps-project/gramps-web) and click "fork" |
| 14 | +2. Clone your forked repository to your local machine using Git |
| 15 | +3. Open the cloned repository in Visual Studio Code. When prompted, select "Reopen in Container" or manually open the command palette (Ctrl+Shift+P or Cmd+Shift+P) and select "Dev Containers: Rebuild and Reopen in Container". |
| 16 | +4. Wait for the dev container to build and start. This may take a few minutes, especially the first time. |
20 | 17 |
|
21 |
| -!!! warning |
22 |
| - Do not use the development server in production. |
23 | 18 |
|
24 |
| -As part of the build process, git hooks for formatting and linting will be installed as well. |
| 19 | +## Running the frontend development server |
25 | 20 |
|
26 |
| -## Usage instructions |
| 21 | +To run the frontend development server and preview the impact of your changes in the browser, you can use the predefined tasks in the dev container. |
27 | 22 |
|
28 |
| -Once the containers are up and running, Gramps Web will be accessible at [http://localhost:5555](http://localhost:5555). |
| 23 | +For that to work, you first need to spin up an instance of the [Gramps Web API backend](../backend/setup.md#tasks). The easiest way to do this is to use the backend dev container and [run the "Serve Web API" task](../backend/setup.md#tasks) in a separate VS Code window. |
29 | 24 |
|
30 |
| -Once you make changes to the frontend code, you browser will be reloaded automatically. |
| 25 | +Once the backend is running, you can run the frontend development server by selecting "Tasks: Run Task" from the command palette (Ctrl+Shift+P or Cmd+Shift+P) and then choosing "Serve Gramps Web frontend". |
31 | 26 |
|
32 |
| -The installed git hooks will format and lint the code on every commit. You can run the scripts manually using |
| 27 | +This will start the frontend development server on port 8001, which you can access in your browser at `http://localhost:8001`. The browser will automatically reload when you make changes to the frontend code, allowing you to see the impact of your changes immediately. |
33 | 28 |
|
34 |
| -``` |
35 |
| -docker compose run gramps-frontend format |
36 |
| -``` |
37 |
| -and |
38 |
| -``` |
39 |
| -docker compose run gramps-frontend lint |
40 |
| -``` |
41 |
| -respectively. |
0 commit comments