Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #414

Merged
merged 135 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
fe1e94f
⤴️3 Dependencies updated, added coverage to .gitignore
Divergent-Caesar Sep 25, 2024
42e20a9
extention of previous commit
Divergent-Caesar Sep 25, 2024
aecd56c
Merge branch 'feat/dependencyEval' into temp
Divergent-Caesar Sep 25, 2024
6f06b1a
Merge pull request #368 from COS301-SE-2024/temp
Divergent-Caesar Sep 25, 2024
a17f139
📐Refactor insights component HTML to use full viewport height and width
21434809 Sep 25, 2024
7af5128
📐Refactor settings component HTML
21434809 Sep 25, 2024
d23eed6
updated dependencies
Divergent-Caesar Sep 25, 2024
7be326b
Merge pull request #371 from COS301-SE-2024/feat/settingsPageGridUpdate
21434809 Sep 25, 2024
87623fe
Merge pull request #369 from COS301-SE-2024/feat/insightsLayoutFix
21434809 Sep 25, 2024
7723673
Merge pull request #372 from COS301-SE-2024/feat/dependencyEval
Divergent-Caesar Sep 25, 2024
a36ecda
Merge pull request #374 from COS301-SE-2024/feat/AIOptimisation
MariePretorius Sep 25, 2024
5fdbc91
Merge pull request #376 from COS301-SE-2024/develop
Divergent-Caesar Sep 25, 2024
21ea779
📐Update API endpoint for get_recommendations in SpotifyService
21434809 Sep 25, 2024
557c478
Merge pull request #377 from COS301-SE-2024/feat/aiURLupdate
21434809 Sep 25, 2024
66d6d96
📐Adjusted padding and background colours
Douglasj02 Sep 25, 2024
0c2ca1f
📐Adjusted background colour for top results on profile page
Douglasj02 Sep 25, 2024
1de5feb
📐Adjusted insights div positioning
Douglasj02 Sep 25, 2024
cc3113f
📐Update grid layout to make left sidenave static
21434809 Sep 25, 2024
9d35b39
🎉new expandable icon
21434809 Sep 25, 2024
cc140af
📐updated side bar - and nav bar Sizeing
21434809 Sep 25, 2024
9044d32
📐Updated moods lists to AI moods list
21434809 Sep 25, 2024
3a4a915
🚀Added new moods to moodColorsList
21434809 Sep 25, 2024
23a538d
📐Refactor moodClasses to match main moods
21434809 Sep 25, 2024
433e98c
🔥removed backgroundMoodClasses
21434809 Sep 25, 2024
8a1262c
📐Refactored settings page too use moods service
21434809 Sep 25, 2024
13c03a6
📐Updated tailwind config and fixed underline issue
21434809 Sep 25, 2024
77fa25f
📐Updated mood filter buttons on home
21434809 Sep 26, 2024
423306b
📐Updated moodFilterButons Again includes underline
21434809 Sep 26, 2024
d136414
🚀Update base font size in styles.css too 75%
21434809 Sep 26, 2024
18a837d
Merge pull request #378 from COS301-SE-2024/feat/navBarFixed
21434809 Sep 26, 2024
2328685
Merge branch 'develop' into feat/defineFineTuneComponentsColors
21434809 Sep 26, 2024
609b600
Merge pull request #379 from COS301-SE-2024/feat/defineFineTuneCompon…
21434809 Sep 26, 2024
577459e
🚀fix side nav color
21434809 Sep 26, 2024
4db60c8
📐Refactor side bar component HTML - merge issue
21434809 Sep 26, 2024
3c1e07f
Merge pull request #380 from COS301-SE-2024/feat/defineFineTuneCompon…
21434809 Sep 26, 2024
f67f0b6
📐Refactor login component HTML
21434809 Sep 26, 2024
89039b3
📐Refactor register component HTML
21434809 Sep 26, 2024
5202b72
🚀Refactor login and register component HTML - Update sign up and logi…
21434809 Sep 26, 2024
2abe003
🔰Backend Tests all passing locally.
Divergent-Caesar Sep 26, 2024
2c23428
🔰Removed unnecessary imports that were breaking tests in actions
Divergent-Caesar Sep 26, 2024
2158b4e
🚀Refactor HTML buttons in login and register components' footer
21434809 Sep 26, 2024
901db85
Merge pull request #381 from COS301-SE-2024/feat/defineFineTuneCompon…
21434809 Sep 26, 2024
8f89084
📐Refactor big-rounded-square-card component HTML and TypeScript
21434809 Sep 26, 2024
f559f60
📐Refactor moods-list component HTML - Adjust styling and indentation
21434809 Sep 26, 2024
1cf9ac9
📐Refactor big-rounded-square-card component HTML - Remove unnecessary…
21434809 Sep 26, 2024
3b35bc5
📐Refactor grid layout in app component HTML again
21434809 Sep 26, 2024
fa70493
📐Refactor back-button component HTML and TypeScript
21434809 Sep 26, 2024
3b10d71
📐Refactor mood component HTML and TypeScript - Update back button sty…
21434809 Sep 26, 2024
3532e56
📐Refactor classifyMood function in SpotifyService for new ai moods
21434809 Sep 26, 2024
d964f33
📐Refactor mood component HTML - Update album text color and size
21434809 Sep 26, 2024
142f465
Refactor insights component HTML - Update background colors and remov…
21434809 Sep 26, 2024
218866e
Merge pull request #384 from COS301-SE-2024/feat/accentsBackground
21434809 Sep 26, 2024
5bb2930
🚀Added endpoints to get tracks based on mood
Douglasj02 Sep 26, 2024
e0f59e6
:triangular_ruler: Updated endpoint to get tracks by mood
Douglasj02 Sep 26, 2024
4cbc062
📐Limited response to 10 per mood
Douglasj02 Sep 26, 2024
9196ac7
🚀Added methods to get tracks by mood in frontend search service
Douglasj02 Sep 26, 2024
9245984
:rocket: Integrated tracks for moods
Douglasj02 Sep 26, 2024
96b7624
Merge branch 'develop' into feat/highFrontendUpdate
Douglasj02 Sep 26, 2024
de4e1fc
Merge pull request #389 from COS301-SE-2024/feat/highFrontendUpdate
21434809 Sep 26, 2024
b821e45
📐Refactor HTML files - Remove unnecessary styles and update backgroun…
21434809 Sep 26, 2024
156a22a
Merge pull request #390 from COS301-SE-2024/feat/moodEndpoints
21434809 Sep 26, 2024
52ba53c
Merge branch 'develop' into feat/accentsBackground
21434809 Sep 26, 2024
92abb0e
:triangular_ruler: Integrated mood songs with player
Douglasj02 Sep 26, 2024
6ababbc
Merge pull request #391 from COS301-SE-2024/feat/accentsBackground
Douglasj02 Sep 26, 2024
22b2484
Merge pull request #392 from COS301-SE-2024/feat/moodEndpoints
Douglasj02 Sep 26, 2024
6d99d6a
📐Refactor echo-song component HTML - Update background styles and add…
21434809 Sep 26, 2024
daf88e0
📐Refactor search component CSS and HTML - Remove scrollbar styles and…
21434809 Sep 26, 2024
df1cda9
📐Refactor CSS files - Remove scrollbar styles and update background c…
21434809 Sep 26, 2024
04f439d
📐Refactor bottom player component CSS and HTML - Update range input s…
21434809 Sep 26, 2024
a0c9825
Merge pull request #393 from COS301-SE-2024/feat/accentsBackground
21434809 Sep 27, 2024
b830862
📐Refactor play-icon and song-cards components🎉and play icon on song view
21434809 Sep 27, 2024
f80154e
📐Refactor play-icon component to conditionally set current mood
21434809 Sep 27, 2024
3d2a4e2
📐Refactor mood component HTML - Update page title binding
21434809 Sep 27, 2024
2d186da
📐Refactor sidebar component to toggle visibility with expandable icon
21434809 Sep 27, 2024
8093a75
Merge pull request #399 from COS301-SE-2024/feat/accentsBackground
21434809 Sep 27, 2024
023d261
📐Refactor mood component HTML - Update album art display
21434809 Sep 27, 2024
2d0fcbb
Merge branch 'develop' into feat/accentsBackground
21434809 Sep 27, 2024
f7305e6
Merge pull request #400 from COS301-SE-2024/feat/accentsBackground
21434809 Sep 27, 2024
3cc42eb
📐Refactor login component and routes
21434809 Sep 27, 2024
1547ad2
fixed footer
21434809 Sep 27, 2024
b47c060
📐Refactor mobile login component HTML and styles
21434809 Sep 27, 2024
422206b
🔥removed old login
21434809 Sep 27, 2024
a2ad283
🚀 make route div align with player
zionvanwyk Sep 27, 2024
f9af39d
📐Refactor register and login components for mobile
21434809 Sep 27, 2024
b6641f6
📐Refactor mobile register component HTML and styles
21434809 Sep 27, 2024
55d1c1f
Refactor mobile register component HTML and styles
21434809 Sep 27, 2024
559c280
🔰 Test fro frontend all passing locally
Divergent-Caesar Sep 27, 2024
12b8eab
🎉 added 3-dot menu to moods
zionvanwyk Sep 27, 2024
d6328dc
🔰 fixed errors hopefully
Divergent-Caesar Sep 27, 2024
956740d
🚀 moved and reworked menu
zionvanwyk Sep 27, 2024
198d9de
Merge pull request #402 from COS301-SE-2024/feat/mobileInterface
21434809 Sep 27, 2024
06486ce
📐Refactor app.routes.ts and add HomesComponent for mobile home view
21434809 Sep 27, 2024
cec1214
🚀 improve moods page layout
zionvanwyk Sep 27, 2024
0848ad2
🚀 edit mood colours in config
zionvanwyk Sep 27, 2024
2aceee0
🚀 update mood service to match changes
zionvanwyk Sep 27, 2024
db7eac0
🚀 made profile cards vertically stacked
zionvanwyk Sep 27, 2024
aee80e3
Merge pull request #405 from COS301-SE-2024/develop
Divergent-Caesar Sep 27, 2024
4d66ac8
🔰Updated imports
Divergent-Caesar Sep 27, 2024
82dff97
🚀 fixed explore bar alignment
zionvanwyk Sep 27, 2024
5722030
🚀 make song cards transparent
zionvanwyk Sep 27, 2024
e5d2c98
Merge pull request #403 from COS301-SE-2024/feat/moodsMenu
zionvanwyk Sep 27, 2024
e9c00d3
💪Fixed play button first click bug
Douglasj02 Sep 27, 2024
85512b8
🚀 improve user library UI
zionvanwyk Sep 27, 2024
a50b6e0
🚀 lots of small styling improvements
zionvanwyk Sep 27, 2024
5c94aaa
:rocket: Mapped mood song responses to updated moods
Douglasj02 Sep 27, 2024
c3c01f2
🔰 More tests added
Divergent-Caesar Sep 27, 2024
8cd760a
:rocket: Updated get songs by mood to return an image URL for the mood
Douglasj02 Sep 27, 2024
0bf2fb8
🔰more tests
Divergent-Caesar Sep 27, 2024
3967a92
Merge pull request #406 from COS301-SE-2024/feat/userLibraryImprovement
zionvanwyk Sep 28, 2024
261e768
Merge pull request #383 from COS301-SE-2024/stablization
Divergent-Caesar Sep 28, 2024
96cdb4d
📐Refactor big-rounded-square-card component added mouseLeave event
21434809 Sep 28, 2024
66076a4
🔰 Tests for navbarcomponent
Divergent-Caesar Sep 28, 2024
0c1a641
🔰 moar tests
Divergent-Caesar Sep 28, 2024
c41ebc9
📐Refactor app.component.html for responsive layout
21434809 Sep 28, 2024
f8a1885
🔰 moar tests
Divergent-Caesar Sep 28, 2024
55a9279
🔰 More-er tests
Divergent-Caesar Sep 28, 2024
76ea992
:rocket: Added imageUrl's for suggestedMoods
Douglasj02 Sep 28, 2024
4a5f3c6
📐Refactor mobile view layout in app.component.html
21434809 Sep 28, 2024
9224c9d
:rocket: Updated frontend mood components to use imageUrl response fr…
Douglasj02 Sep 28, 2024
a548b24
📐Refactor bottom-nav component CSS and TypeScript files
21434809 Sep 28, 2024
59cc087
📐Refactor responsive layout and styles for mobile view
21434809 Sep 28, 2024
6aef1e5
🚧Refactor mood component and mobile home template
21434809 Sep 28, 2024
8c5c06d
🚧Refactor side-bar and mobile home template
21434809 Sep 28, 2024
f239ef5
🚧Refactor mobile view layout in app.component.html
21434809 Sep 28, 2024
6614722
Merge branch 'develop' into feat/mobileInterface
21434809 Sep 28, 2024
b0e291c
📐Refactor big-rounded-square-card.component.html and readded menu on …
21434809 Sep 29, 2024
a74d8f4
🔰 aaaaahhhhhh
Divergent-Caesar Sep 29, 2024
15e3505
Merge pull request #408 from COS301-SE-2024/feat/mobileInterface
21434809 Sep 29, 2024
0ff220b
Merge branch 'develop' into feat/minorFixes
21434809 Sep 29, 2024
45b17d2
Merge pull request #409 from COS301-SE-2024/feat/minorFixes
Douglasj02 Sep 29, 2024
5a04af9
🔰 AAAHHH
Divergent-Caesar Sep 29, 2024
c144ca9
Merge branch 'develop' into feat/bugFixes
21434809 Sep 29, 2024
ab65fde
📐Refactor MoodsComponent to implement OnInit and OnDestroy interfaces
21434809 Sep 29, 2024
d3ddb21
Merge pull request #407 from COS301-SE-2024/feat/bugFixes
21434809 Sep 29, 2024
1cba122
Merge pull request #412 from COS301-SE-2024/stablization
Divergent-Caesar Sep 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dist-ssr
*.sln
*.sw?
.prettierrc

