Skip to content

Commit

Permalink
user and friend endpoints (#851)
Browse files Browse the repository at this point in the history
* 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 <raiyan.ahmed@gmail.com>
Co-authored-by: Raiyan Ahmed <80839724+Rayahhhmed@users.noreply.github.com>
Co-authored-by: Shaam <shaamjevan.sj@gmail.com>
  • Loading branch information
4 people committed Aug 31, 2024
1 parent 03fc031 commit baa8bca
Show file tree
Hide file tree
Showing 26 changed files with 11,303 additions and 946 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ typings/

# dotenv environment variables file
.env
.env.dev
.env.prod

# next.js build output
.next
Expand Down
1 change: 0 additions & 1 deletion client/src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ const API_CONFIG: Record<string, Config> = Object.freeze({
[Env.MOCK]: { timetable: `${LIVE}/api`, auto: `${LOCAL}/api/auto`, server: `${LOCAL}/api` },
[Env.PROD]: { timetable: `${LIVE}/api`, auto: `/api/auto`, server: `/api` },
});

export const API_URL: Config = API_CONFIG[import.meta.env.VITE_APP_ENVIRONMENT || Env.DEV];
2 changes: 1 addition & 1 deletion client/src/components/sidebar/UserAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountCircle, LoginRounded, LogoutRounded } from '@mui/icons-material';
import { Button, Dialog, IconButton, Tooltip } from '@mui/material';
import { Button, IconButton, Tooltip } from '@mui/material';
import { styled } from '@mui/system';
import React, { useEffect, useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/timetableHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const duplicateClasses = (selectedClasses: SelectedClasses) => {
const duplicateEvents = (oldEvents: CreatedEvents) => {
const newEvents: CreatedEvents = {};

Object.entries(oldEvents).forEach(([code, period]) => {
Object.entries(oldEvents).forEach(([_, period]) => {
const newEvent = createEventObj(
period.event.name,
period.event.location,
Expand Down
4 changes: 3 additions & 1 deletion server/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ services:
container_name: notangles-server
image: notangles-server
restart: always
build: .
build:
context: .
dockerfile: Dockerfile
depends_on:
- database
ports:
Expand Down
Loading

0 comments on commit baa8bca

Please sign in to comment.