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
+85-11Lines changed: 85 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,40 +42,114 @@ If you are interested in getting involved with the project, check out [our page
42
42
43
43
[library-api](/library-api) contains a library of pre-built benefits and eligibility rules, suitable for including in custom screeners and for standing up a standalone eligibility API.
44
44
45
-
## Local Development Setup
45
+
## Development Setup
46
+
47
+
### In the Cloud (Github Codespaces)
48
+
49
+
This is the easiest way to get started with development if you like having a cloud-based development environment. Just click the badge:
50
+
51
+
[](https://codespaces.new/CodeForPhilly/benefit-decision-toolkit)
52
+
53
+
Once you create a new codespace, the included Devcontainer will build and configure the project. This takes several minutes the first time, so be patient!
To setup using the pre-defined [Devbox](https://www.jetify.com/docs/devbox/) configuration:
58
-
*Note that this installs Devbox and Nix (if they aren't already installed).
69
+
From here, you have 3 options:
70
+
- Use [Devbox](https://www.jetify.com/docs/devbox/) (recommended),
71
+
- Use [Devcontainer in VS Code](https://code.visualstudio.com/docs/devcontainers/containers), or
72
+
- DIY (not recommended)
73
+
74
+
#### Option 1: Devbox (recommended)
75
+
76
+
We use [Jetify Devbox](https://www.jetify.com/docs/devbox/) to declare and manage project development dependencies. This makes it easy to setup the project and reduces *"works on my machine"* issues. It uses the Nix Package Manager under the hood, which results in higher performance compared to container-based solutions.
77
+
78
+
To install devbox (and Nix) and configure your machine for development:
79
+
59
80
```bash
60
81
bin/install-devbox && devbox run setup
61
82
```
62
83
63
-
If you don't want to use devbox/nix, then you can install system dependencies (e.g. JDK, Node, Maven) manually (see devbox.json for the list) and run:
84
+
Then, to startup all the services/apps with the default configuration, run:
85
+
64
86
```bash
65
-
bin/setup
87
+
# uses process-compose under the hood
88
+
devbox services up
66
89
```
67
90
68
-
If using devbox, then run the shell to load dependencies:
91
+
You can also run a shell in the context of Devbox with:
92
+
69
93
```bash
70
94
devbox shell
71
-
# Consider using direnv and/or the VS Code extensions (Devbox and Direnv) to automate this step.
72
95
```
73
96
74
-
Then start apps as needed, e.g.:
97
+
Or run a single command in the context of Devbox with:
98
+
99
+
```bash
100
+
# export data from the firebase emulators (they must be running!)
101
+
devbox run -- firebase emulators:export ./dir
102
+
```
103
+
104
+
Tips:
105
+
- Use the [Devbox direnv integration](https://www.jetify.com/docs/devbox/ide-configuration/direnv) to automatically start a Devbox shell whenever you navigate to the project directory.
106
+
- If you develop in VS Code, then consider installing the [Devbox and Direnv extensions](https://www.jetify.com/docs/devbox/ide-configuration/vscode) to automatically start `devbox shell` in VS Code Terminal and otherwise manage Devbox via the Command Palette.
107
+
- Edit the `.devboxrc` file (not in source control) to run custom commands every time you start a devbox environment. You can use this for things like disabling conflicting tools or adding project-specific shell aliases.
108
+
109
+
#### Option 2: Devcontainer in VS Code
110
+
111
+
This project comes with a devcontainer configuration that runs the Devbox/Nix environment inside the container itself. This is a good option for those used to a container-based workflow and don't mind the corresponding performance degradation as compared to native Devbox.
112
+
113
+
To use the provided devcontainer, first open VS Code and install the `Dev Containers` extension.
114
+
115
+
Then, use the command palette (Cmd+Shift+P or Ctrl+Shift+P) to run *"Dev Containers: Open Folder in Container..."* and select this project. It will take several minutes to build the container the first time.
116
+
117
+
You should be prompted to install Docker if it isn't already installed.
118
+
119
+
Once the container builds, startup all the services/apps in the default configuration by opening a Terminal in VS Code and running:
120
+
121
+
```bash
122
+
devbox services up
123
+
```
124
+
125
+
Note: the devcontainer automatically uses the equivalent of `devbox shell` in VS Code Terminal, so there is no need to run it manually.
126
+
127
+
#### Option 3: DIY (not recommended)
128
+
129
+
It is recommended to use Devbox, Devcontainer, or Codespaces to develop with this project because each of those methods draw from a single source of truth to build the development environment (devbox.json).
130
+
131
+
If you insist on going your own way then you can install system dependencies (e.g. JDK, Node, Maven) manually (see devbox.json for the list) and run:
132
+
75
133
```bash
76
-
cd builder-frontend && npm run dev
134
+
bin/setup
135
+
```
136
+
137
+
Then to startup all the services/apps in the default configuration, install [process-compose](https://f1bonacc1.github.io/process-compose/) and run:
138
+
139
+
```bash
140
+
process-compose
77
141
```
78
142
79
-
You can find additional instructions to work on each app within the project in their respective directories, which are linked above.
143
+
Or to run services manually (without `process-compose`):
80
144
81
-
Note that for the frontend apps, you will need a .env file from a teammate. Please do not commit this file to the repo.
echo" a. If you plan to use devbox and develop against local emulators, then you are good to go!"
119
120
echo" b. If not using devbox and/or plan to develop against real Firebase services, then you might need help from a teammate to finish setting up your environment."
120
-
echo"2. If using devbox, then:"
121
-
echo" a. Run 'devbox shell' within the project root directory to load dependencies. (https://www.jetify.com/docs/devbox/cli_reference/devbox_shell/)"
122
-
echo" b. Consider using the direnv integration to load dependencies automatically. (https://www.jetify.com/docs/devbox/ide_configuration/direnv/)"
123
-
echo" c. If you use VS Code, then consider installing the Devbox and Direnv extensions."
124
-
echo"3. Run the web apps locally using 'npm run dev' from within builder-frontend and screener-frontend directories."
125
-
echo"4. Run the library-api application using 'quarkus dev' within the library-api directory."
121
+
echo"2. Run all main web app services locally in dev mode:"
122
+
echo" a. With devbox: 'devbox services up'"
123
+
echo" b. Without devbox: install then run 'process-compose'"
124
+
echo"3. Other things to try:"
125
+
echo" a. Run 'devbox shell' to load the environment without running services."
126
+
echo" b. Consider using the direnv integration to load dependencies automatically."
127
+
echo" c. Consider installing the Devbox and Direnv extensions for VS Code."
0 commit comments