Frontend/coverage
.env
*.base64
Frontend/coverage
12 changes: 12 additions & 0 deletions Backend/jest-int.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".int-spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"moduleNameMapper": {
"src/(.*)": "<rootDir>/src/$1"
}
}
1 change: 1 addition & 0 deletions Backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:int": "jest -i --no-cache --watch --config jest-int.json",
"coveralls": "cat coverage/lcov.info | coveralls"
},
"dependencies": {
Expand Down
103 changes: 44 additions & 59 deletions Backend/src/app.module.spec.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,54 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AppModule } from './app.module';
import { ConfigModule } from '@nestjs/config';
import { HttpModule } from '@nestjs/axios';
import { AuthController } from './auth/controller/auth.controller';
import { SpotifyController } from './spotify/controller/spotify.controller';
import { YoutubeController } from './youtube/controller/youtube.controller';
import { YouTubeController } from './youtube/controller/youtube.controller';
import { SearchController } from './search/controller/search.controller';
import { AuthService } from './auth/services/auth.service';
import { SupabaseService } from './supabase/services/supabase.service';
import { ConfigService } from '@nestjs/config';
import { SpotifyService } from './spotify/services/spotify.service';
import { YoutubeService } from './youtube/services/youtube.service';
import { SearchService } from './search/services/search.service';
import { TokenMiddleware } from './middleware/token.middleware';
import { MiddlewareConsumer, RequestMethod } from '@nestjs/common';

