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
@@ -11,104 +11,37 @@ For now the only reason we're including docker is to more easily control the dev
11
11
12
12
## Running the Project Locally
13
13
14
-
### Getting Everything Started
15
-
16
-
Once you've got these installed, we can build our container and run it
17
-
18
-
#### Note to run the postgres container locally using the command below
19
-
20
-
You have to modify `devU-api/src/environment.ts`
21
-
22
-
change
23
-
24
-
`dbHost: (load('database.host') || 'localhost') as string`
25
-
26
-
to
27
-
28
-
`dbHost: 'localhost'`
29
-
30
-
This will probably be fixed in the future but for now the above steps are necessary
31
-
32
-
#### Using docker compose
33
-
34
-
We use [docker compose profiles](https://docs.docker.com/compose/profiles/) to selectively start services in the main docker-compose when developing.
35
-
36
-
Assuming you are in api dir `devU-api`, To start all api services except the api run
37
-
38
-
```
39
-
npm run api-services
40
-
```
41
-
42
-
To stop the services
43
-
44
-
```
45
-
npm run api-services-stop
46
-
```
47
-
48
-
Then install dependencies using
49
-
50
-
```
51
-
npm install
52
-
```
53
-
54
-
Once you've got all the dependencies installed you can run the project via
55
-
56
-
```
57
-
npm start
58
-
```
59
-
60
-
#### Manually:
61
-
62
-
```
63
-
docker run \
64
-
--name typeorm-postgres \
65
-
-p 5432:5432 \
66
-
-e POSTGRES_PASSWORD=password \
67
-
-e POSTGRES_DB=typescript_api \
68
-
-e POSTGRES_USER=typescript_user \
69
-
-d postgres
70
-
```
71
-
72
-
Install all node dependencies. All of the database environment variables can change, and can be set as environment variables on your machine if you want to overwrite the defaults
73
-
74
-
```
75
-
docker run \
76
-
--name minio \
77
-
-p 9002:9000 \
78
-
-p 9001:9001 \
79
-
-v /tmp/data:/data \
80
-
-e "MINIO_ROOT_USER=typescript_user" \
81
-
-e "MINIO_ROOT_PASSWORD=changeMe" \
82
-
-d minio/minio server /data --console-address ":9001"
83
-
```
84
-
85
-
Install all node dependencies. All of the database environment variables can change, and can be set as environment variables on your machine if you want to overwrite the defaults
86
-
87
-
```
88
-
npm install
89
-
```
90
-
91
-
Run the setup script to create local development auth keys. These are used in local development for signing and authenticating JWTs.
92
-
93
-
```
94
-
npm run generate-config
95
-
```
96
-
97
-
Run the initial migrations to setup our DB schema
98
-
99
-
```
100
-
npm run typeorm -- migration:run -d src/database.ts
101
-
```
102
-
103
-
Once you've got all the dependencies installed you can run the project via
104
-
105
-
```
106
-
npm start
107
-
```
108
-
109
-
By default the project runs at `localhost:3001`, but you can change the port by setting an alternate port by setting the `PORT` environment variable.
110
-
111
-
If you're working in vscode, a configuration has been included to allow for debugging. Open up the VS Code Run and Debug section and click `Debug API`.
14
+
### Quick Start
15
+
16
+
The instructions below assume you are in the api dir `/devU-api/`
17
+
18
+
You must have the following tools installed
19
+
20
+
* Docker
21
+
* Node >= v20
22
+
23
+
Once you've got these installed,
24
+
25
+
1. We use [docker compose profiles](https://docs.docker.com/compose/profiles/)
26
+
to selectively start services in the main docker-compose when developing.
27
+
This starts all required services for the api depends (database, frontend etc.)
28
+
```
29
+
npm run api-services
30
+
```
31
+
32
+
To remove all related containers
33
+
```
34
+
npm run api-services-stop
35
+
```
36
+
37
+
2. Install dependencies using
38
+
```
39
+
npm install
40
+
```
41
+
3. Once you've got all the dependencies installed you can run the project via
@@ -257,7 +189,7 @@ I wouldn't recommend digging that far down as the of tests should be more human-
257
189
If the schema needs to be updated, you can do so by updating the models and running
258
190
259
191
```
260
-
npm run typeorm migration:generate -- -d src/database src/migration/<generatedMigrationName>
192
+
npm run create-migration someMeaningfulMigrationName
261
193
```
262
194
263
195
Doing so will attempt to create an auto migration from any changes within the `src/models` directory and add it to `src/migrations`. If an auto migration is generated for you (always check your auto migrations), you can run it with the above migration command
0 commit comments