Skip to content

Commit

Permalink
Merge branch 'master' into jxl9/achievements-tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
neketka committed Apr 28, 2024
2 parents a285a1a + 59e48d0 commit 4ba5767
Show file tree
Hide file tree
Showing 149 changed files with 4,308 additions and 3,285 deletions.
10 changes: 9 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Docker: Attach to Node",
"localRoot": "${workspaceFolder}/server",
"remoteRoot": "/app/server",
"port": 9229
},
{
"name": "game",
"cwd": "game",
Expand All @@ -25,4 +33,4 @@
"flutterMode": "release"
}
]
}
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ To access the Google Maps in the CornellGo app, you need two Google Maps API Key
docker compose up --build
```

### Run project with backend hot reloading

```
docker compose watch
If you want to see logging, run the following in a different terminal:
docker compose logs --follow
Or look at your docker desktop app
```

### Start the container in the background

```
Expand Down Expand Up @@ -50,6 +60,12 @@ npx prisma studio
npm run updateapi
```

### Format all code files

```
npm run formatall
```

### Start the frontend (for debugging)

```
Expand Down
Binary file modified admin/public/favicon.ico
Binary file not shown.
62 changes: 33 additions & 29 deletions admin/src/all.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ export interface RequestAchievementDataDto {

export interface LoginDto {
idToken: string;
lat: number;
long: number;
noRegister: boolean;
latF?: number;
longF?: number;
username?: string;
year?: string;
college?: string;
major?: string;
interests?: string;
aud?: LoginAudDto;
enrollmentType: LoginEnrollmentTypeDto;
}
Expand Down Expand Up @@ -149,26 +153,16 @@ export interface SetCurrentChallengeDto {
challengeId: string;
}

export interface LeaderDto {
userId: string;
username: string;
score: number;
}

export interface UpdateLeaderDataDto {
eventId: string;
offset: number;
users: LeaderDto[];
}

export interface UpdateErrorDto {
id: string;
message: string;
}

export interface RequestAllEventDataDto {
offset: number;
count: number;
export interface RequestFilteredEventsDto {
difficulty: string[];
location: string[];
category: string[];
filterId: string[];
}

export interface RequestEventDataDto {
Expand All @@ -178,6 +172,25 @@ export interface RequestEventDataDto {
export interface RequestEventLeaderDataDto {
offset: number;
count: number;
eventId?: string;
}

export interface LeaderDto {
userId: string;
username: string;
score: number;
}

export interface UpdateLeaderDataDto {
eventId?: string;
offset: number;
users: LeaderDto[];
}

export interface UpdateLeaderPositionDto {
playerId: string;
newTotalScore: number;
newEventScore: number;
eventId: string;
}

Expand Down Expand Up @@ -290,18 +303,6 @@ export interface UpdateOrganizationDataDto {

export interface CloseAccountDto {}

export interface SetUsernameDto {
newUsername: string;
}

export interface SetMajorDto {
newMajor: string;
}

export interface SetGraduationYearDto {
newYear: string;
}

export interface BanUserDto {
userId: string;
isBanned: boolean;
Expand Down Expand Up @@ -338,6 +339,9 @@ export interface UserDto {
enrollmentType?: UserEnrollmentTypeDto;
email?: string;
year?: string;
college?: string;
major?: string;
interests?: string[];
score?: number;
isBanned?: boolean;
groupId?: string;
Expand Down
4 changes: 3 additions & 1 deletion admin/src/components/Challenges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ function toForm(challenge: ChallengeDto) {
{
name: "Image URL",
characterLimit: 2048,
value: challenge.imageUrl ?? "",
value:
challenge.imageUrl ??
"https://upload.wikimedia.org/wikipedia/commons/b/b1/Missing-image-232x150.png",
},
{
name: "Awarding Distance (meters)",
Expand Down
15 changes: 11 additions & 4 deletions admin/src/components/ServerApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export class ServerApi {
this.send("completedChallenge", data);
}

requestGlobalLeaderData(data: dto.RequestGlobalLeaderDataDto) {
this.send("requestGlobalLeaderData", data);
}

updateChallengeData(data: dto.UpdateChallengeDataDto) {
this.send("updateChallengeData", data);
}
Expand All @@ -41,6 +37,10 @@ export class ServerApi {
this.send("requestEventData", data);
}

requestFilteredEventIds(data: dto.RequestFilteredEventsDto) {
this.send("requestFilteredEventIds", data);
}

requestRecommendedEvents(data: dto.RequestRecommendedEventsDto) {
this.send("requestRecommendedEvents", data);
}
Expand Down Expand Up @@ -189,4 +189,11 @@ export class ServerApi {
this.socket.removeAllListeners("updateOrganizationData");
this.socket.on("updateOrganizationData", (data) => callback(data));
}

onUpdateLeaderPosition(
callback: (data: dto.UpdateLeaderPositionDto) => void
) {
this.socket.removeAllListeners("updateLeaderPosition");
this.socket.on("updateLeaderPosition", (data) => callback(data));
}
}
2 changes: 2 additions & 0 deletions admin/src/components/ServerConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export function ServerConnectionProvider(props: { children: ReactNode }) {
lat: 1,
long: 1,
username: "guest",
college: "Arts and Sciences",
major: "Computer Science",
year: "2025",
interests: "",
aud: "web",
enrollmentType: "UNDERGRADUATE",
});
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
server:
ports:
- "8080:80"
- "9229:9229"
environment:
NO_SSL: true
DEVELOPMENT: true
Expand All @@ -35,6 +36,15 @@ services:
postgres:
condition: service_healthy
build: .
develop:
watch:
- action: sync
path: ./server/
target: /app/server/
ignore:
- node_modules/
- action: rebuild
path: server/package.json
networks:
- reference
networks:
Expand Down
42 changes: 25 additions & 17 deletions game/android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@
"certificate_hash": "d6e7da6b98f7884510d3826068e668c5bb7ec89b"
}
},
{
"client_id": "757523123677-mdis2048vo39u7bjg7rjtm9r28a1tsto.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.CornellGO",
"certificate_hash": "48942102c610163af43caab359452832e7bdc189"
}
},
{
"client_id": "757523123677-s7lm7n8b1vmppnh92pige13uvp722jma.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.CornellGO",
"certificate_hash": "e8ec9df2de92f3ff018926aba9448be15c464a4e"
}
},
{
"client_id": "757523123677-2nv6haiqnvklhb134cgg5qe8bia4du4q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDSKPt3T-sBGcaS5vQGw-FDkgOBTryxhUQ"
"current_key": "AIzaSyCNuTQ0eTjwXde0NMNMFaO6c3u5AYlNiXA"
},
{
"current_key": "AIzaSyBBGoQlbjlNCBfxiob-mkm1TCougaHqcu4"
Expand All @@ -42,10 +58,10 @@
"client_type": 3
},
{
"client_id": "757523123677-cso74eimkjqkcuce69nrf4c637k3db6t.apps.googleusercontent.com",
"client_id": "757523123677-5uct36sksguq3v4ngeec8ofc31ipf8hl.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.cornellgo.game"
"bundle_id": "com.cornellgo.CornellGO"
}
}
]
Expand All @@ -61,19 +77,11 @@
},
"oauth_client": [
{
"client_id": "757523123677-lhftm1kuh7k0uqkhc62d378um4nb5e3g.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.game",
"certificate_hash": "d6e7da6b98f7884510d3826068e668c5bb7ec89b"
}
},
{
"client_id": "757523123677-q8o2d3tahsmm9i68j1sf33ka49qsgalq.apps.googleusercontent.com",
"client_id": "757523123677-q8lt36h21g5kcmvvqe07f5krldkb4k4i.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.game",
"certificate_hash": "98efe77cdeb1f8f17e7c3634a8700ae7361aaa08"
"certificate_hash": "e8ec9df2de92f3ff018926aba9448be15c464a4e"
}
},
{
Expand All @@ -83,7 +91,7 @@
],
"api_key": [
{
"current_key": "AIzaSyDSKPt3T-sBGcaS5vQGw-FDkgOBTryxhUQ"
"current_key": "AIzaSyCNuTQ0eTjwXde0NMNMFaO6c3u5AYlNiXA"
},
{
"current_key": "AIzaSyBBGoQlbjlNCBfxiob-mkm1TCougaHqcu4"
Expand All @@ -97,10 +105,10 @@
"client_type": 3
},
{
"client_id": "757523123677-cso74eimkjqkcuce69nrf4c637k3db6t.apps.googleusercontent.com",
"client_id": "757523123677-5uct36sksguq3v4ngeec8ofc31ipf8hl.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.cornellgo.game"
"bundle_id": "com.cornellgo.CornellGO"
}
}
]
Expand All @@ -109,4 +117,4 @@
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion game/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application android:label="CornellGO!" android:icon="@mipmap/ic_launcher">
<application android:label="CornellGO!" android:icon="@mipmap/launcher_icon">

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="@string/ANDROID_MAP_API_KEY" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions game/assets/icons/Podium1stRed.svg

This file was deleted.

10 changes: 0 additions & 10 deletions game/assets/icons/Podium2ndRed.svg

This file was deleted.

12 changes: 0 additions & 12 deletions game/assets/icons/Podium3rdRed.svg

This file was deleted.

Loading

0 comments on commit 4ba5767

Please sign in to comment.