describe('AppModule', () => {
let module: TestingModule;

beforeAll(async () => {
module = await Test.createTestingModule({
imports: [AppModule],
}).compile();
});

afterAll(async () => {
await module.close();
});

it('should import ConfigModule and HttpModule', () => {
const imports = module.get(AppModule).constructor.prototype.constructor.parameters;

expect(imports).toContainEqual(expect.arrayContaining([ConfigModule]));
expect(imports).toContainEqual(expect.arrayContaining([HttpModule]));
});

it('should have the correct controllers', () => {
const controllers = module.get(AppModule).constructor.prototype.controllers;
expect(controllers).toContainEqual(AuthController);
expect(controllers).toContainEqual(SpotifyController);
expect(controllers).toContainEqual(YoutubeController);
expect(controllers).toContainEqual(SearchController);
});

it('should have the correct providers', () => {
const providers = module.get(AppModule).constructor.prototype.providers;
expect(providers).toContainEqual(expect.anything());
expect(providers).toContainEqual(AuthService);
expect(providers).toContainEqual(SupabaseService);
expect(providers).toContainEqual(ConfigService);
expect(providers).toContainEqual(SpotifyService);
expect(providers).toContainEqual(YoutubeService);
expect(providers).toContainEqual(SearchService);
});

it('should apply TokenMiddleware to auth/callback route', () => {
const consumer = {
apply: jest.fn().mockReturnThis(),
forRoutes: jest.fn().mockReturnValue({ path: 'auth/callback', method: RequestMethod.GET }),
} as unknown as MiddlewareConsumer;

const appModule = new AppModule();
appModule.configure(consumer);

expect(consumer.apply).toHaveBeenCalledWith(TokenMiddleware);
expect(consumer.apply(TokenMiddleware).forRoutes).toHaveBeenCalledWith({ path: 'auth/callback', method: RequestMethod.GET });
});
let appModule: TestingModule;

beforeAll(async () => {
appModule = await Test.createTestingModule({
imports: [AppModule],
providers: [TokenMiddleware]
}).compile();
});

it('should be defined', () => {
expect(appModule).toBeDefined();
});

it('should have AuthController defined', () => {
const authController = appModule.get<AuthController>(AuthController);
expect(authController).toBeDefined();
});

it('should have SpotifyController defined', () => {
const spotifyController = appModule.get<SpotifyController>(SpotifyController);
expect(spotifyController).toBeDefined();
});

it('should have YouTubeController defined', () => {
const youtubeController = appModule.get<YouTubeController>(YouTubeController);
expect(youtubeController).toBeDefined();
});

it('should have SearchController defined', () => {
const searchController = appModule.get<SearchController>(SearchController);
expect(searchController).toBeDefined();
});

it('should have TokenMiddleware applied to auth/callback route', () => {

// Assuming you can inspect the middleware routes, which usually you can't directly.
// You may need to rethink how to validate middleware is applied,
// as there's no built-in way to check this.
// You can just verify that TokenMiddleware is defined and should be included.

const tokenMiddleware = appModule.get<TokenMiddleware>(TokenMiddleware);
expect(tokenMiddleware).toBeDefined();
});
});
1 change: 1 addition & 0 deletions Backend/src/search/controller/search.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('SearchController', () => {
searchByTitle: jest.fn(),
searchByAlbum: jest.fn(),
artistSearch: jest.fn(),
searchAlbums: jest.fn(),
},
},
],
Expand Down
86 changes: 51 additions & 35 deletions Backend/src/search/controller/search.controller.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,57 @@
import { Body, Controller, Get, Post, Put } from "@nestjs/common";
import { Body, Controller, Get, Post, Put, Query } from "@nestjs/common";
import { SearchService } from "../services/search.service";

