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
22 changes: 22 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

echo "🔍 Running pre-commit checks..."

# Type checking
echo "📝 Type checking..."
npm run type-check
if [ $? -ne 0 ]; then
echo "❌ Type check failed"
exit 1
fi

# Linting
echo "🔍 Linting..."
npm run lint
if [ $? -ne 0 ]; then
echo "❌ Lint failed"
exit 1
fi

echo "✅ All pre-commit checks passed!"
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Get the native desktop experience with:
- 💾 **Auto-save** - Real-time saving with visual indicators
- 🔗 **Links & references** - Easy link insertion and management
- 🧮 **Code support** - Inline code and code blocks with syntax highlighting
- ⚡ **Executable code blocks** - Run JavaScript, Python, Java, C++, and 10+ other languages directly in your notes

### 📊 Professional Status Bar
- 📈 **Real-time statistics** - Word count, character count, reading time estimates
Expand All @@ -78,6 +79,20 @@ Get the native desktop experience with:
- 🌐 **Cross-platform** - Responsive web app that works seamlessly on desktop, tablet, and mobile
- 🖨️ **Print support** - Clean printing with proper formatting

### ⚡ Executable Code Blocks

![Execute Code Demo](https://github.com/typelets/typelets-app/blob/main/execute-code-demo.gif)

- 💻 **15+ Programming Languages** - JavaScript, TypeScript, Python, Java, C++, C#, Go, Rust, PHP, Ruby, Kotlin, Swift, Bash, SQL, and more
- 🎨 **Monaco Editor Integration** - Professional VS Code-powered editor with IntelliSense and syntax highlighting
- ⚡ **One-click Execution** - Run code instantly with the play button or `Ctrl+Enter` keyboard shortcut
- 📊 **Real-time Status Updates** - Live execution progress from "In Queue" → "Processing" → "Complete"
- 🔄 **Resizable Code Blocks** - Drag to adjust editor height for optimal viewing
- 🌙 **Theme Toggle** - Switch between light and dark Monaco editor themes
- 💾 **Persistent Results** - Code output is automatically saved with your notes
- 🔒 **Secure Sandboxed Execution** - Code runs in isolated environments via Judge0 API
- 📋 **Error Handling** - Clear error messages and compilation details for debugging

## 🔒 Security First

Typelets uses industry-standard encryption:
Expand Down Expand Up @@ -146,7 +161,13 @@ VITE_APP_NAME=Typelets
VITE_APP_VERSION=0.5.0
```

Get your Clerk keys from [dashboard.clerk.com](https://dashboard.clerk.com)
**Authentication Setup:**
- Get your Clerk keys from [dashboard.clerk.com](https://dashboard.clerk.com)

**Code Execution Setup:**
- Code execution is handled securely by your backend API
- The backend proxy manages Judge0 API integration
- No client-side API keys required for security

### Development Proxy

Expand Down Expand Up @@ -374,6 +395,8 @@ typelets/
- **Build Tool:** Vite 7 with development proxy
- **Styling:** Tailwind CSS v4
- **Editor:** TipTap with code highlighting
- **Code Editor:** Monaco Editor (VS Code engine)
- **Code Execution:** Judge0 API for 15+ programming languages
- **Authentication:** Clerk
- **UI Components:** Radix UI
- **Encryption:** Web Crypto API with AES-256-GCM
Expand Down
Binary file added assets/execute-code-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
},
"dependencies": {
"@clerk/clerk-react": "^5.41.0",
"@monaco-editor/react": "^4.7.0",
"@radix-ui/react-alert-dialog": "^1.1.14",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-dropdown-menu": "^2.1.15",
Expand Down Expand Up @@ -90,6 +91,7 @@
"highlight.js": "^11.11.1",
"lowlight": "^3.3.0",
"lucide-react": "^0.523.0",
"monaco-editor": "^0.53.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"tailwind-merge": "^3.3.1",
Expand Down
44 changes: 44 additions & 0 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Index from '@/components/common/SEO';
import { SEO_CONFIG } from '@/constants';
import { api } from '@/lib/api/api.ts';
import { fileService } from '@/services/fileService';
import { codeExecutionService } from '@/services/codeExecutionService';
import { clearUserEncryptionData } from '@/lib/encryption';
import MainApp from '@/pages/MainApp';

Expand All @@ -23,6 +24,7 @@ function AppContent() {
useEffect(() => {
api.setTokenProvider(getToken);
fileService.setTokenProvider(getToken);
codeExecutionService.setTokenProvider(getToken);
}, [getToken]);

useEffect(() => {
Expand Down
10 changes: 10 additions & 0 deletions src/components/editor/Editor/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
RemoveFormatting,
Copy,
Smile,
Codesandbox,
} from 'lucide-react';

import { Button } from '@/components/ui/button.tsx';
Expand Down Expand Up @@ -395,6 +396,15 @@ export function Toolbar({ editor }: ToolbarProps) {
</DropdownMenuContent>
</DropdownMenu>

<Button
variant={editor.isActive('executableCodeBlock') ? 'default' : 'ghost'}
size="sm"
onClick={() => editor.chain().focus().setExecutableCodeBlock({ language: 'javascript' }).run()}
title="Executable Code Block"
>
<Codesandbox className="h-4 w-4" />
</Button>

<Button
variant={editor.isActive('blockquote') ? 'default' : 'ghost'}
size="sm"
Expand Down
7 changes: 7 additions & 0 deletions src/components/editor/config/editor-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Color from '@tiptap/extension-color';
import TextStyle from '@tiptap/extension-text-style';
import { TableOfContents } from '../extensions/TableOfContents';
import { ResizableImage } from '../extensions/ResizableImage';
import { ExecutableCodeBlock } from '../extensions/ExecutableCodeBlock';
import StarterKit from '@tiptap/starter-kit';
import bash from 'highlight.js/lib/languages/bash';
import cpp from 'highlight.js/lib/languages/cpp';
Expand Down Expand Up @@ -56,6 +57,12 @@ export function createEditorExtensions() {
horizontalRule: false,
dropcursor: false,
}),
ExecutableCodeBlock.configure({
defaultLanguage: 'javascript',
HTMLAttributes: {
class: 'executable-code-block',
},
}),
CodeBlockLowlight.configure({
lowlight,
defaultLanguage: 'plaintext',
Expand Down
Loading