Add comprehensive documentation and download feature (#83)

* fix: markdown files now default to rendered view and render properly

- Add .md and .mdx MIME type support in backend (files.ts, defaults.ts)
- Add key props to FilePreview components to force proper remounting when switching files
- Fix markdown file detection with case-insensitive extension check
- Reset markdownPreview state when file changes to ensure correct default view
- Add onContentLoaded callback to VirtualizedTextView for reactive content updates
- Add fullContent state to properly handle large markdown file rendering
- Add error handling for async content loading to prevent blank screens
- Reduce loading timeout from 50ms to 0ms for more responsive loading

Fixes issues where:
- Markdown files opened in raw view instead of rendered view
- Large markdown files (12k+ lines) showed blank after loading completed
- State persisted incorrectly when switching between different file types

* Add directory download feature with ZIP archive support

* Improve voice recording UX with loading states and better transcript handling

* Fix auth config for prod/dev ports and add documentation

Update AUTH_TRUSTED_ORIGINS and PASSKEY_ORIGIN to use backend port 5003 (frontend uses 5173 in dev). Add comprehensive auth documentation covering secrets, trusted origins, admin reset, and passkeys. Update README and add mkdocs config.

* Remove roadmap section from README
This commit is contained in:
Chris Scott authored and GitHub committed 2026-01-26 23:09:27 -05:00
1 parent 358abbf20e
commit da6cad8b3a
51 files changed
+4276 -353

No files matched your search

+104
View File
@@ -0,0 +1,104 @@
# First Run Setup
On your first visit to OpenCode Manager, you'll complete a guided setup process.
## Interactive Setup
When no admin account exists, you'll be automatically redirected to the setup page.
### Step 1: Create Admin Account
Fill in your account details:
- **Name** - Your display name
- **Email** - Used for login
- **Password** - Minimum 8 characters recommended
Click **Create Account** to continue.
### Step 2: Configure Provider (Optional)
After account creation, configure an AI provider:
1. Navigate to **Settings > Provider Credentials**
2. Select a provider
3. Enter API key or connect via OAuth
4. Save configuration
You can skip this and configure providers later.
## Pre-Configured Admin
For automated or headless deployments, skip interactive setup by setting environment variables:
```bash
# In docker-compose.yml or .env
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your-secure-password
```
When these are set:
- Admin user is created automatically on first startup
- Setup wizard is skipped
- Users must log in with configured credentials
## Adding Passkeys
After initial setup, you can add passkey authentication for passwordless login:
1. Go to **Settings > Security**
2. Click **Add Passkey**
3. Follow your browser/device prompts
4. Name your passkey (e.g., "MacBook Touch ID")
Passkeys provide:
- Passwordless login
- Phishing-resistant authentication
- Biometric support (Touch ID, Face ID, Windows Hello)
## Password Reset
If you forget your password:
1. Set environment variables:
```bash
ADMIN_EMAIL=your@email.com
ADMIN_PASSWORD=new-password
ADMIN_PASSWORD_RESET=true
```
2. Restart the application
3. Log in with new password
4. **Important:** Remove `ADMIN_PASSWORD_RESET=true` after successful reset
## Security Recommendations
### Production Deployments
- Set a strong `AUTH_SECRET` for session encryption
- Use HTTPS with valid SSL certificate
- Use strong, unique passwords
- Enable passkey authentication
- Regularly rotate API keys
### Generate AUTH_SECRET
```bash
openssl rand -base64 32
```
Add to your environment:
```bash
AUTH_SECRET=your-generated-secret-here
```
## Next Steps
- [Configure OAuth Providers](../configuration/oauth.md) - Enable social login
- [Environment Variables](../configuration/environment.md) - All configuration options
- [Features Overview](../features/overview.md) - Explore capabilities
+101
View File
@@ -0,0 +1,101 @@
# Installation
Choose your preferred installation method.
## Docker (Recommended)
Docker is the fastest way to get started and recommended for production use.
```bash
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
docker-compose up -d
```
Open [http://localhost:5003](http://localhost:5003) in your browser.
### What Docker Sets Up
The container automatically:
- Installs OpenCode if not present
- Builds and serves the frontend
- Creates persistent volumes for workspace and database
- Configures health checks and auto-restart
### Docker Commands
```bash
# Start the container
docker-compose up -d
# Stop and remove container
docker-compose down
# Rebuild the image
docker-compose build
# View logs
docker-compose logs -f
# Restart
docker-compose restart
# Access container shell
docker exec -it opencode-manager sh
```
### Volume Mounts
| Path | Purpose |
|------|---------|
| `./workspace` | Repository storage |
| `./data` | Database and config |
| `opencode-cache` | OpenCode cache |
## Local Development
For contributors who want to develop locally instead of using Docker.
### Prerequisites
- [pnpm](https://pnpm.io/installation) - Package manager (required for workspaces)
- [Bun](https://bun.sh) - Backend runtime
- [OpenCode TUI](https://opencode.ai) - `npm install -g @opencode/tui`
- Node.js 18+
### Setup
```bash
# Clone the repository
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
# Install dependencies
pnpm install
# Copy environment configuration
cp .env.example .env
# Start development servers
pnpm dev
```
This starts:
- Backend on http://localhost:5003
- Frontend on http://localhost:5173 (with HMR)
## Verifying Installation
After starting the application:
1. Open your browser to the appropriate URL
2. You should see the login page or setup wizard
3. Check logs if you encounter issues: `docker-compose logs -f`
## Next Steps
- [Quick Start](quickstart.md) - First steps after installation
- [First Run Setup](first-run.md) - Creating your admin account
- [Docker Configuration](../configuration/docker.md) - Advanced Docker settings
+104
View File
@@ -0,0 +1,104 @@
# Quick Start
Get up and running with OpenCode Manager in minutes.
## 1. Start the Application
=== "Docker"
```bash
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
docker-compose up -d
```
Open [http://localhost:5003](http://localhost:5003)
=== "Local Development"
```bash
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
pnpm install
cp .env.example .env
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173)
## 2. Create Admin Account
On first launch, you'll be redirected to the setup page:
1. Enter your **name**
2. Enter your **email**
3. Create a **password**
4. Click **Create Account**
!!! tip "Pre-configured Admin"
For automated deployments, you can skip this step by setting `ADMIN_EMAIL` and `ADMIN_PASSWORD` environment variables.
## 3. Configure AI Provider
Before chatting, you need to configure at least one AI provider:
1. Go to **Settings** (gear icon)
2. Select **Provider Credentials**
3. Choose a provider (e.g., Anthropic, OpenAI)
4. Enter your **API key** or click **Add OAuth** for supported providers
5. Click **Save**
## 4. Clone a Repository
1. Click the **folder icon** in the sidebar
2. Click **Clone Repository**
3. Paste a repository URL (HTTPS or SSH)
4. Click **Clone**
!!! note "Private Repositories"
For private repos, configure a GitHub Personal Access Token in Settings > Credentials first.
## 5. Start Chatting
1. Select your cloned repository from the sidebar
2. Click **New Session** or type `/new`
3. Type your message
4. Press **Enter** to send
### Useful Commands
| Command | Description |
|---------|-------------|
| `/help` | Show available commands |
| `/new` | Start a new session |
| `/models` | List available models |
| `/compact` | Reduce session context |
### File Mentions
Reference files in your prompts:
1. Type `@` in the chat input
2. Start typing a filename
3. Select from the autocomplete dropdown
4. The AI will have access to that file's contents
## 6. Explore Features
Now that you're set up, explore more features:
- **[Git Integration](../features/git.md)** - View diffs, manage branches
- **[File Browser](../features/files.md)** - Navigate and edit files
- **[MCP Servers](../features/mcp.md)** - Add tools and integrations
- **[Mobile PWA](../features/mobile.md)** - Install on your phone
## Keyboard Shortcuts
| Shortcut | Action |
|----------|--------|
| `Enter` | Send message |
| `Shift+Enter` | New line |
| `Ctrl+/` | Toggle sidebar |
| `Ctrl+K` | Command palette |
Customize shortcuts in Settings > Keyboard Shortcuts.