Thanks to visit codestin.com
Credit goes to github.com

Skip to content

noa-no-h/cronus-1

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cronus

From Noa:

bun run build

bun run dev

not within electron-app but the full directory

Understand where your time went and reduce distractions.

Cronus in action

A modern AI-powered time tracking and productivity application.

Features

  • Automatic Time Tracking: Native window and app tracking across macOS, Windows, and Linux
  • AI-Powered Categorization: Intelligent activity categorization and insights
  • Distraction Management: Real-time distraction detection and prevention
  • Calendar Integration: Seamless integration with Google Calendar and other services
  • Analytics: Comprehensive dashboards and reporting

Tech Stack

Core Technologies

  • πŸƒ Bun - Fast JavaScript runtime and package manager
  • πŸ”„ Monorepo Structure with workspaces (client, server, shared)
  • βš›οΈ React + TypeScript for the frontend
  • 🎨 Tailwind CSS + Shadcn UI for styling
  • πŸ” tRPC for type-safe API calls
  • πŸ’³ Stripe for payments
  • πŸ“Š MongoDB for database
  • ⚑ Next.js for the marketing website

Key Libraries

  • Craco - Used for customizing Create React App configuration without ejecting
  • Lucide React - Icon library
  • React Router - Client-side routing
  • React Query - Data fetching and caching
  • Zod - Schema validation

πŸ“ Project Structure

.
β”œβ”€β”€ client/                 # React admin frontend
β”‚   β”œβ”€β”€ src/               # Source code
β”‚   β”œβ”€β”€ craco.config.js    # Craco configuration for CRA customization
β”‚   └── package.json       # Frontend dependencies
β”œβ”€β”€ nextjs-client/         # Next.js marketing website
β”‚   β”œβ”€β”€ app/              # Next.js 13+ app directory
β”‚   β”œβ”€β”€ components/       # Reusable components
β”‚   β”œβ”€β”€ modules/          # Page-specific modules
β”‚   └── public/           # Static assets
β”œβ”€β”€ server/                # Backend server
β”‚   β”œβ”€β”€ src/              # Source code
β”‚   └── package.json      # Backend dependencies
β”œβ”€β”€ shared/               # Shared types and utilities
β”‚   β”œβ”€β”€ types.ts         # Shared TypeScript types
β”‚   └── package.json     # Shared package configuration
└── electron-app/         # Electron desktop application
    β”œβ”€β”€ src/              # Source code (main, preload, renderer)
    └── package.json      # Electron app dependencies

��️ Getting Started

Prerequisites

  • Bun (latest version)
  • MongoDB
  • Stripe account (for payments)
  • Google OAuth credentials

Environment Variables

Contact the project maintainer to get the required environment variables. You'll need to set up:

  • MongoDB connection string
  • Stripe API keys
  • Google OAuth credentials
  • Other service-specific keys

Installation

  1. Clone the repository
git clone https://github.com/your-username/whatdidyougetdonetoday-ai.git
cd whatdidyougetdonetoday-ai
  1. Install dependencies
bun install
  1. Start the development servers

For the React admin frontend:

cd client
bun dev

For the backend:

cd server
bun dev

Running the Server and Electron App Together

To run both the backend server and the Electron application concurrently for development:

bun run dev:electron-server

Monorepo Structure

This project uses a monorepo structure with four main packages:

Next.js Client (/nextjs-client)

  • Marketing website and landing pages
  • Built with Next.js 13+ App Router
  • Tailwind CSS and Shadcn UI components
  • Blog system with markdown support
  • SEO optimized

Admin Client (/client)

  • Built with Create React App + Craco
  • Uses Tailwind CSS for styling
  • Implements Shadcn UI components
  • Handles all admin logic and UI

Server (/server)

  • Bun-based backend
  • tRPC for type-safe API endpoints
  • MongoDB integration with Mongoose
  • Handles authentication and payments
  • AI categorization services

Shared (/shared)

  • Contains shared TypeScript types
  • Used by both client and server
  • Ensures type safety across the stack

Electron App (/electron-app)

  • A desktop application built with Electron, React, and TypeScript
  • Native system integration for automatic time tracking
  • Cross-platform support (macOS, Windows, Linux)
  • For more details, see the Electron App README

Deployment

The application is set up as a monorepo with separate deployment targets:

  • Next.js Website: Deploy the nextjs-client directory to Vercel or similar
  • Admin Client: Deploy the client directory to a static hosting service
  • Backend: Deploy the server directory to a Node.js hosting service
  • Desktop App: Build and distribute via GitHub Releases or similar

πŸ“± Building and Running the Electron App

The Electron app uses Electron Builder for packaging and distribution. For detailed instructions on building, code signing, and publishing new releases, please refer to the dedicated README in the Electron app directory:

➑️ Electron App Build and Release Guide (electron-app/README.md)

This guide covers:

  • Development builds
  • Production builds (signed .app and .dmg)
  • Code signing setup
  • Publishing releases with OTA updates to S3

οΏ½οΏ½ Debugging

Viewing Logs on macOS

The native Objective-C modules use Apple's Unified Logging system (os_log). To view these logs for debugging purposes:

  1. Open the Console.app on macOS.
  2. Start the Cronus application.
  3. In the search bar of the Console app, enter the following filter and press Enter:
    subsystem:com.cronus.app
    
    This will display all log messages generated by the native modules, which is essential for diagnosing issues related to window tracking and native code execution.

Logos and Assets

Contributing

This is an open source project! Contributions are welcome. Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Smart Screen Time Desktopp App

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 88.4%
  • Objective-C++ 4.9%
  • JavaScript 4.0%
  • CSS 1.1%
  • Shell 1.1%
  • Objective-C 0.3%
  • Other 0.2%