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

Suite Components

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

tenantIdstringUUID v4
orgNamestringOrganization name
storageBucketstringIsolated S3 bucket
maxUsersnumberMax seats
featuresFeatureFlagsEnabled modules
retentionDaysnumberAudit 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
docIdstringDocument ID.
userIdstringAuthenticated user.
transportWebSocketWebSocket 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

versionIdstringVersion ID
docIdstringParent doc
authorIdstringAuthor
timestampDateISO 8601
opsOperation[]CRDT/OT ops
snapshotUint8Array|nullEvery 100 versions

AuditLogEntry

actionAuditActionCREATE, READ, UPDATE, DELETE, SHARE, EXPORT
userIdstringActor
resourceTypestringdoc, sheet, slide, note, email, file, form
piiRedactedbooleanPII stripped
PII Redaction

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
containerHTMLElementMount target.
configDocsConfigtoolbar, 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

MathSUM, AVERAGE, MIN, MAX, COUNT, ROUND
TextCONCAT, LEFT, RIGHT, MID, LEN, UPPER, LOWER
LogicalIF, AND, OR, NOT, IFERROR, SWITCH
LookupVLOOKUP, HLOOKUP, INDEX, MATCH, XLOOKUP
DateNOW, TODAY, DATEVALUE, YEAR, MONTH, DAY
FinancialPMT, 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

titleTitle + subtitleOpening
title-contentTitle + content areaStandard
two-columnTwo columnsComparisons
section-headerLarge centered titleDividers
image-fullFull-bleed imageVisual impact
blankEmpty canvasCustom
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
configMailConfigIMAP/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.

Endpoints

POST /v1/chat — Multi-turn conversation
POST /v1/complete — Text completion
POST /v1/summarize — Document summarization
POST /v1/task-extract — Extract tasks from text
POST /v1/search — Semantic search across documents

Promise<ChatResponse> ebotChat(messages: ChatMessage[], opts?: ChatOptions)

Multi-turn conversation with eBot.

Parameters
messagesChatMessage[]Array of {role, content}.
optsChatOptionsmodel, 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

rolestringsystem, user, or assistant
contentstringMessage content

ChatResponse

contentstringGenerated text
usage{prompt, completion, total}Token usage
modelstringModel used
finishReasonstringstop, length, tool_calls

🚀 Deployment

Browser, Desktop (Electron), and Docker deployment options.

Dev Servers

npm run dev:docs — port 5173
npm run dev:sheets — port 5174
npm run dev:server — port 3001
npm 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_URLstringPostgreSQL connection string
EOFFICE_S3_ENDPOINTstringS3/MinIO endpoint
EOFFICE_EAI_URLstringEAI server URL
EOFFICE_JWT_SECRETstringJWT signing secret
EOFFICE_PII_REDACTbooleanEnable PII redaction (default: true)