A modern, extensible desktop text editor built with Electron, React, and TypeScript. This application demonstrates the implementation of key software design patterns to create a maintainable and scalable architecture.
- File Management: Browse your file system, open files, and save changes seamlessly.
- Code Editing: robust code editor component powered by CodeMirror.
- Syntax Highlighting: Automatic syntax highlighting detection for:
- JavaScript / TypeScript
- Java
- Assembly (.asm, .s)
- Plain Text
- Notification System: Real-time feedback for user actions (file saved, errors, etc.).
- Clean UI: A focused, dark-themed interface for coding.
- Electron: For cross-platform desktop application development.
- React: For building the user interface.
- TypeScript: For type-safe code.
- Sass: For styling.
- Webpack: For bundling the application.
- CodeMirror: For the underlying editor engine.
The project follows a modular architecture utilizing several GoF (Gang of Four) design patterns to separate concerns and improve code readability.
Used to encapsulate file operations as objects. This allows for cleaner execution and potential future features like undo/redo.
- Location:
src/renderer/command/ - Implementation:
SaveFileCommand,CreateFileCommand,CreateDirectoryCommandimplement theCommandinterface and are executed via aCommandInvoker.
Used to handle syntax highlighting logic dynamically based on the file type.
- Location:
src/renderer/strategy/ - Implementation: The
SyntaxFactorydetermines which strategy (JavascriptSyntaxStrategy,JavaSyntaxStrategy, etc.) to apply when a file is opened.
Used for the application-wide notification system.
- Location:
src/renderer/observer/ - Implementation:
NotificationCenteracts as the subject. Components likeNotificationPanelobserve changes and update the UI when new notifications are pushed.
- Node.js (>= 14.x)
- npm (>= 7.x)
-
Clone the repository:
git clone https://github.com/dcelik81/editor.git cd editor -
Install dependencies:
npm install
Start the application in development mode:
npm startsrc/
├── main/ # Electron Main Process code
│ ├── Application.ts # App lifecycle management
│ ├── IpcService.ts # IPC handlers (File system access)
│ └── ...
├── renderer/ # React Renderer Process code
│ ├── components/ # UI Components (Editor, Explorer, etc.)
│ ├── command/ # Command Pattern implementation
│ ├── strategy/ # Strategy Pattern implementation
│ ├── observer/ # Observer Pattern implementation
│ ├── App.tsx # Main React component
│ └── ...
└── ...