Time-Lapse Software
A Software Used to Monitor You.
Why This Project Exists
Most productivity apps tell you what you planned to do. This app shows what actually happened.
Study CCTV Desktop is a desktop-first timelapse recorder built to capture long study sessions with minimal friction. You open the app, start a session, and it records periodic webcam frames. When you stop, it renders a final MP4 timelapse automatically.
The bigger goal is not surveillance. It is personal accountability and retrospective insight: how often you showed up, how long sessions lasted, and how your consistency changed over time.
The Big Picture
At a high level, the app is a three-layer Electron architecture:
- Main process
- Preload bridge
- Renderer UI
The main process handles filesystem access, session metadata, and ffmpeg execution. The renderer handles camera input, live UI state, and user interaction. The preload file exposes a safe IPC API so renderer code never gets full Node.js access.
This gives a practical security baseline while still keeping the implementation lightweight.
Architecture Walkthrough
1) Main Process Responsibilities
Main process code lives in src/main.js and handles:
- App window lifecycle
- Session folder creation
- Frame saving from data URLs
- MP4 rendering using ffmpeg-static
- Settings and history persistence
- Dashboard data aggregation
- Folder picker dialogs
- Utility tasks like disk usage checks and notifications
The persistence model is a local JSON store in the Electron userData directory. It contains two roots:
- settings
- sessions
This keeps data management simple and transparent.
2) Preload Bridge
Preload code in src/preload.js uses contextBridge + ipcRenderer.invoke to expose a single API object into the browser context.
That API is the contract between UI and system layer. It includes actions for:
- Creating sessions
- Saving frames
- Building videos
- Loading and saving settings
- Getting dashboard and storage information
3) Renderer UI
Renderer files are in src/renderer:
- index.html for structure
- styles.css for visual design
- renderer.js for runtime behavior
The UI follows a clear flow:
- Home screen with aggregate stats and recent sessions
- New Session setup screen
- Recording screen with live preview and status
- Profile/settings side panel with tabbed controls
Core Recording Workflow
The core lifecycle looks like this:
- User enters session name and tag
- Renderer asks main process to create a session folder
- Renderer captures frames on interval and sends each to main process
- Main process writes frames as frame_000001.jpg style files
- On stop, renderer asks main process to run ffmpeg and build MP4
- Metadata is finalized and stored in session history
- Dashboard and recent sessions refresh in UI
Output Folder Pattern
Sessions are written under the configured output root with timestamped folders:
- session_YYYY-MM-DD…
- frames subfolder for source images
- timelapse_*.mp4 as final output
Data Model
Each session record stores useful playback and analytics metadata, including:
- Session identity (id, name, tag, createdAt)
- Capture parameters (intervalSeconds, fps)
- Computed output stats (frameCount, timeLapseMinutes)
- Output paths (video and optional thumbnail)
- Focus timeline fields for future or advanced analysis
Settings include capture defaults, storage preferences, and appearance options. This means each launch can resume your preferred behavior without reconfiguration.
UI and Design System
The visual language is intentionally cinematic and control-room inspired:
- Glass-like cards and ambient background gradients
- Theme presets (multiple built-in palettes)
- Animated state pill for recording feedback
- Responsive layout that compresses cleanly on smaller widths
- Side-panel settings to avoid context-switching screens
The renderer applies theme and style settings via CSS variables and data attributes on the body element. This keeps the appearance engine clean and centralized.
Feature Set
Current project capabilities include:
- Live webcam preview
- Start/stop timelapse session control
- Adjustable capture interval and output FPS
- Automatic MP4 build after recording
- Build from an existing folder of image frames
- Session history + dashboard aggregates
- Profile name and personalized welcome
- Theme/border/corner customization
- Configurable output directory
- Data reset option
Recent implementation work also introduces expanded intelligence and automation paths:
- Motion-triggered capture support with threshold controls
- Video overlay options (timestamp, session watermark, progress bar)
- Thumbnail generation for rendered videos
- Disk usage monitoring and warning threshold logic
- OS-level notification hook when builds finish
- Monthly digest builder to combine recent sessions
Build and Distribution Story
The project uses Electron Builder for packaging.
Configured targets:
- Windows NSIS installer
- Windows portable build
- Linux AppImage
- Linux DEB package
Helpful scripts in package.json:
- npm start for local run
- npm run check for syntax checks
- npm run build for distributable builds
- npm run pack for unpackaged test build
Project Structure Tour
Top-level files and folders:
- src/main.js: Electron main process and IPC handlers
- src/preload.js: secure API bridge
- src/renderer/index.html: UI markup
- src/renderer/renderer.js: app behavior and state
- src/renderer/styles.css: full theme and layout system
- scripts/generate-icons.js: icon utility
- BUILD.md: packaging and troubleshooting notes
- FEATURES.md: concise feature inventory
Engineering Decisions Worth Calling Out
Why JSON storage instead of a database?
For a local-first desktop utility, JSON keeps complexity low and reliability high. The data volume is modest, write frequency is controlled, and migration burden stays manageable.
Why ffmpeg-static?
Bundling ffmpeg avoids system-level dependency setup and gives deterministic video behavior across developer machines and packaged app installs.
Why contextIsolation enabled?
It reduces renderer attack surface and enforces cleaner boundaries between UI logic and privileged system actions.
Lessons Learned During Development
- Session naming and filesystem safety must be handled early to prevent edge-case path failures.
- Timelapse quality is strongly tied to interval and scene dynamics, so sane defaults matter.
- Long-session tooling benefits from immediate visual feedback: counters, status pills, and recent history visibility.
- Packaging should be tested early; install-time details often reveal hidden assumptions.
Where This Project Can Go Next
Natural next milestones:
- Rich focus heatmap visualization with charts
- Session comparison dashboard (weekly/monthly trends)
- Exportable session report bundles
- Optional cloud sync for metadata only
- Smarter chaptering and highlight extraction for digest videos
Closing
Study CCTV Desktop is a focused example of a practical Electron product: useful core value, clear architecture, and room for meaningful growth. It starts simple, but it already creates a durable personal archive of work.
If you are publishing or open-sourcing this project, the key strengths to emphasize are:
- Fast setup
- Local-first privacy
- Cross-platform packaging
- A roadmap that bridges productivity and lightweight computer vision