Shared Docs is a lightweight collaborative document workspace built for the Ajaia productivity-tools exercise. It focuses on a useful first pass: choose a demo account, create or import a Markdown document, edit it with quick formatting helpers, save it, reopen it, and share it with another workspace user.
- Create, rename, edit, save, and reopen documents.
- Markdown editor with quick actions for bold, italic, underline (
<u>), headings, bulleted lists, numbered lists, quotes, and inline code. - Write/Preview views with a safe rendered Markdown preview. Image syntax is intentionally not supported.
- Import
.mdand.txtfiles as new editable documents. - Seeded account picker with a visible distinction between owned and shared documents.
- Owner-managed sharing permissions with shared editing enabled for a simple collaboration demo.
- Autosave after a short pause and manual save with
Cmd/Ctrl + S. - PostgreSQL persistence for documents, users, and document shares.
- Basic validation, error states, reconnect messaging, and one automated Markdown behavior test.
-
Provision or connect a PostgreSQL database so
DATABASE_URLis available. -
Install the local development dependencies:
pnpm install
-
Push the development schema:
pnpm --filter @workspace/api-server run db:push
-
Start the API and web workflows:
pnpm --filter @workspace/api-server run dev pnpm --filter @workspace/shared-docs run dev
In Replit, use the configured workflows so the correct preview routing variables are supplied.
Docker Compose starts PostgreSQL, runs the database seeder, starts the Node API, and serves the React frontend through Nginx:
docker compose up --buildOpen http://localhost:3000. The API is available through the same origin at /api.
The backend and frontend are completely isolated Docker projects. Each service builds from its own directory with its own package manifest, lockfile, dependencies, source, and Dockerfile:
- Backend:
artifacts/api-server/ - Frontend:
artifacts/shared-docs/
The frontend does not import backend packages. Nginx proxies /api to the separate API container.
The database is stored in the shared-docs-postgres Docker volume. To stop the services while keeping data, run docker compose down. To also delete the local database volume and start over, run docker compose down -v.
You can change the web port with APP_PORT, or override the local PostgreSQL defaults with POSTGRES_DB, POSTGRES_USER, and POSTGRES_PASSWORD.
-
Run validation:
pnpm run typecheck pnpm --filter @workspace/shared-docs run test
Authentication is intentionally simulated for this assignment. Use the account picker in the left rail:
| Account | Review use | |
|---|---|---|
| Maya Chen | maya@ajaiastudio.com | Owner of the seeded documents |
| Liam Okafor | liam@ajaiastudio.com | Shared editor for “Project kickoff notes” |
| Sana Patel | sana@ajaiastudio.com | Shared editor for “Project kickoff notes” |
| Arjun Mehta | arjun@ajaiastudio.com | Shared editor for “Customer interview guide” |
| Zara Williams | zara@ajaiastudio.com | Available as a sharing recipient |
To demonstrate sharing, stay as Maya, open a document, select Share, and grant access to Zara. Switch to Zara in the account picker to see the document under Shared with you. Shared users can edit and save the same document; an open session refreshes every five seconds to pick up another user’s saved changes. Only the owner can grant access.
The import flow accepts plain text and Markdown files with .txt, .md, or .markdown extensions. The imported text becomes the content of a new editable document; the original file bytes are not retained as a separate attachment.
ARCHITECTURE.mdexplains the implementation choices and scope.AI_WORKFLOW.mdexplains where AI was used and how the output was checked.SUBMISSION.mdis the reviewer-oriented deliverables checklist.WALKTHROUGH_URL.txtis the handoff field for the final unlisted walkthrough link.