@Controller("search")
export class SearchController
{
constructor(private readonly searchService: SearchService)
{}

// This endpoint is used to search for tracks by title.
@Post("search")
async searchByTitle(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchByTitle(title);
}

// This endpoint is used to search for albums based on their title.
@Post("album")
async searchByAlbum(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchByAlbum(title);
}

// This endpoint is used to get the details of a specific artist.
@Post("artist")
async searchForArtist(@Body() body: { artist: string }): Promise<any>
{
const { artist } = body;
return await this.searchService.artistSearch(artist);
}

// This endpoint is used to get the details of a specific album.
@Post("album-info")
async albumInfo(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchAlbums(title);
}
constructor(private readonly searchService: SearchService)
{
}

// This endpoint is used to search for tracks by title.
@Post("search")
async searchByTitle(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchByTitle(title);
}

// This endpoint is used to search for albums based on their title.
@Post("album")
async searchByAlbum(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchByAlbum(title);
}

// This endpoint is used to get the details of a specific artist.
@Post("artist")
async searchForArtist(@Body() body: { artist: string }): Promise<any>
{
const { artist } = body;
return await this.searchService.artistSearch(artist);
}

// This endpoint is used to get the details of a specific album.
@Post("album-info")
async albumInfo(@Body() body: { title: string }): Promise<any>
{
const { title } = body;
return await this.searchService.searchAlbums(title);
}

// This endpoint is used to get songs for a specific mood.
@Get("mood")
async getPlaylistByMood(@Query("mood") mood: string): Promise<any>
{
return await this.searchService.getPlaylistSongsByMood(mood);
}

// This endpoint is used to get suggested moods and their corresponding songs.
@Get("suggested-moods")
async getSuggestedMoods(): Promise<any>
{
return await this.searchService.getSuggestedMoods();
}

}
Loading
Loading