A TypeScript-based web application for sharing markdown documents with configurable expiry dates, view limits, file attachments, and admin management.
- π Secure Sharing: Documents are stored temporarily and automatically deleted
- β° Time-based Expiry: Set documents to expire after 1-168 hours
- ποΈ View Limits: Configure maximum number of views (1-100)
- π Markdown Support: Full markdown rendering with syntax highlighting
- π File Attachments: Upload files up to 10MB each
- π¨ Material Design 3: Modern, clean interface with Material Icons
- π HTML Import: Convert HTML content to markdown
- π¨βπΌ Admin Panel: Secure admin interface for document management
- β‘ TypeScript: Fully typed frontend and backend
- ποΈ IIS Ready: Deployment package for Windows IIS
-
Install dependencies:
npm install
-
Start development servers:
npm run dev
This runs both the frontend (port 5173) and backend (port 3001) concurrently.
-
Open your browser: Navigate to
http://localhost:5173
- Build the application:
npm run start
-
Build deployment package:
npm run build:iis
-
Deploy to Windows IIS: See IIS Deployment Guide for detailed instructions.
-
Add Content:
- Paste markdown content in the text area, or
- Upload files using the attachment button, or
- Convert HTML content to markdown
-
Configure Settings:
- Set maximum number of views (1-100)
- Set expiry time in hours (1-168, max 1 week)
- Add an optional title
-
Generate Link:
- Click "Generate Secure Link"
- Share the generated URL
-
Access Admin: Navigate to
/adminand enter admin password (default:admin123) -
Manage Documents:
- View all active documents
- See view counts and expiry times
- Monitor system usage
- Navigate to the generated URL
- The document will be displayed with proper markdown formatting
- View count decreases with each access
- Document is automatically deleted when expired or view limit reached
Create a new document with optional file attachments.
Content-Type: application/json or multipart/form-data
Request Body (JSON):
{
"content": "# Your markdown content here",
"maxViews": 1,
"expiryHours": 24,
"title": "Optional document title",
"attachmentIds": ["uuid1", "uuid2"]
}Request Body (FormData with files):
content: "# Your markdown content"
maxViews: "1"
expiryHours: "24"
title: "Optional title"
files: [File objects]
Response:
{
"success": true,
"id": "uuid-string",
"url": "https://your-domain.com/view/uuid-string",
"expiryDate": "2024-01-01T00:00:00.000Z",
"maxViews": 1,
"attachmentCount": 2
}Retrieve a document by ID (decrements view count).
Response:
{
"success": true,
"content": "# Your markdown content",
"remainingViews": 0,
"expiryDate": "2024-01-01T00:00:00.000Z",
"title": "Document title",
"attachments": [
{
"id": "uuid",
"filename": "file.pdf",
"mimetype": "application/pdf",
"size": 1024,
"url": "/api/attachment/uuid"
}
]
}Upload a single file for later attachment to documents.
Content-Type: multipart/form-data
Download an attachment file.
Authenticate admin user.
Get list of all active documents (requires admin auth).
linkgen/
βββ backend/
β βββ server.ts # Main production server
β βββ server-dev.ts # Development server (simplified)
βββ src/
β βββ main.ts # Frontend TypeScript application
β βββ style.css # Application styles
βββ public/ # Static assets
βββ build-iis.js # IIS deployment build script
βββ build-iis.ps1 # PowerShell build script
βββ deploy-iis.sh # Quick deployment script
βββ index.html # Main HTML template
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite build configuration
βββ README.md # This file
βββ README-IIS-DEPLOYMENT.md # IIS deployment guide
dist/ # Built frontend (after npm run build)
dist-server/ # Built backend (after npm run server:build)
deploy/ # IIS deployment package (after npm run build:iis)
- Temporary Storage: Documents stored in memory only (not persisted to disk)
- Automatic Cleanup: Expired documents removed every 5 minutes
- View Count Enforcement: Documents deleted after max views reached
- Input Validation: All endpoints validate input data and file types
- Admin Authentication: JWT-based admin sessions with configurable passwords
- File Size Limits: 10MB maximum per file upload
- CORS Protection: Configurable cross-origin request handling
- Request Size Limits: Protection against large payload attacks
- TypeScript: Type-safe development
- Vite: Fast build tool and dev server
- Material Design 3: Modern UI components and styling
- Material Symbols: Consistent iconography
- Marked: Markdown parsing and rendering
- Turndown: HTML to markdown conversion
- Node.js + Express: Server framework
- TypeScript: Full type safety
- Multer: File upload handling
- bcryptjs: Password hashing
- jsonwebtoken: Admin authentication
- UUID: Unique document identification
- tsx: TypeScript execution for development
- concurrently: Run multiple dev processes
- Vite: Hot module replacement
PORT=3001 # Server port (default: 3001)PORT=80 # Server port
ADMIN_PASSWORD=your-password # Admin panel password (default: admin123)
JWT_SECRET=your-jwt-secret # Secret for JWT tokens (change in production!)
NODE_ENV=production # Environment mode
IISNODE_PORT=80 # IIS-specific port (when using iisnode)- Maximum views per document: 100
- Maximum expiry time: 168 hours (1 week)
- Maximum file size: 10MB per file
- Document cleanup interval: 5 minutes
- Maximum request body size: 10MB
- Simplified routing for faster development
- Enhanced logging for debugging
- Automatic TypeScript compilation with tsx
- CORS enabled for local development
- Full feature set with admin authentication
- Environment-based configuration
- Optimized for deployment
- Enhanced security features
Use the built-in IIS deployment scripts:
npm run build:iis # Create deployment package
./deploy-iis.sh # Quick deploy scriptSee README-IIS-DEPLOYMENT.md for detailed instructions.
For platforms like Heroku, Railway, DigitalOcean, etc.:
npm run build # Build frontend
npm run server:build # Build backend
npm start # Start production servernpm run start # Build and start locallyMIT License - feel free to use this project for your own needs!