Skip to content

Commit dbdc3f5

Browse files
committed
release: v0.5.0
1 parent 0387a3c commit dbdc3f5

58 files changed

Lines changed: 14698 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in Cerebra
4+
---
5+
6+
**Describe the bug**
7+
8+
**Steps to reproduce**
9+
10+
**Expected behavior**
11+
12+
**Screenshots (if any)**
13+
14+
**OS and version**
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for Cerebra
4+
---
5+
6+
**What problem does this solve?**
7+
8+
**Describe the feature**
9+
10+
**Any alternatives you considered?**

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## What does this PR do?
2+
3+
## Type of change
4+
- [ ] Bug fix
5+
- [ ] New feature
6+
- [ ] Refactor
7+
8+
## Checklist
9+
- [ ] I tested my changes
10+
- [ ] No console errors
11+
- [ ] Code is clean and readable

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- run: npm install
18+
working-directory: cerebra-software
19+
- run: npm run build
20+
working-directory: cerebra-software

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Dependencies
2+
cerebra-software/node_modules/
3+
4+
# Build outputs
5+
cerebra-software/dist
6+
release/
7+
8+
# Environment files
9+
.env
10+
.env.local
11+
12+
# OS files
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Editor files
17+
.vscode/
18+
.idea/
19+
*.swp
20+
*.swo
21+
22+
# Logs
23+
*.log
24+
npm-debug.log*
25+
26+
# Database
27+
*.db
28+
*.sqlite
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Changelog
2+
3+
All notable changes to Cerebra will be documented here.
4+
5+
## [Unreleased]
6+
7+
## [0.5.0] - 2026-04-13
8+
### Added
9+
- FTS5 full-text search across notes
10+
- Lucide icons replacing all emoji usage throughout the UI
11+
- Scrollable sidebar and back button navigation
12+
- ESLint and Prettier with lint/format scripts
13+
- Date formatting utility (`dateFormat.ts`)
14+
15+
### Changed
16+
- Rewrote IPC layer with structured error handling across all handlers
17+
- Replaced `any` types in all IPC handlers with proper input types
18+
- Converted `require()` calls in `electron/main.ts` to `await import()`
19+
- Optimized all database queries across notes, folders, sticky notes, and settings repositories
20+
- Eliminated redundant DB queries; frontend now filters in-memory where appropriate
21+
- Consolidated frontend services into hooks, removing standalone service files
22+
- Refactored `app.tsx` and all modal/card components for cleaner structure
23+
- Upgraded `moduleResolution` to `node16` in electron and backend tsconfigs
24+
- Cleaned up comments across all source files
25+
26+
### Fixed
27+
- Packaged app not displaying UI — replaced `NODE_ENV` check with `app.isPackaged`
28+
- Frontend path resolution in packaged build pointing to wrong directory
29+
- `useFolders.remove` refetching entire folder list on delete
30+
- FTS5 parse errors returning a crash instead of empty results
31+
- Unused catch bindings across hooks and backend repositories
32+
- Removed General tab from settings (redundant)
33+
- Simplified About section in settings
34+
35+
## [0.1.0] - 2026-03-22
36+
### Added
37+
- Initial database setup with SQLite
38+
- Notes and folders CRUD operations
39+
- Sticky notes CRUD operations
40+
- Settings management
41+
- Dark mode
42+
- Persistent tabs
43+
- Input validation and error handling across all database repositories
44+
- WAL mode for better database performance
45+
- Graceful database shutdown

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright (c) 2026 Vincent Agra. All Rights Reserved.
2+
3+
Permission is granted to use and test this software for personal, non-commercial purposes.
4+
5+
The following are strictly prohibited:
6+
- Modifying or creating derivative works
7+
- Redistributing or sublicensing the software
8+
- Using the software for commercial purposes
9+
10+
This restriction is temporary. Licensing terms may change upon the release of version 1.0.0.

cerebra-software/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

cerebra-software/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"tabWidth": 2,
5+
"printWidth": 100,
6+
"trailingComma": "es5"
7+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import Database from 'better-sqlite3';
2+
import { app } from 'electron';
3+
import path from 'path';
4+
import fs from 'fs';
5+
6+
const ensureDbDirectory = (dbPath: string): void => {
7+
try {
8+
const dbDir = path.dirname(dbPath);
9+
10+
if (!fs.existsSync(dbDir)) {
11+
fs.mkdirSync(dbDir, { recursive: true });
12+
}
13+
} catch (error) {
14+
console.error('Error ensuring database directory exists:', error);
15+
throw error;
16+
}
17+
};
18+
19+
const getDbPath = (): string => path.join(app.getPath('userData'), 'cerebra.db');
20+
21+
const connectDatabase = (dbPath: string): Database.Database => {
22+
try {
23+
ensureDbDirectory(dbPath);
24+
25+
const db = new Database(dbPath, {
26+
verbose: process.env.NODE_ENV === 'development' ? console.log : undefined,
27+
});
28+
29+
db.pragma('foreign_keys = ON');
30+
db.pragma('journal_mode = WAL');
31+
32+
console.log(`Database initialized at: ${dbPath}`);
33+
34+
return db;
35+
} catch (error) {
36+
console.error('Failed to connect to database:', error);
37+
throw error;
38+
}
39+
};
40+
41+
export const closeDatabase = (): void => {
42+
if (db.open) {
43+
db.close();
44+
console.log('Database connection closed.');
45+
}
46+
};
47+
48+
export const dbPath = getDbPath();
49+
50+
export const db = connectDatabase(dbPath);

0 commit comments

Comments
 (0)