-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathREADME.old
372 lines (227 loc) · 8.84 KB
/
README.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# SkillBuilder
A web application for evaluating students' professional
skills, such as teamwork and communication. The purpose
of the SkillBuilder application is to allow instructors
to assess teams of students in real-time using
research-based or custom rubrics. Instructors can email
students their results, as well as download the data
for analysis.
## SkillBuilder is implemented in three parts: ##
- A Back End Flask server.
- A Caching Redis server.
- A Front End React server.
## Setting up and running with Docker and Docker Compose: ##
- UPDATE: Using Docker and Docker Compose should become the sole
method for running this application locally as it solves
dependency issues across all platforms! Also makes developing
easier as there are now only two commands to worry about.
- Follow the link for instructions on downloading Docker Desktop:
https://www.docker.com/products/docker-desktop/
- NOTE: If you have an intel chip with Windows OS, you will need
to go to the following link to install Docker Desktop:
https://docs.docker.com/desktop/install/windows-install/
- NOTE: Make sure that there are no running frontend,
redis, or backend processes as there will be port
conflicts. To view if you have processes running
on important ports, run the following and expect
no output:
lsof -i :3000,5050,6379
If output, there is a chance you still have processes
running and you need to use the following command to
kill them off:
kill <pid>
or optionally, send with a forced kill (not recommended as it does
not allow the process to shut down gracefully).
sudo kill -9 <pid>
There is a chance that your OS has an important process
running on one of these ports that should not be terminated.
In that case, change the port for conflicting processes in the
compose.yml file. Make sure that you also update changed
ports in the frontend or backend .env and anywhere else
needed!
Step 1:
After following the instructions, ensure you have Docker
Desktop open and running.
Step 2:
Open a new terminal and navigate to where you have this
repository cloned.
Step 3:
Run the following command to ensure you have docker running:
docker ps
Step 4:
Run the following command to build the images:
docker compose build
NOTE: To rebuild with new changes applied and ignore cached
build run the following:
docker compose build --no-cache
NOTE: To view all of the build logs instead of the default
summary run the following:
docker compose build --process=plain
Step 5:
Run the following command to run containers from the images:
docker compose up
Step 6:
Open a browser with the link http://localhost:3000 to see the frontend and log in
with one of the demo students/TAs/admins.
## REQUIREMENTS: ##
- Python 3.12 and up.
- MySQL-Server.
- Homebrew 4.2.18 and up.
- Redis 7.2.4 and up.
- Node.js v21.6.1 and up.
NOTE:
- You WILL encounter issues when running both the
Back End and Front End servers if you do NOT have
installed the REQUIRED versions of Python and
Node.js.
NOTE:
- Linux, Mac, and WSL Developers use `python3`.
- WINDOWS DEVELOPERS ARE NO LONGER SUPPORTED.
## Setting up the MySQL Environment: ##
- Run the following command to install MySQL-Server
on Linux:
sudo apt install mysql-server
- Run the following command to install MySQL-Server
on MacOS:
brew install mysql
- Run the following command to start MySQL-Server
on MacOS:
brew services start mysql
- Run the following command to start MySQL-Server
in a new terminal:
sudo mysql -u root
- Next use these commands to create an account
named skillbuilder and set the password to
"WasPogil1#"
CREATE DATABASE account;
CREATE USER 'skillbuilder'@'localhost' IDENTIFIED BY 'WasPogil1#';
GRANT ALL PRIVILEGES ON *.* TO 'skillbuilder'@'localhost';
FLUSH PRIVILEGES;
exit;
NOTE:
- The password should be changed for deployment.
- Once this is done, you can use: `setupEnv.py` as normal
to create the database. If for any reason you want to
access the database directly, run the following command:
mysql -u skillbuilder -p
and then type the password.
## Installing requirements ##
- Follow the link for instructions on downloading Python:
https://www.python.org/downloads/
- Follow the link for instructions on downloading Node.js:
https://nodejs.org/en/download
- Follow the link for instructions on downloading brew:
https://brew.sh/
- Once installed, run the following command with Homebrew
to install redis:
brew install redis
## Setting up the Back End environment: ##
- Follow the instructions for setting up the virtual environment:
Step 1:
Ensure you are in the BackEndFlask directory by running
the command:
cd BackEndFlask
Step 2:
Create the virtual environment by running the command:
python3 -m venv BackEndFlaskVenv
Step 3:
Activate the virtual environment by running the command:
source BackEndFlaskVenv/bin/activate
To Deactivate the virtual environment, run the command:
deactivate
To Remove the virtual environment, run the command:
rm -r BackEndFlaskVenv
- In order to setup the environment for the first time,
you will need to be in the `/rubricapp/BackEndFlask/`
directory and run the following command:
python3 setupEnv.py -id
- This command will install all the requirements from
requirements.txt, create a new database, and load
the database with demo data.
Flag Meanings:
- `-i` install
- `-d` demo
NOTE:
- If you DO NOT run the above command with the
`-i` and `-d` flags once, then the Back End server
WILL NOT be initialized properly. If the Back End
server is NOT initialized properly, then the Back
End server WILL NOT run. IF the Back End server
is NOT running, then the Front End server WILL NOT
run properly either.
- In the case where you want to restart with a fresh
new database, add the flag `-r` to reset the existing
database. You WILL then have to rerun the command with
the `-d` flag to load demo data.
## Setting up the Front End environment: ##
- Follow the link for instructions on downloading Node.js:
https://nodejs.org/en/download
- In order to install the required packages you WILL need
to be in the directory `/rubricapp/FrontEndReact/`.
- Inside the Front End React directory run the following
command to install all the Node packages for the project:
npm install
NOTE:
- If you run `npm install` outside of the
`/rubricapp/FrontEndReact/` directory, it WILL cause
issues.
- In the case where you run `npm install` outside
of the `/rubricapp/FrontEndReact/` directory,
simply remove the created files `package.json` and
`package-lock.json` and the directory `node_modules`.
Ensure that you have correctly changed the current
working directory to `/rubricapp/FrontEndReact/`
before attempting to run the command to install
the Node packages.
## Running the Servers after setup: ##
NOTE:
- You WILL need to run the Back End server first,
the Redis server second, then the Front End server
third.
- You WILL need to run the Back End, Redis, and
Front End servers in different terminal windows.
## Running the Back End server of the application: ##
- Use the following command for running the Back End
server in the `/rubricapp/BackEndFlask/` directory
during regular use:
python3 setupEnv.py -s
Flag meaning:
- `-s` start
## Running the Redis server: ##
- Use the following command for running the Redis server:
brew services start redis
NOTE:
- Run the following command to restart redis with
Homebrew:
brew services restart redis
- Run the following command to stop redis with
Homewbrew:
brew services stop redis
## Running the Front End server of the application: ##
- Use the following command for running the Front End
Server in the `/rubricapp/FrontEndReact/` directory:
npm start
- This command runs the Front End server in development mode.
Open http://localhost:3000 or http://127.0.0.1:3000 to view
it in your browser.
- Any changes made in the `/rubricapp/FrontEndReact/`
directory will be caught by the running Front End
server, thus rerendering any opened tabs in your
browser.
- You will also be able to see any compile warnings
and errors in the console.
## Running Pytest: ##
- For running pytests on the Back End server
you will use the following command:
python3 setupEnv.py -t
Flag meaning:
- `-t` test
## Running Jest tests: ##
- For running Jest tests on the Front End server
you will use the following command:
npm test
- This command launches the test runner in the interactive
watch mode. Make sure the version of react is
'[email protected]' or higher.
- Here is a link for learning more information about running tests:
https://facebook.github.io/create-react-app/docs/running-tests