eOffice — AI-Powered Office Suite v0.1.0
Full-featured office productivity suite with integrated AI assistant (eBot). Built with TypeScript and React, eOffice provides word processing, spreadsheets, presentations, notebooks, email, cloud storage, collaboration, and forms — all powered by EAI.
Stack: TypeScript + React 18 | AI: EAI Server | Collab: CRDT / OT | License: MIT
eDocs — Word processing with rich text, templates, AI rewrite.
eSheets — Spreadsheets with formulas, charts, AI analysis.
eSlides — Presentations with layouts, animations, AI generation.
eNotes — Markdown notebooks with tags, search, AI summarization.
eMail — Email client with folders, search, AI compose.
eDrive — Cloud storage with sharing and versioning.
eConnect — Real-time messaging and collaboration.
eForms — Drag-and-drop form builder with response analytics.
🏗 Architecture
Multi-tenant, real-time collaborative office platform with centralized AI layer.
System Overview
Client Apps: eDocs | eSheets | eSlides | eNotes | eMail | eDrive | eConnect | eForms
eBot AI Layer: /v1/chat, /v1/complete, /v1/summarize, /v1/task-extract, /v1/search
EAI Server: Model Router | Prompt Cache | Rate Limiter
WebSocket Collab: CRDT (text docs) | OT (structured data) | Cursor Presence
Storage: S3/MinIO (documents) | PostgreSQL (users, metadata, audit)Multi-Tenant Architecture
Isolated tenants with per-org data separation, own storage namespace and config scope.
TenantConfig
tenantId | string | UUID v4 |
orgName | string | Organization name |
storageBucket | string | Isolated S3 bucket |
maxUsers | number | Max seats |
features | FeatureFlags | Enabled modules |
retentionDays | number | Audit retention |
Real-Time Collaboration (CRDT / OT)
CRDTs for text documents. OT for structured data. Engine auto-selected by document type.
CollabSession createCollabSession(docId: string, userId: string, transport: WebSocket)Bind a user to a document over WebSocket for real-time co-editing with cursor presence.
Parameters
| docId | string | Document ID. |
| userId | string | Authenticated user. |
| transport | WebSocket | WebSocket connection. |
Returns
CollabSession
Example
const ws = new WebSocket('wss://office.eos.dev/collab');
const session = createCollabSession('doc-abc', 'user-42', ws);
session.on('update', (ops) => applyOps(editor, ops));Data Model
DocumentVersion
versionId | string | Version ID |
docId | string | Parent doc |
authorId | string | Author |
timestamp | Date | ISO 8601 |
ops | Operation[] | CRDT/OT ops |
snapshot | Uint8Array|null | Every 100 versions |
AuditLogEntry
action | AuditAction | CREATE, READ, UPDATE, DELETE, SHARE, EXPORT |
userId | string | Actor |
resourceType | string | doc, sheet, slide, note, email, file, form |
piiRedacted | boolean | PII stripped |
Audit logs are PII-redacted. EOFFICE_PII_REDACT=true by default.
📄 eDocs — Word Processing
Rich text editor with templates, collaboration, and AI writing tools.
EditorInstance createDocsEditor(container: HTMLElement, config: DocsConfig)Rich text editor: Markdown, headings, lists, tables, images, code blocks.
Parameters
| container | HTMLElement | Mount target. |
| config | DocsConfig | toolbar, spellcheck, locale, collaboration. |
Returns
EditorInstance
Example
import { createDocsEditor } from '@eoffice/docs';
const editor = createDocsEditor(el, {
toolbar: ['bold','italic','heading','list','table','image','code'],
spellcheck: true, collaboration: { enabled: true }
});Promise<string> applyTemplate(templateId: string, vars: Record<string, string>)Apply template. Built-in: memo, report, letter, resume, invoice, meeting-notes.
eBot AI for eDocs
Promise<string> ebotRewrite(text: string, tone: RewriteTone)Rewrite text. Tones: formal, casual, concise, expanded, technical.
Example
const r = await ebotRewrite(sel, 'formal');
editor.replaceSelection(r);Promise<string> ebotSummarize(text: string, maxLen?: number)Summarize text. Default 200 words.
Promise<string> ebotTranslate(text: string, lang: string)Translate to 40+ languages. ISO 639-1 codes.
📊 eSheets — Spreadsheets
Cell engine with formulas, charts, pivot tables, and AI data analysis.
SpreadsheetInstance createSheet(container: HTMLElement, config: SheetConfig)Grid up to 1M rows x 16K cols with virtual scrolling.
Example
import { createSheet } from '@eoffice/sheets';
const sheet = createSheet(el, { formulaEngine: true });
sheet.setCell('A1','Revenue'); sheet.setCell('B1',150000);
sheet.setCell('B3','=SUM(B1:B2)');Formula Categories
Math | SUM, AVERAGE, MIN, MAX, COUNT, ROUND | |
Text | CONCAT, LEFT, RIGHT, MID, LEN, UPPER, LOWER | |
Logical | IF, AND, OR, NOT, IFERROR, SWITCH | |
Lookup | VLOOKUP, HLOOKUP, INDEX, MATCH, XLOOKUP | |
Date | NOW, TODAY, DATEVALUE, YEAR, MONTH, DAY | |
Financial | PMT, FV, PV, NPV, IRR, RATE |
ChartInstance createChart(range: CellRange, type: ChartType)Types: bar, line, pie, scatter, area, radar, histogram.
Example
sheet.createChart('A1:B12','bar',{title:'Monthly Revenue'});PivotTable createPivotTable(src: CellRange, cfg: PivotConfig)Pivot with rows, columns, values (SUM/COUNT/AVG), filters.
eBot AI for eSheets
Promise<string> ebotSuggestFormula(desc: string, ctx: CellContext)Natural language to formula.
Example
await ebotSuggestFormula('Avg B excl zeros', ctx);Promise<AnalysisResult> ebotAnalyzeData(range: CellRange, q?: string)AI analysis: insights, trends, outliers, chart suggestions.
🎬 eSlides — Presentations
Slide editor with layouts, animations, themes, and AI generation.
PresentationInstance createPresentation(container: HTMLElement, config: SlideConfig)Master slides, speaker notes, presenter view.
Example
const pres = createPresentation(el,{theme:'modern-dark',aspectRatio:'16:9'});
pres.addSlide('title',{title:'Q4 Results',subtitle:'Engineering'});
pres.addSlide('two-column',{title:'Metrics',
left:{type:'bullet-list',items:['Revenue +25%','Users +40%']},
right:{type:'chart',chartId:'rev-chart'}});Built-in Layouts
title | Title + subtitle | Opening |
title-content | Title + content area | Standard |
two-column | Two columns | Comparisons |
section-header | Large centered title | Dividers |
image-full | Full-bleed image | Visual impact |
blank | Empty canvas | Custom |
void addAnimation(elementId: string, anim: AnimationConfig)Animations: fade-in, slide-up, zoom-in, bounce, typewriter, wipe-left.
eBot AI for eSlides
Promise<Slide[]> ebotGenerateSlides(prompt: string, count?: number)Generate deck from text with titles, bullets, notes, layouts.
Example
const slides = await ebotGenerateSlides('Microservice patterns',10);
slides.forEach(s => pres.addSlide(s.layout,s.content));📝 eNotes — Notebooks
Markdown editor with tags, full-text search, and AI task extraction.
NotebookInstance createNotebook(container: HTMLElement, config: NotesConfig)Markdown live preview, LaTeX math, code highlighting, sidebar nav.
Example
const nb = createNotebook(el,{storage:'local',syncInterval:5000});
nb.createNote({title:'Sprint Review',body:'## Agenda\n- Demo\n- Retro',tags:['meeting']});Note[] searchNotes(query: string, filters?: SearchFilters)Full-text search. Filters: tags, dateRange, notebook, hasAttachments.
eBot AI for eNotes
Promise<string> ebotSummarizeNote(noteId: string)Summarize note preserving key decisions and action items.
Promise<Task[]> ebotExtractTasks(noteId: string)Extract tasks with title, assignee, due date, priority.
Example
const t = await ebotExtractTasks('note-sprint');
// [{title:'Update docs',assignee:'alice',priority:'high'}]📧 eMail — Email Client
IMAP/SMTP email with folders, threading, search, and AI compose.
MailClient createMailClient(config: MailConfig)IMAP/SMTP client. Multiple accounts, folders, labels, search.
Parameters
| config | MailConfig | IMAP/SMTP host, port, credentials, TLS. |
Example
const mail = createMailClient({
imap:{host:'imap.eos.dev',port:993,tls:true},
smtp:{host:'smtp.eos.dev',port:587,tls:true},
credentials:{user:'alice@eos.dev',password:process.env.MAIL_PASS}
});
await mail.send({to:['bob@eos.dev'],subject:'Update',body:'Done.'});Message[] fetchMessages(folder: string, opts?: FetchOptions)Fetch messages. Options: limit, offset, unreadOnly, since, search.
eBot AI for eMail
Promise<string> ebotCompose(prompt: string, tone?: RewriteTone)Generate email draft from natural language prompt.
Promise<string[]> ebotReplySuggestions(messageId: string)3 reply suggestions: brief, detailed, follow-up.
Example
const s = await ebotReplySuggestions('msg-123');
// ['Thanks, will review.','Detailed feedback...','Clarify timeline?']📁 eDrive — Cloud Storage
File upload/download, sharing, versioning, quota management.
Promise<FileEntry> uploadFile(file: File, path: string, opts?: UploadOptions)Upload file. Resumable for >10MB. Options: overwrite, encrypted, tags.
Example
await drive.uploadFile(file,'/projects/report.pdf',{encrypted:true});Promise<Blob> downloadFile(fileId: string, version?: number)Download file, optionally a historical version.
Promise<ShareLink> shareFile(fileId: string, config: ShareConfig)Share link. Config: access (view/edit), expiry, password, allowDownload.
FileVersion[] listVersions(fileId: string)List all versions with author, timestamp, size.
💬 eConnect — Collaboration
Real-time messaging, channels, threads, and file sharing.
ChatClient createChatClient(config: ConnectConfig)Channels, DMs, threads, reactions, file sharing.
Example
const chat = createChatClient({serverUrl:'wss://connect.eos.dev',authToken:token});
chat.joinChannel('engineering');
chat.sendMessage('engineering','Deploy complete!');void sendMessage(channelId: string, content: string, attachments?: File[])Send message with optional attachments.
Message[] getHistory(channelId: string, opts?: HistoryOptions)Message history. Options: limit, before, after, search.
📋 eForms — Form Builder
Drag-and-drop form creation with conditional logic and response analytics.
FormBuilder createFormBuilder(container: HTMLElement, config?: FormConfig)Fields: text, number, email, select, checkbox, radio, date, file, rating, matrix.
Example
const b = createFormBuilder(el);
b.addField({type:'text',label:'Name',required:true});
b.addField({type:'rating',label:'Satisfaction',max:5});Promise<FormResponse[]> getResponses(formId: string, opts?: ResponseOptions)Fetch form responses with pagination and filtering.
Analytics getAnalytics(formId: string)Response analytics: completion rate, avg time, field distributions.
🤖 eBot AI API
Central AI assistant powering all eOffice modules via EAI Server.
POST /v1/chat — Multi-turn conversationPOST /v1/complete — Text completionPOST /v1/summarize — Document summarizationPOST /v1/task-extract — Extract tasks from textPOST /v1/search — Semantic search across documents
Promise<ChatResponse> ebotChat(messages: ChatMessage[], opts?: ChatOptions)Multi-turn conversation with eBot.
Parameters
| messages | ChatMessage[] | Array of {role, content}. |
| opts | ChatOptions | model, temperature, maxTokens. |
Returns
ChatResponse
Example
const res = await ebotChat([
{role:'system',content:'Document assistant.'},
{role:'user',content:'Summarize this report.'}
],{model:'eai-large',temperature:0.3});ChatMessage
role | string | system, user, or assistant |
content | string | Message content |
ChatResponse
content | string | Generated text |
usage | {prompt, completion, total} | Token usage |
model | string | Model used |
finishReason | string | stop, length, tool_calls |
🚀 Deployment
Browser, Desktop (Electron), and Docker deployment options.
npm run dev:docs — port 5173npm run dev:sheets — port 5174npm run dev:server — port 3001npm run dev:all — All services concurrently
Browser
git clone https://github.com/embeddedos-org/eOffice.git
cd eOffice && npm install
npm run dev:all
Desktop (Electron)
npm run build
npm run electron:build
Docker Compose
docker compose up -d
# eoffice-web (80), eoffice-api (3001), eoffice-collab (3002)
# eoffice-eai (3003), postgres (5432), minio (9000)
Environment Variables
EOFFICE_DB_URL | string | PostgreSQL connection string |
EOFFICE_S3_ENDPOINT | string | S3/MinIO endpoint |
EOFFICE_EAI_URL | string | EAI server URL |
EOFFICE_JWT_SECRET | string | JWT signing secret |
EOFFICE_PII_REDACT | boolean | Enable PII redaction (default: true) |