Skip to content

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Shared Docs

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.

What works

  • 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 .md and .txt files 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.

Local setup

  1. Provision or connect a PostgreSQL database so DATABASE_URL is available.

  2. Install the local development dependencies:

    pnpm install
  3. Push the development schema:

    pnpm --filter @workspace/api-server run db:push
  4. 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.

Start with Docker

Docker Compose starts PostgreSQL, runs the database seeder, starts the Node API, and serves the React frontend through Nginx:

docker compose up --build

Open 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.

  1. Run validation:

    pnpm run typecheck
    pnpm --filter @workspace/shared-docs run test

Review accounts

Authentication is intentionally simulated for this assignment. Use the account picker in the left rail:

Account Email 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.

Screenshot

image

File support

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.

Project notes

  • ARCHITECTURE.md explains the implementation choices and scope.
  • AI_WORKFLOW.md explains where AI was used and how the output was checked.
  • SUBMISSION.md is the reviewer-oriented deliverables checklist.
  • WALKTHROUGH_URL.txt is the handoff field for the final unlisted walkthrough link.

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages