Skip to content
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9697ca9
refactor: split shared into packages
tomast1337 Jul 25, 2025
b4ecf42
refactor: moved backend to packages
tomast1337 Jul 25, 2025
f79dc4e
refactor: moved frontend to apps/frontend
tomast1337 Jul 25, 2025
ff0be9d
refactor: restructure project to use workspaces for apps and packages
tomast1337 Jul 25, 2025
f350b50
refactor: clean up database module by removing unused index file and …
tomast1337 Jul 25, 2025
a2f54b6
refactor: update imports to use centralized database module and remov…
tomast1337 Jul 25, 2025
bee7b71
feat: implement offscreen drawing of notes and canvas swapping functi…
tomast1337 Jul 25, 2025
baa803c
refactor: update imports to use centralized module paths and clean up…
tomast1337 Jul 25, 2025
e6834bc
refactor: tidy up tsconfig.json formatting for improved readability
tomast1337 Jul 25, 2025
91b480b
refactor: update imports to use centralized database module and clean…
tomast1337 Jul 26, 2025
f8697f6
refactor: update build and start scripts to reflect new package struc…
tomast1337 Jul 26, 2025
4e44766
refactor: update ESLint configuration paths to reflect new directory …
tomast1337 Jul 26, 2025
7928d51
refactor: update imports to use new package structure for sounds and …
tomast1337 Jul 26, 2025
4d29bce
refactor: add test script to package.json and update imports for cons…
tomast1337 Jul 26, 2025
0785bd5
refactor: standardize import statements across multiple files and cle…
tomast1337 Jul 26, 2025
e76df8f
refactor: add lint and test scripts to package.json for database, son…
tomast1337 Jul 26, 2025
52520ec
refactor: update test scripts in package.json for backend, database, …
tomast1337 Jul 26, 2025
f4a8ca3
chore: add docker-compose.yml to configure MongoDB, Maildev, MinIO, a…
tomast1337 Aug 12, 2025
9d0a1b7
refactor: remove unused import in SongDetails component for cleaner code
tomast1337 Aug 12, 2025
f1588b6
feat: initialize configs package with basic structure, including Type…
tomast1337 Aug 13, 2025
24bab36
refactor: rename packages and update package.json structure to reflec…
tomast1337 Aug 13, 2025
7419f74
refactor: remove unused colors export from thumbnail package for clea…
tomast1337 Aug 13, 2025
10e468a
feat: add development script to sounds package for watch mode during …
tomast1337 Aug 13, 2025
1867009
refactor: update imports to use new constants from @nbw/config for co…
tomast1337 Aug 13, 2025
4d4cca6
refactor: standardize import statements and update to use UPLOAD_CONS…
tomast1337 Aug 13, 2025
e60fbc4
feat: add Bun configuration rule to replace Node.js and related tools…
tomast1337 Aug 13, 2025
212b52e
refactor: update components to use UPLOAD_CONSTANTS and other new con…
tomast1337 Aug 13, 2025
374c7c8
refactor: update data directory path in build script to align with ne…
tomast1337 Aug 13, 2025
59ff35c
refactor: move backend to apps/backend
tomast1337 Aug 13, 2025
d670b34
fix: Tests are no longer run and included in the dist folder
tomast1337 Aug 13, 2025
1ea8531
refactor: update thumbnail package.json to support separate builds fo…
tomast1337 Aug 13, 2025
814b19b
refactor: update song package.json to support separate build scripts …
tomast1337 Aug 13, 2025
4d71486
refactor: enhance canvasFactory to support both Node.js and browser e…
tomast1337 Aug 13, 2025
4a30be5
refactor: update VSCode settings and enhance SongThumbnailInput compo…
tomast1337 Aug 14, 2025
118a2c7
refactor: remove unnecessary whitespace in auth.module.ts and seed.se…
tomast1337 Aug 14, 2025
b7b31cd
refactor: reorganize workspace structure and update VSCode settings f…
tomast1337 Aug 14, 2025
95ac61a
refactor: add missing import for MailingModule in auth.module.ts to e…
tomast1337 Aug 14, 2025
bbf8474
refactor: reorganize bun.lock to update app structure and dependencie…
tomast1337 Aug 14, 2025
e72bc86
Update build.ts
tomast1337 Aug 14, 2025
b2cc288
refactor: update VSCode workspace settings with new color customizati…
tomast1337 Aug 17, 2025
8081d32
Merge branch 'feature/node-workspace-setup' of github.com:OpenNBS/Not…
tomast1337 Aug 17, 2025
082bfe9
chore: linting
tomast1337 Aug 20, 2025
378604a
refactor: update test command in package.json, add Lato-Regular font …
tomast1337 Sep 9, 2025
41747e3
refactor: enhance getPath function in canvasFactory to support multip…
tomast1337 Sep 9, 2025
b4319ad
refactor: update build configuration to disable minification and enab…
tomast1337 Sep 9, 2025
ac8bf04
refactor: remove TODO comment in song.util.ts and clarify intent for …
tomast1337 Sep 9, 2025
b98a041
chore: consolidate and update .gitignore files across the project, re…
tomast1337 Sep 9, 2025
df71f21
refactor: improve error handling in user service and ensure consisten…
tomast1337 Sep 9, 2025
4900195
refactor: update TypeScript configuration files to extend base settin…
tomast1337 Sep 9, 2025
026390b
refactor: restructure ESLint configuration by removing legacy files, …
tomast1337 Sep 9, 2025
5151439
refactor: remove legacy ESLint configuration files and streamline lin…
tomast1337 Sep 9, 2025
7c54b0a
chore: lint fixes
tomast1337 Sep 9, 2025
3ca4d60
refactor: update API route for static files from '/api/v1' to '/v1' f…
tomast1337 Sep 9, 2025
36e1773
refactor: migrate sound data generation logic from build.ts to apps/b…
tomast1337 Sep 10, 2025
391ff0f
chore: update contributing guidelines and package.json scripts for im…
tomast1337 Sep 11, 2025
b709f6d
docs: enhance contributing guidelines by adding a link to bun test do…
tomast1337 Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
111 changes: 111 additions & 0 deletions .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
description: Use Bun instead of Node.js, npm, pnpm, or vite.
globs: "*.ts, *.tsx, *.html, *.css, *.js, *.jsx, package.json"
alwaysApply: false
---

