Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fb4fbcb
feat: add song search functionality with pagination and sorting, upda…
tomast1337 Sep 19, 2025
58eb0cd
refactor: update Swagger documentation route from '/api/doc' to '/doc…
tomast1337 Sep 19, 2025
730ffdd
feat: add SearchBox component to Header for enhanced song and user se…
tomast1337 Sep 19, 2025
fc3b3ce
fix: update SearchBox component to refine search functionality by cha…
tomast1337 Sep 19, 2025
22ff5c9
feat: implement SearchSongPage component for song search functionalit…
tomast1337 Sep 19, 2025
2cd6196
Merge branch 'develop' of github.com:OpenNBS/NoteBlockWorld into feat…
tomast1337 Sep 22, 2025
4c7ccf3
feat: implement SongBrowserService and controller with endpoints for …
tomast1337 Sep 22, 2025
961dc99
chore: update ESLint configuration and dependencies for improved Type…
tomast1337 Sep 22, 2025
d3b4163
refactor: update ESLint configuration to use Linter.FlatConfig and en…
tomast1337 Sep 22, 2025
332d67c
refactor: refine ESLint configuration by removing unnecessary rules a…
tomast1337 Sep 22, 2025
dd9e241
refactor: remove SongBrowser module and controller, update SongContro…
tomast1337 Sep 22, 2025
97d3f4f
refactor: remove unnecessary ESLint disable comments in FeaturedSongs…
tomast1337 Sep 22, 2025
f4d4cce
chore: update jiti dependency to version 2.6.0 and adjust ESLint conf…
tomast1337 Sep 22, 2025
71d3080
chore: lint
tomast1337 Sep 22, 2025
e99b8da
chore: update tsconfig.json to exclude build artifacts and JavaScript…
tomast1337 Sep 22, 2025
3ec650a
refactor: update song retrieval endpoints to use query parameters for…
tomast1337 Sep 22, 2025
fc1a70c
refactor: remove count parameter from song retrieval queries and repl…
tomast1337 Sep 22, 2025
dcf0f55
refactor: update Swagger setup path from 'api/doc' to 'docs' for impr…
tomast1337 Sep 22, 2025
7d6512f
refactor: enhance SongController tests to cover new song retrieval fe…
tomast1337 Sep 22, 2025
0621ab8
chore: update ESLint linting commands to remove max-warnings limit fo…
tomast1337 Sep 22, 2025
93f9d84
chore: simplify test command in package.json to run tests from the ro…
tomast1337 Sep 22, 2025
0fcbfbe
refactor: implement pagination and featured songs retrieval in SongCo…
tomast1337 Sep 24, 2025
141ac08
refactor: remove SongBrowserService and its associated tests to strea…
tomast1337 Sep 24, 2025
b89a87f
test: enhance SongService tests to validate featured songs retrieval …
tomast1337 Sep 24, 2025
98e1586
refactor: streamline SongController methods by consolidating paramete…
tomast1337 Sep 24, 2025
42451c4
test: remove mock dependencies for SongBrowserService in SongControll…
tomast1337 Sep 24, 2025
5b4efc9
refactor: clean up imports and add category filter to public song ret…
tomast1337 Sep 24, 2025
3832306
refactor: simplify parameter formatting in SongService methods for im…
tomast1337 Sep 24, 2025
afb3dc2
chore: reorder workspace folders in NoteBlockWorld configuration for …
tomast1337 Sep 24, 2025
7abcd1f
chore: update dependencies and improve import formatting across vario…
tomast1337 Sep 24, 2025
4cf745a
chore: update bun types to version 1.2.22 and enhance ESLint configur…
tomast1337 Sep 24, 2025
a67fb5f
feat: introduce @nbw/api-client package with TypeScript support, Axio…
tomast1337 Sep 24, 2025
38b1fe3
chore: add GEMINI.md for workspace instructions and update package.js…
tomast1337 Sep 24, 2025
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
29 changes: 29 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Gemini Workspace Instructions

This document provides instructions for the Gemini AI assistant to effectively interact with the NoteBlockWorld project.

## Package Manager

This project uses **Bun** as the package manager and runtime. Do not use `npm`, `yarn`, or `pnpm`.

- **Installation:** `bun install`
- **Running scripts:** `bun run <script_name>`
- **Adding dependencies:** `bun add <package_name>`
- **Running tests:** `bun test`

## Project Structure

This is a TypeScript monorepo managed with Bun workspaces.

