diff --git a/cshare-app/src/pages/DocsPage.jsx b/cshare-app/src/pages/DocsPage.jsx new file mode 100644 index 0000000..b313a01 --- /dev/null +++ b/cshare-app/src/pages/DocsPage.jsx @@ -0,0 +1,212 @@ +import { useState } from 'react'; +import { LinkIcon, UploadIcon, ShieldIcon, ClockIcon, ChartIcon } from '../components/Icons'; + +const NAV = [ + { id: 'quickstart', label: 'Quick Start' }, + { id: 'uploading', label: 'Uploading Files' }, + { id: 'sharing', label: 'Share Links' }, + { id: 'expiry', label: 'Link Expiry' }, + { id: 'analytics', label: 'Analytics' }, + { id: 'api', label: 'API Reference' }, + { id: 'faq', label: 'FAQ' }, +]; + +const Code = ({ children }) => ( + + {children} + +); + +const Inline = ({ children }) => ( + + {children} + +); + +const Section = ({ id, title, icon, children }) => ( +
+
+ {icon && {icon}} +

{title}

+
+ {children} +
+); + +const P = ({ children }) => ( +

{children}

+); + +const H3 = ({ children }) => ( +

{children}

+); + +export default function DocsPage() { + const [active, setActive] = useState('quickstart'); + + const scrollTo = (id) => { + setActive(id); + document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' }); + }; + + return ( +
+
+
+ // + Documentation +
+

CShare Docs

+

Everything you need to upload, share, and track files.

+
+ +
+ {/* Sidebar */} +
+
+
+ On this page +
+ {NAV.map((item) => ( + + ))} +
+
+ + {/* Content */} +
+
}> +

Get from zero to a shared link in under 30 seconds.

+

1. Go to the upload page

+

Navigate to /upload or click Start Sharing from the landing page.

+

2. Drop your file

+

Drag a file into the drop zone or click to browse. Files up to 500 MB are supported on the Pro plan, 100 MB on Free.

+

3. Copy your link

+

Once the upload completes, click Share to generate a time-limited link, then copy it to your clipboard.

+
+ +
}> +

CShare accepts any file type. There are no format restrictions — PDF, ZIP, PNG, video, executables, design files — everything works.

+

Size limits

+
+ {[['Free', '100 MB per file'], ['Pro', '500 MB per file'], ['Team', '500 MB per file'], ['Enterprise', 'Custom']].map(([plan, limit]) => ( +
+
{plan}
+
{limit}
+
+ ))} +
+

Multi-file uploads

+

You can select multiple files at once. Each gets its own independent share link and expiry. Use Share All to generate links for all files in one click.

+
+ +
}> +

Every uploaded file gets a unique, unguessable link in the format:

+ https://cshare.app/preview/{''} +

Links do not require the recipient to have a CShare account. Anyone with the link can view and download the file until it expires.

+

Password protection Pro

+

On Pro and Team plans, you can set an optional password on any link. Recipients will be prompted to enter it before downloading.

+
+ +
}> +

All links expire automatically. Once expired, the file is permanently deleted and the link returns a 404.

+

Default expiry windows

+
+ {[['Free', '7 days (fixed)'], ['Pro', '1 hour → 90 days (your choice)'], ['Team', '1 hour → 90 days (your choice)']].map(([plan, window]) => ( +
+ {plan} + {window} +
+ ))} +
+

Expiry is enforced server-side at request time — no client-side tricks.

+
+ +
}> +

The dashboard tracks views (link opens) and downloads per file in real time.

+

What counts as a view

+

A view is recorded each time the share page is loaded. Refreshes by the same session are deduplicated.

+

What counts as a download

+

A download is recorded when the file transfer completes successfully on the recipient's end.

+
+ +
}> +

The REST API is available on Pro and Team plans. Authenticate with a bearer token from your account settings.

+

Upload a file

+ {`POST /api/v1/files/upload +Authorization: Bearer +Content-Type: multipart/form-data + +{ + "file": , + "expiresIn": 86400 // seconds (optional, default 30 days) +}`} +

List your files

+ {`GET /api/v1/files +Authorization: Bearer + +// Response +{ + "files": [ + { + "id": "a7k2m9x", + "name": "report.pdf", + "size": 2458624, + "link": "https://cshare.app/preview/a7k2m9x", + "expires_at": "2026-06-25T10:30:00Z", + "views": 142, + "downloads": 38 + } + ] +}`} +

Delete a file

+ {`DELETE /api/v1/files/:id +Authorization: Bearer + +// 204 No Content on success`} +
+ +
}> + {[ + ['Is my data encrypted?', 'Yes. Files are encrypted in transit (TLS 1.3) and at rest (AES-256). Only someone with the link can access the file.'], + ['Can I delete a file before it expires?', 'Yes. From your dashboard, click the delete icon next to any file to remove it and invalidate its link immediately.'], + ['What happens if I exceed my upload limit on Free?', "You'll see an error message. Upgrade to Pro for unlimited uploads."], + ['Do you store files after expiry?', 'No. Expired files are permanently deleted from storage within minutes of expiry. There is no recovery path.'], + ].map(([q, a]) => ( +
+
{q}
+

{a}

+
+ ))} +
+
+
+
+ ); +}