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
+58-27Lines changed: 58 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,72 +8,103 @@ A comprehensive membership evaluations solution for Computer Science House.
8
8
Development
9
9
-----------
10
10
11
-
To run the application, you must have the latest version of [Python 3](https://www.python.org/downloads/) and [virtualenv](https://virtualenv.pypa.io/en/stable/installation/) installed. Once you have those installed, create a new virtualenv and install the Python dependencies:
11
+
### Config
12
+
13
+
You must create `config.py` in the top-level directory with the appropriate credentials for the application to run. See `config.env.py` for an example.
12
14
15
+
#### Add OIDC Config
16
+
Reach out to an RTP to get OIDC credentials that will allow you to develop locally behind OIDC auth
You can either develop using the dev database, or use the local database provided in the docker compose file
29
+
30
+
Using the local database is detailed below, but both options will require the dev database password, so you will have to ask an RTP for this too
31
+
32
+
### Run (Without Docker)
33
+
34
+
To run the application without using containers, you must have the latest version of [Python 3](https://www.python.org/downloads/) and [virtualenv](https://virtualenv.pypa.io/en/stable/installation/) installed. Once you have those installed, create a new virtualenv and install the Python dependencies:
35
+
36
+
```sh
14
37
virtualenv .conditionalenv -p `which python3`
15
38
source .conditionalenv/bin/activate
16
39
pip install -r requirements.txt
17
-
export FLASK_APP=app.py
18
40
```
19
41
20
-
In addition, you must have Node, NPM, and Gulp CLI installed to properly execute the asset pipeline. If you don't have Node installed, we recommending installing with [NVM](https://github.com/creationix/nvm):
42
+
In addition, you must have Node, NPM, and Weback CLI installed to properly execute the asset pipeline. If you don't have Node installed, we recommending installing with [NVM](https://github.com/creationix/nvm):
21
43
22
-
```
44
+
```sh
23
45
nvm install
24
46
nvm use
25
-
npm install -g gulp
47
+
npm install -g webpack
26
48
```
27
49
28
-
Then, install the pipeline and frontend dependencies:
50
+
Then, install the pipeline and frontend dependencies: (do this in the `frontend` directory)
29
51
30
-
```
52
+
```sh
31
53
npm install
32
54
```
33
55
34
-
### Config
56
+
Once you have all of the dependencies installed, run
35
57
36
-
You must create `config.py` in the top-level directory with the appropriate credentials for the application to run. See `config.sample.py` for an example.
58
+
```sh
59
+
npm webpack
60
+
```
37
61
38
-
#### Add OIDC Config
39
-
Reach out to an RTP to get OIDC credentials that will allow you to develop locally behind OIDC auth
62
+
This will build the frontend assets and put them in the correct place for use with flask
Once you have all of the dependencies installed, simply run:
78
+
It is likely easier to use containers like `podman` or `docker` or the corresponding compose file
53
79
54
-
```
55
-
npm start
80
+
With podman, I have been using
81
+
82
+
```sh
83
+
podman compose up --force-recreate --build
56
84
```
57
85
58
-
This will run the asset pipeline, start the Python server, and start BrowserSync. Your default web browser will open automatically. If it doesn't, navigate to `http://127.0.0.1:3000`. Any changes made to the frontend files in `frontend` or the Jinja templates in `conditional/templates` will cause the browser to reload automatically.
86
+
Which can be restarted every time changes are made
59
87
60
88
### Dependencies
61
89
62
90
To add new dependencies, add them to `requirements.in` and then run `pip-compile requirements.in` to produce a new locked `requirements.txt`. Do not edit `requirements.txt` directly as it will be overwritten by future PRs.
63
91
64
92
### Local database
65
93
66
-
You can run the database locally using the docker compose, make sure to upgrade it as explained below
94
+
You can run the database locally using the docker compose
67
95
68
96
To populate it with dev data for example, you can use the command
This can be helpful for changing the database schema
75
103
76
-
NOTE: to use flask db commands with a database running in the compose file, you will have to update your url to point to localhost, not conditional-postgres
104
+
To run migration commands in the local database, you can run the commands inside the docker container. Any migrations created will also be in the local repository since migrations are mounted in the docker compose
0 commit comments