Skip to content

Commit baa8bca

Browse files
M7s7RayahhhmedShzmj
authored
user and friend endpoints (#851)
* oidc tests * added nestjs support with auto timetabling * added nestjs support with auto timetabling * removing controller test files for main app * testing out no frozen lockfile for docker image * Update ci.yml * added the old endpoints: Auth user, prisma and user as well as the protobuf auto endpoints * TLS error potentially caused by UNSW IT not renewing cert * updating dockerignore to ignore extra bloat and gitignore to ignore migrations for prisma. * Updated format for files * Prisma migration removed for now * added example env files * Add PUT user/profile endpoint, and complete PUT user settings endpoint * Complete POST timetable endpoint * Edit timetable endpoint completed (not tested though lol - will do later): * GET profile endpoint fixed and completed * Complete GET settings endpoint * GET timetable is working now * Delete timetable endpoint completed * added better mapping for sql name convention * Add friend/unfriend endpoints * Add friends get req * Friend request endpoints completed * added groups endpoints * group post merged * added seed script * added seed script * adding some minor changes with source copying * seed file was causing crashes * testing out types * adding ci prisma gen * User profile endpoint * Completed edit timetable endpoint, simplified create timetable endpoint: * Slowly piecing together framework for mocking prisma client and testing; also fixed inconsistencies with merge of endpoints; also this is painful * test: Removed unit tests as they are quite useless for db testing; replaced with integration testing. Basic user tests have been written, will continue later * minor changes to schema/dtos, and finished user tests * test: add friends tests * test refactored * refactor: remove all class data and fields, and add classNo property * Change schema and interfaces to give enough data to reconstruct. Also added helper func to call scraper public endpoint * Inital implementation of scraper data makes my eyes want to explode * fix: get user endpoint properly fetches timetables, and get timetables endpoint modified to accomodate multiple userids * test: update tests to work with returned scraped class data * style: added linting for server + linted client and server * chore: remove comments * chore: add class time DTO; clean up codebase * refactor: add reconstructed timetable creation method * schema: change terms to string, remove term enum * style: remove unused comments --------- Co-authored-by: ray <[email protected]> Co-authored-by: Raiyan Ahmed <[email protected]> Co-authored-by: Shaam <[email protected]>
1 parent 03fc031 commit baa8bca

26 files changed

+11303
-946
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ typings/
6666

6767
# dotenv environment variables file
6868
.env
69+
.env.dev
70+
.env.prod
6971

7072
# next.js build output
7173
.next

client/src/api/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ const API_CONFIG: Record<string, Config> = Object.freeze({
2020
[Env.MOCK]: { timetable: `${LIVE}/api`, auto: `${LOCAL}/api/auto`, server: `${LOCAL}/api` },
2121
[Env.PROD]: { timetable: `${LIVE}/api`, auto: `/api/auto`, server: `/api` },
2222
});
23-
2423
export const API_URL: Config = API_CONFIG[import.meta.env.VITE_APP_ENVIRONMENT || Env.DEV];

client/src/components/sidebar/UserAccount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AccountCircle, LoginRounded, LogoutRounded } from '@mui/icons-material';
2-
import { Button, Dialog, IconButton, Tooltip } from '@mui/material';
2+
import { Button, IconButton, Tooltip } from '@mui/material';
33
import { styled } from '@mui/system';
44
import React, { useEffect, useState } from 'react';
55

client/src/utils/timetableHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const duplicateClasses = (selectedClasses: SelectedClasses) => {
3838
const duplicateEvents = (oldEvents: CreatedEvents) => {
3939
const newEvents: CreatedEvents = {};
4040

41-
Object.entries(oldEvents).forEach(([code, period]) => {
41+
Object.entries(oldEvents).forEach(([_, period]) => {
4242
const newEvent = createEventObj(
4343
period.event.name,
4444
period.event.location,

server/docker-compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ services:
44
container_name: notangles-server
55
image: notangles-server
66
restart: always
7-
build: .
7+
build:
8+
context: .
9+
dockerfile: Dockerfile
810
depends_on:
911
- database
1012
ports:

0 commit comments

Comments
 (0)