- **`apps/`**: Contains the main applications.
- **`apps/backend`**: A NestJS application for the server-side logic.
- **`apps/frontend`**: A Next.js application for the user interface.
- **`packages/`**: Contains shared libraries and modules used across the monorepo.
- **`packages/api-client`**: Client for communicating with the backend API.
- **`packages/configs`**: Shared configurations (e.g., ESLint, Prettier).
- **`packages/database`**: Database schemas, queries, and connection logic.
- **`packages/song`**: Core logic for handling and manipulating song data.
- **`packages/sounds`**: Logic related to fetching and managing sounds.
- **`packages/thumbnail`**: A library for generating song thumbnails.
- **`tests/`**: Contains end-to-end tests, likely using Cypress.
- **`tsconfig.base.json`**: The base TypeScript configuration for the entire monorepo.
8 changes: 4 additions & 4 deletions NoteBlockWorld.code-workspace
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"folders": [
{
"path": ".",
"name": "Root"
},
{
"path": "./apps/backend",
"name": "Backend"
Expand Down Expand Up @@ -32,6 +28,10 @@
"path": "./packages/thumbnail",
"name": "thumbnail"
},
{
"path": ".",
"name": "Root"
},
],
"settings": {
"window.title": "${dirty}${rootName}${separator}${profileName}${separator}${appName}",
Expand Down
4 changes: 3 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
"start:dev": "bun --watch run src/main.ts",
"start:debug": "bun --watch run src/main.ts",
"start:prod": "node dist/main",
"lint": "eslint \"src/**/*.ts\" --fix",
"lint": "eslint \"src/**/*.ts\" --fix --config ../../eslint.config.ts",
"test": "bun test src/**/*.spec.ts",
"test:watch": "bun test src/**/*.spec.ts --watch",
"test:cov": "bun test src/**/*.spec.ts --coverage",
"test:debug": "bun --inspect-brk --runInBand",
"test:e2e": "bun test e2e/**/*.spec.ts"
},
"dependencies": {
"@types/bun": "^1.2.10",
"@aws-sdk/client-s3": "3.717.0",
"@aws-sdk/s3-request-presigner": "3.717.0",
"@encode42/nbs.js": "^5.0.2",
Expand Down Expand Up @@ -67,6 +68,7 @@
"@nestjs/cli": "^10.4.9",
"@nestjs/schematics": "^10.2.3",
"@nestjs/testing": "^10.4.15",
"@stylistic/eslint-plugin": "^5.4.0",
"@types/bcryptjs": "^2.4.6",
"@types/bun": "^1.2.10",
"@types/express": "^4.17.21",
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const build = async () => {

const result = await Bun.build({
entrypoints: ['./src/main.ts'],
outdir: './dist',
target: 'bun',
minify: false,
sourcemap: 'linked',
external: optionalRequirePackages.filter((pkg) => {
outdir : './dist',
target : 'bun',
minify : false,
sourcemap : 'linked',
external : optionalRequirePackages.filter((pkg) => {
try {
require(pkg);
return false;
Expand Down
24 changes: 11 additions & 13 deletions apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,47 @@ import { ParseTokenPipe } from './lib/parseToken';
import { MailingModule } from './mailing/mailing.module';
import { SeedModule } from './seed/seed.module';
import { SongModule } from './song/song.module';
import { SongBrowserModule } from './song-browser/song-browser.module';
import { UserModule } from './user/user.module';

@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
isGlobal : true,
envFilePath: ['.env.development', '.env.production'],
validate,
}),
//DatabaseModule,
MongooseModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
imports : [ConfigModule],
inject : [ConfigService],
useFactory: (
configService: ConfigService,
): MongooseModuleFactoryOptions => {
const url = configService.getOrThrow<string>('MONGO_URL');
Logger.debug(`Connecting to ${url}`);

return {
uri: url,
uri : url,
retryAttempts: 10,
retryDelay: 3000,
retryDelay : 3000,
};
},
}),
// Mailing
MailerModule.forRootAsync({
imports: [ConfigModule],
imports : [ConfigModule],
useFactory: (configService: ConfigService) => {
const transport = configService.getOrThrow<string>('MAIL_TRANSPORT');
const from = configService.getOrThrow<string>('MAIL_FROM');
AppModule.logger.debug(`MAIL_TRANSPORT: ${transport}`);
AppModule.logger.debug(`MAIL_FROM: ${from}`);
return {
transport: transport,
defaults: {
defaults : {
from: from,
},
template: {
dir: __dirname + '/mailing/templates',
dir : __dirname + '/mailing/templates',
adapter: new HandlebarsAdapter(),
options: {
strict: true,
Expand All @@ -68,24 +67,23 @@ import { UserModule } from './user/user.module';
// Throttler
ThrottlerModule.forRoot([
{
ttl: 60,
ttl : 60,
limit: 256, // 256 requests per minute
},
]),
SongModule,
UserModule,
AuthModule.forRootAsync(),
FileModule.forRootAsync(),
SongBrowserModule,
SeedModule.forRoot(),
EmailLoginModule,
MailingModule,
],
controllers: [],
providers: [
providers : [
ParseTokenPipe,
{
provide: APP_GUARD,
provide : APP_GUARD,
useClass: ThrottlerGuard,
},
],
Expand Down
14 changes: 7 additions & 7 deletions apps/backend/src/auth/auth.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { AuthService } from './auth.service';
import { MagicLinkEmailStrategy } from './strategies/magicLinkEmail.strategy';

const mockAuthService = {
githubLogin: jest.fn(),
googleLogin: jest.fn(),
discordLogin: jest.fn(),
verifyToken: jest.fn(),
githubLogin : jest.fn(),
googleLogin : jest.fn(),
discordLogin : jest.fn(),
verifyToken : jest.fn(),
loginWithEmail: jest.fn(),
};

Expand All @@ -24,13 +24,13 @@ describe('AuthController', () => {
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [AuthController],
providers: [
providers : [
{
provide: AuthService,
provide : AuthService,
useValue: mockAuthService,
},
{
provide: MagicLinkEmailStrategy,
provide : MagicLinkEmailStrategy,
useValue: mockMagicLinkEmailStrategy,
},
],
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AuthController {
@Throttle({
default: {
// one every 1 hour
ttl: 60 * 60 * 1000,
ttl : 60 * 60 * 1000,
limit: 1,
},
})
Expand All @@ -44,11 +44,11 @@ export class AuthController {
content: {
'application/json': {
schema: {
type: 'object',
type : 'object',
properties: {
destination: {
type: 'string',
example: '[email protected]',
type : 'string',
example : '[email protected]',
description: 'Email address to send the magic link to',
},
},
Expand All @@ -58,7 +58,7 @@ export class AuthController {
},
},
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async magicLinkLogin(@Req() req: Request, @Res() res: Response) {
throw new HttpException('Not implemented', HttpStatus.NOT_IMPLEMENTED);
// TODO: uncomment this line to enable magic link login
Expand Down
46 changes: 23 additions & 23 deletions apps/backend/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import { MagicLinkEmailStrategy } from './strategies/magicLinkEmail.strategy';
export class AuthModule {
static forRootAsync(): DynamicModule {
return {
module: AuthModule,
module : AuthModule,
imports: [
UserModule,
ConfigModule.forRoot(),
MailingModule,
JwtModule.registerAsync({
inject: [ConfigService],
imports: [ConfigModule],
inject : [ConfigService],
imports : [ConfigModule],
useFactory: async (config: ConfigService) => {
const JWT_SECRET = config.get('JWT_SECRET');
const JWT_EXPIRES_IN = config.get('JWT_EXPIRES_IN');
Expand All @@ -39,14 +39,14 @@ export class AuthModule {
}

return {
secret: JWT_SECRET,
secret : JWT_SECRET,
signOptions: { expiresIn: JWT_EXPIRES_IN || '60s' },
};
},
}),
],
controllers: [AuthController],
providers: [
providers : [
AuthService,
ConfigService,
GoogleStrategy,
Expand All @@ -55,56 +55,56 @@ export class AuthModule {
MagicLinkEmailStrategy,
JwtStrategy,
{
inject: [ConfigService],
provide: 'COOKIE_EXPIRES_IN',
inject : [ConfigService],
provide : 'COOKIE_EXPIRES_IN',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('COOKIE_EXPIRES_IN'),
},
{
inject: [ConfigService],
provide: 'SERVER_URL',
inject : [ConfigService],
provide : 'SERVER_URL',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('SERVER_URL'),
},
{
inject: [ConfigService],
provide: 'FRONTEND_URL',
inject : [ConfigService],
provide : 'FRONTEND_URL',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('FRONTEND_URL'),
},
{
inject: [ConfigService],
provide: 'JWT_SECRET',
inject : [ConfigService],
provide : 'JWT_SECRET',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('JWT_SECRET'),
},
{
inject: [ConfigService],
provide: 'JWT_EXPIRES_IN',
inject : [ConfigService],
provide : 'JWT_EXPIRES_IN',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('JWT_EXPIRES_IN'),
},
{
inject: [ConfigService],
provide: 'JWT_REFRESH_SECRET',
inject : [ConfigService],
provide : 'JWT_REFRESH_SECRET',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('JWT_REFRESH_SECRET'),
},
{
inject: [ConfigService],
provide: 'JWT_REFRESH_EXPIRES_IN',
inject : [ConfigService],
provide : 'JWT_REFRESH_EXPIRES_IN',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('JWT_REFRESH_EXPIRES_IN'),
},
{
inject: [ConfigService],
provide: 'MAGIC_LINK_SECRET',
inject : [ConfigService],
provide : 'MAGIC_LINK_SECRET',
useFactory: (configService: ConfigService) =>
configService.getOrThrow<string>('MAGIC_LINK_SECRET'),
},
{
inject: [ConfigService],
provide: 'APP_DOMAIN',
inject : [ConfigService],
provide : 'APP_DOMAIN',
useFactory: (configService: ConfigService) =>
configService.get<string>('APP_DOMAIN'),
},
Expand Down
Loading
Loading