Default to using Bun instead of Node.js.

- Use `bun <file>` instead of `node <file>` or `ts-node <file>`
- Use `bun test` instead of `jest` or `vitest`
- Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
- Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
- Bun automatically loads .env, so don't use dotenv.

## APIs

- `Bun.serve()` supports WebSockets, HTTPS, and routes. Don't use `express`.
- `bun:sqlite` for SQLite. Don't use `better-sqlite3`.
- `Bun.redis` for Redis. Don't use `ioredis`.
- `Bun.sql` for Postgres. Don't use `pg` or `postgres.js`.
- `WebSocket` is built-in. Don't use `ws`.
- Prefer `Bun.file` over `node:fs`'s readFile/writeFile
- Bun.$`ls` instead of execa.

## Testing

Use `bun test` to run tests.

```ts#index.test.ts
import { test, expect } from "bun:test";

test("hello world", () => {
expect(1).toBe(1);
});
```

## Frontend

Use HTML imports with `Bun.serve()`. Don't use `vite`. HTML imports fully support React, CSS, Tailwind.

Server:

```ts#index.ts
import index from "./index.html"

Bun.serve({
routes: {
"/": index,
"/api/users/:id": {
GET: (req) => {
return new Response(JSON.stringify({ id: req.params.id }));
},
},
},
// optional websocket support
websocket: {
open: (ws) => {
ws.send("Hello, world!");
},
message: (ws, message) => {
ws.send(message);
},
close: (ws) => {
// handle close
}
},
development: {
hmr: true,
console: true,
}
})
```

HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically. `<link>` tags can point to stylesheets and Bun's CSS bundler will bundle.

```html#index.html
<html>
<body>
<h1>Hello, world!</h1>
<script type="module" src="./frontend.tsx"></script>
</body>
</html>
```

With the following `frontend.tsx`:

```tsx#frontend.tsx
import React from "react";

// import .css files directly and it works
import './index.css';

import { createRoot } from "react-dom/client";

const root = createRoot(document.body);

export default function Frontend() {
return <h1>Hello, world!</h1>;
}

root.render(<Frontend />);
```

Then, run index.ts

```sh
bun --hot ./index.ts
```

For more information, read the Bun API docs in `node_modules/bun-types/docs/**.md`.
40 changes: 31 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
{
"editor.formatOnSave": true,
"eslint.validate": ["typescript"],
"eslint.run": "onType",
"eslint.format.enable": true,
"mdx.server.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}
"editor.formatOnSave": true,
"eslint.validate": [
"typescript"
],
"eslint.run": "onType",
"eslint.format.enable": true,
"mdx.server.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fac977",
"activityBar.background": "#fac977",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#069a62",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#fac977",
"statusBar.background": "#f8b646",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#f6a315",
"statusBarItem.remoteBackground": "#f8b646",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#f8b646",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#f8b64699",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#f8b646"
}
File renamed without changes.
2 changes: 1 addition & 1 deletion server/.eslintrc.json → apps/backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"../.eslintrc.js"
"../../.eslintrc.js"
],
"root": true,
"env": {
Expand Down
3 changes: 3 additions & 0 deletions server/.gitignore → apps/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.env.development
.env.production
dist
coverage
*.log
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 10 additions & 6 deletions server/package.json → apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "noteblockworld-server",
"name": "@nbw/backend",
"version": "0.0.1",
"description": "",
"author": "",
Expand All @@ -15,11 +15,11 @@
"start:debug": "NODE_ENV=development tsc-watch --onSuccess \"bun . --inspect\"",
"start:prod": "NODE_ENV=production bun dist/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "bun test",
"test:watch": "bun test --watch",
"test:cov": "bun test --coverage",
"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 ./test/app.e2e-spec.ts"
"test:e2e": "bun test e2e/**/*.spec.ts"
},
"dependencies": {
"@aws-sdk/client-s3": "3.717.0",
Expand Down Expand Up @@ -56,7 +56,11 @@
"rxjs": "^7.8.1",
"uuid": "^9.0.1",
"zod": "^3.24.1",
"zod-validation-error": "^3.4.0"
"zod-validation-error": "^3.4.0",
"@nbw/database": "workspace:*",
"@nbw/song": "workspace:*",
"@nbw/thumbnail": "workspace:*",
"@nbw/sounds": "workspace:*"
},
"devDependencies": {
"@faker-js/faker": "^9.3.0",
Expand Down
Loading
Loading