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
|[Training](https://github.com/nhsuk/manage-vaccinations-in-schools/deployments/training)|[training.manage-vaccinations-in-schools.nhs.uk](https://training.manage-vaccinations-in-schools.nhs.uk)| External training | ❌ |`release` branch | manual |[`staging`](config/environments/staging.rb)|
14
13
|[Production](https://github.com/nhsuk/manage-vaccinations-in-schools/deployments/production)|[www.manage-vaccinations-in-schools.nhs.uk](https://www.manage-vaccinations-in-schools.nhs.uk)| Live service | ✅ |`release` branch | manual |[`production`](config/environments/production.rb)|
15
14
16
-
## Documentation
15
+
## API Documentation
17
16
18
-
We have two Rdoc versions:
17
+
We have two RDoc versions:
19
18
20
19
1.[next](https://nhsuk.github.io/manage-vaccinations-in-schools/rdoc/next) - useful for dev work (based off the `next` branch).
21
20
2.[release](https://nhsuk.github.io/manage-vaccinations-in-schools/rdoc/release) - useful for ops to debug live issues (based off the `release` branch).
@@ -47,9 +46,7 @@ We use `rladr` to generate the boilerplate for new records:
47
46
bin/bundle exec rladr new title
48
47
```
49
48
50
-
### Development toolchain
51
-
52
-
#### Mise
49
+
### Installing dependencies
53
50
54
51
This project uses `mise`. Use the following to set up (replace `brew` and
55
52
package names depending on your platform):
@@ -84,20 +81,46 @@ Then to install the required tools (or update, following a change to
84
81
mise install
85
82
```
86
83
87
-
After installing Postgres via `mise`, run the database in the background, and
88
-
connect to it to create a user:
84
+
### Background services
85
+
86
+
For the application to start successfully, PostgreSQL and Redis/Valkey must be
87
+
running.
88
+
89
+
#### PostgreSQL
90
+
91
+
If using `brew`, the simplest option is to run `brew services start postgresql`.
92
+
93
+
Alternatively, you can run the server manually:
89
94
90
95
```shell
91
96
pg_ctl start
92
97
psql -U postgres -c "CREATE USER $(whoami); ALTER USER $(whoami) WITH SUPERUSER;"
93
98
```
94
99
95
-
###Local development
100
+
#### Redis/Valkey
96
101
97
-
To run the project locally:
102
+
If using `brew`, the simplest option is to run `brew services start redis`.
103
+
104
+
Alternatively, you can run the server manually:
98
105
99
106
```shell
100
-
bin/setup
107
+
redis-server
108
+
```
109
+
110
+
### Running locally
111
+
112
+
When running for the first time, `bin/setup` will automatically install Ruby
113
+
dependencies and set up the database.
114
+
115
+
This application also comes with a `Procfile.dev` for use with `foreman` in
116
+
development environments. Use the script `bin/dev` to run it:
117
+
118
+
```shell
119
+
$ bin/dev
120
+
13:07:31 web.1 | started with pid 73965
121
+
13:07:31 css.1 | started with pid 73966
122
+
13:07:31 js.1 | started with pid 73967
123
+
...
101
124
```
102
125
103
126
### Branching strategy
@@ -141,39 +164,7 @@ You'll also need to configure your editor's `solargraph` plugin to
141
164
+ "solargraph.useBundler": true,
142
165
```
143
166
144
-
### PostgreSQL
145
-
146
-
The script `bin/db` is included to start up PostgreSQL for setups that don't use
147
-
system-started services. Note that this is meant to be a handy script to manage
148
-
PostgreSQL, not run a console like `rails db` does.
149
-
150
-
```shell
151
-
$ bin/db
152
-
pg_ctl: no server running
153
-
$ bin/db start
154
-
waiting for server to start.... done
155
-
server started
156
-
$ bin/db
157
-
pg_ctl: server is running (PID: 79113)
158
-
```
159
-
160
-
This script attempts to be installation agnostic by relying on `pg_config` to
161
-
determine postgres's installation directory and setting up logging accordingly.
162
-
163
-
### Development server
164
-
165
-
This application comes with a `Procfile.dev` for use with `foreman` in
166
-
development environments. Use the script `bin/dev` to run it:
167
-
168
-
```shell
169
-
$ bin/dev
170
-
13:07:31 web.1 | started with pid 73965
171
-
13:07:31 css.1 | started with pid 73966
172
-
13:07:31 js.1 | started with pid 73967
173
-
...
174
-
```
175
-
176
-
#### Debugging with `binding.pry`
167
+
### Debugging with `binding.pry`
177
168
178
169
TTY echo can get mangled when using `binding.pry` in `bin/dev`. To work around
179
170
this, you can run `rails s` directly if you're not working with any JS or CSS
You can generate an example programme by seeding the database with `rails db:seed:replant`.
237
228
238
-
####Adding a test user
229
+
### Adding a test user
239
230
240
231
You can add a new user to an environment using the `users:create`[rake task](docs/rake-tasks.md#userscreateemailpasswordgiven_namefamily_nameteam_ods_code):
0 commit comments