Skip to content

Commit d077a32

Browse files
merge-rebase w main
2 parents 4436fdf + 0adf391 commit d077a32

16 files changed

Lines changed: 1124 additions & 604 deletions

README.md

Lines changed: 131 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Course-Compass
22
## by team [Inference](https://inferencekth.github.io/Course-Compass/)
3-
Course-Compass is a webpage for interacting with the kth courses via the kth api. It allows for searching and filtering through all active courses.
3+
Course-Compass is an interactive web application for exploring KTH courses. It allows users to search, filter, and review courses while providing prerequisite visualization and personalized recommendations. The application uses Firebase for data storage and real-time updates.
4+
5+
6+
## Features
7+
- Course search with advanced filtering
8+
- Course reviews and ratings
9+
- Interactive prerequisite visualization
10+
- Transcript upload for eligibility checking
11+
- Personal course favorites
12+
- Dark/Light mode support
413

514
## How to run
615

@@ -19,7 +28,6 @@ docker-compose up
1928
```
2029
builds and starts the container.
2130

22-
2331
### Building with NPM
2432
After downloading the repository navigate to the folder my-app and install the dependencies with
2533

@@ -36,9 +44,127 @@ for production use
3644
npm run build
3745
```
3846

47+
## Environment Setup
48+
49+
### Firebase Configuration
50+
This project uses Firebase for backend services. To set up your development environment:
51+
52+
Update the api keys in firebase.js to your keys.
53+
54+
```js
55+
const firebaseConfig = {
56+
apiKey: "",
57+
authDomain: "",
58+
databaseURL:"",
59+
projectId: "",
60+
storageBucket: "",
61+
messagingSenderId: "",
62+
appId: "",
63+
};
64+
```
65+
66+
### Database Population
67+
To populate the Firebase database with course data:
68+
69+
1. Use the JSON file in `/src/assets/example.json` or prepare a file according to the following outline:
70+
```json
71+
{
72+
"courseCode": {
73+
"code": "string",
74+
"name": "string",
75+
"location": "string",
76+
"department": "string",
77+
"language": "string",
78+
"description": "string",
79+
"academic_level": "string",
80+
"periods": "array",
81+
"credits": "number",
82+
"prerequisites": "object",
83+
"prerequisites_text": "string",
84+
"learning_outcomes": "string"
85+
}
86+
}
87+
```
88+
89+
2. Use the `model.populateDatabase(data)` function to upload courses:
90+
```javascript
91+
import data from "./assets/example.json";
92+
model.populateDatabase(data);
93+
```
94+
95+
### Firebase Security Rules
96+
<details>
97+
<summary>Click to view Firebase Rules</summary>
98+
99+
```json
100+
{
101+
"rules": {
102+
"courses": {
103+
".read": true,
104+
".write": "auth != null && (auth.uid === 'adminuid' || auth.uid === 'adminuid')"
105+
},
106+
"metadata": {
107+
".read": true,
108+
".write": "auth != null && (auth.uid === 'adminuid' || auth.uid === 'adminuid')"
109+
},
110+
"departments": {
111+
".read": true,
112+
".write": "auth != null && (auth.uid === 'adminuid' || auth.uid === 'adminuid')"
113+
},
114+
"locations": {
115+
".read": true,
116+
".write": "auth != null && (auth.uid === 'adminuid' || auth.uid === 'adminuid')"
117+
},
118+
"reviews": {
119+
".read": true,
120+
"$courseCode": {
121+
"$userID": {
122+
".write": "auth != null && (auth.uid === $userID || data.child('uid').val() === auth.uid || !data.exists())",
123+
".validate": "newData.hasChildren(['text', 'timestamp']) && newData.child('text').isString() && newData.child('timestamp').isNumber()"
124+
}
125+
}
126+
},
127+
"users": {
128+
"$userID": {
129+
".read": "auth != null && auth.uid === $userID",
130+
".write": "auth != null && auth.uid === $userID"
131+
}
132+
}
133+
}
134+
}
135+
```
136+
</details>
137+
138+
To deploy these rules:
139+
```bash
140+
firebase deploy --only database
141+
```
142+
143+
### ⚠️ Security Notes
144+
- Never commit `.env.local` to version control
145+
- Keep your Firebase credentials secure
146+
- Contact the team lead if you need access to the Firebase configuration
147+
39148
## Project structure
40-
The project uses the **[Model–view–presenter (MVP)](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter)** paradime. The view displays the data. The presenter contains the logic. The model contains the data.
149+
The project uses the **[Model–view–presenter (MVP)](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter)** paradigm. The view displays the data. The presenter contains the logic. The model contains the data.
150+
151+
### Key Components
152+
- **/src/model.js**: Core data model and business logic
153+
- **/src/views/**: UI components and layouts
154+
- **/src/presenters/**: Interface between Model and View
155+
- **/src/scripts/**: Utility scripts including transcript parsing
156+
- **/src/assets/**: Static resources and images
157+
158+
### Development Components
159+
- **/src/dev/**: Development utilities and component previews
160+
- **/src/presenters/Tests/**: Test implementations
161+
- **/scripts/transcript-scraper/**: Transcript parsing tools
162+
163+
164+
### Project Tree
41165

166+
<details>
167+
<summary>Click to view Project Tree</summary>
42168

43169
```
44170
.
@@ -153,10 +279,11 @@ The project uses the **[Model–view–presenter (MVP)](https://en.wikipedia.org
153279
21 directories, 87 files
154280
```
155281

282+
</details>
156283

157284
## Other branches
158285

159-
The **[docs](https://github.com/InferenceKTH/Course-Compass/tree/kth-api)** branch contains the team website.
286+
The **[docs](https://github.com/InferenceKTH/Course-Compass/tree/docs)** branch contains the team website.
160287

161288
The **[kth-api](https://github.com/InferenceKTH/Course-Compass/tree/kth-api)** contains most of the tools used for gathering and processing the course info.
162289

my-app/.gitignore

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,45 @@ yarn-debug.log*
66
yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
9+
10+
# Dependencies
911
/node_modules
10-
.firebase
12+
/.pnp
13+
.pnp.js
14+
/.firebase
15+
16+
# Testing
17+
/coverage
1118

12-
node_modules
13-
dist
19+
# Production
20+
/build
21+
/dist
1422
dist-ssr
1523
*.local
1624

25+
# Environment Variables
26+
.env
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
1732
# Editor directories and files
1833
.vscode/*
1934
!.vscode/extensions.json
2035
.idea
21-
.DS_Store
2236
*.suo
2337
*.ntvs*
2438
*.njsproj
2539
*.sln
2640
*.sw?
2741

42+
# OS generated files
43+
.DS_Store
44+
.DS_Store?
45+
._*
46+
.Spotlight-V100
47+
.Trashes
48+
ehthumbs.db
49+
Thumbs.db
50+

0 commit comments

Comments
 (0)