Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/LargeTile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/LargeTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/LargeTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/LargeTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/LargeTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/SmallTile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/SmallTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/SmallTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/SmallTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/SmallTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square150x150Logo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square150x150Logo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square150x150Logo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square44x44Logo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square44x44Logo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/Square44x44Logo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/StoreLogo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/StoreLogo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/StoreLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/appx/StoreLogo.scale-400.png
Binary file added build/appx/Wide310x150Logo.png
Binary file added build/appx/Wide310x150Logo.scale-125.png
Binary file added build/appx/Wide310x150Logo.scale-150.png
Binary file added build/appx/Wide310x150Logo.scale-200.png
Binary file added build/appx/Wide310x150Logo.scale-400.png
81 changes: 81 additions & 0 deletions dev-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* Standalone dev server — runs the Express + SQLite backend WITHOUT Electron.
* Mocks only the Electron APIs used by db.ts and server.ts.
* Usage: node dev-server.js
*/

// Load .env before anything else
const fs = require('fs');
const envPath = require('path').join(__dirname, '.env');
if (fs.existsSync(envPath)) {
for (const line of fs.readFileSync(envPath, 'utf8').split('\n')) {
const match = line.match(/^\s*([^#=\s]+)\s*=\s*(.*)$/);
if (match) process.env[match[1]] = match[2].trim();
}
console.log('[DevServer] Loaded .env');
}

const path = require('path');
const os = require('os');

// ── Mock Electron's `app` module ──────────────────────────────────────────────
const mockApp = {
isPackaged: false,
getPath: (name) => {
if (name === 'userData') return path.join(__dirname);
if (name === 'documents') return os.homedir();
return os.tmpdir();
},
getVersion: () => require('./package.json').version,
getName: () => 'Flo (dev)',
};

require('module').Module._resolveFilename = (function (original) {
return function (request, ...args) {
if (request === 'electron') {
return __filename; // will be intercepted below
}
return original.call(this, request, ...args);
};
})(require('module').Module._resolveFilename);

// Intercept `require('electron')` before any dist file loads it
const Module = require('module');
const originalLoad = Module._load;
Module._load = function (request, parent, isMain) {
if (request === 'electron') {
return {
app: mockApp,
// Stub anything else that might be imported at module level
BrowserWindow: class {},
ipcMain: { handle: () => {}, on: () => {} },
dialog: {},
shell: {},
Menu: { buildFromTemplate: () => ({}), setApplicationMenu: () => {} },
Tray: class {},
nativeImage: { createFromPath: () => ({ resize: () => ({}) }) },
};
}
return originalLoad.apply(this, arguments);
};

// ── Now load and start the compiled backend ───────────────────────────────────
const { initDatabase } = require('./dist/db');
const { startServer } = require('./dist/server');

(async () => {
try {
console.log('[DevServer] Initializing database...');
initDatabase();

console.log('[DevServer] Starting Express server...');
await startServer();

console.log('[DevServer] ✅ Backend running on http://localhost:3001');
console.log('[DevServer] Frontend dev server: http://localhost:3000');
console.log('[DevServer] API health: http://localhost:3001/api/health');
} catch (err) {
console.error('[DevServer] Failed to start:', err);
process.exit(1);
}
})();
2 changes: 1 addition & 1 deletion frontend
20 changes: 6 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@types/qrcode": "^1.5.6",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"electron": "^31.1.0",
"electron": "^31.7.7",
"electron-builder": "^26.8.1",
"kill-port": "^2.0.1",
"typescript": "^5.4.5"
Expand Down