-
Notifications
You must be signed in to change notification settings - Fork 2
docs: Add documentation for FlatRun UI #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Lantum-Brendan
wants to merge
5
commits into
flatrun:main
Choose a base branch
from
Lantum-Brendan:docs/create-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a155b5e
docs: Add docs.json
Lantum-Brendan a667c94
docs: Add docs/overview.md
Lantum-Brendan 6c0fdb9
docs: Add docs/development.md
Lantum-Brendan ec72047
docs: Add docs/connecting-to-agent.md
Lantum-Brendan 6646e95
docs: Add docs/deployment.md
Lantum-Brendan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/whilesmart/docs-kit/main/schema/docs.schema.json", | ||
| "name": "FlatRun UI", | ||
| "description": "Modern Vue 3 web interface for FlatRun container orchestration with real-time monitoring and deployment management", | ||
| "icon": "layout-dashboard", | ||
| "category": { | ||
| "language": "typescript", | ||
| "framework": "vue" | ||
| }, | ||
| "sidebar": [ | ||
| { "title": "Overview", "path": "docs/overview.md" }, | ||
| { "title": "Development", "path": "docs/development.md" }, | ||
| { "title": "Connecting to Agent", "path": "docs/connecting-to-agent.md" }, | ||
| { "title": "Production Deployment", "path": "docs/deployment.md" } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ## Connecting to FlatRun Agent | ||
|
|
||
| The UI requires a running FlatRun Agent instance. See the [FlatRun Agent documentation](https://github.com/flatrun/agent) for installation instructions. | ||
|
|
||
| ### Environment Configuration | ||
|
|
||
| Create a `.env.local` file: | ||
|
|
||
| ```bash | ||
| # FlatRun Agent API URL | ||
| VITE_API_URL=http://localhost:8090 | ||
| ``` | ||
|
|
||
| For production: | ||
|
|
||
| ```bash | ||
| VITE_API_URL=https://your-server.com/api | ||
| ``` | ||
|
|
||
| ### Authentication | ||
|
|
||
| The UI uses the API key configured in the agent's `config.yml`. Enter the key when prompted by the login form. | ||
|
|
||
| ### CORS Configuration | ||
|
|
||
| If the UI runs on a different domain or port than the agent, ensure the agent's CORS settings include your UI URL: | ||
|
|
||
| ```yaml | ||
| # In agent's config.yml | ||
| api: | ||
| enable_cors: true | ||
| allowed_origins: | ||
| - http://localhost:5173 | ||
| - https://your-ui-domain.com | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,55 @@ | ||||||||||||||||||||||||||||||
| ## Production Deployment | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Build | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| npm run build | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| This creates a `dist/` directory with optimized static files. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Serving with Nginx | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```nginx | ||||||||||||||||||||||||||||||
| server { | ||||||||||||||||||||||||||||||
| listen 80; | ||||||||||||||||||||||||||||||
| server_name flatrun.example.com; | ||||||||||||||||||||||||||||||
| root /var/www/flatrun-ui/dist; | ||||||||||||||||||||||||||||||
| index index.html; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| location / { | ||||||||||||||||||||||||||||||
| try_files $uri $uri/ /index.html; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| location /api { | ||||||||||||||||||||||||||||||
| proxy_pass http://localhost:8090; | ||||||||||||||||||||||||||||||
| proxy_set_header Host $host; | ||||||||||||||||||||||||||||||
| proxy_set_header X-Real-IP $remote_addr; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Docker Deployment | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```dockerfile | ||||||||||||||||||||||||||||||
| FROM nginx:alpine | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Dockerfile relies on a local
Suggested change
|
||||||||||||||||||||||||||||||
| COPY dist/ /usr/share/nginx/html/ | ||||||||||||||||||||||||||||||
| COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||||||||||||||||||||||||||||
| EXPOSE 80 | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Troubleshooting | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Cannot connect to agent:** | ||||||||||||||||||||||||||||||
| - Verify the agent is running: `systemctl status flatrun-agent` | ||||||||||||||||||||||||||||||
| - Check `VITE_API_URL` is correct in `.env.local` | ||||||||||||||||||||||||||||||
| - Ensure CORS is configured if running on different domains | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Authentication fails:** | ||||||||||||||||||||||||||||||
| - Verify the API key matches the agent's configuration | ||||||||||||||||||||||||||||||
| - Check the browser console for specific error messages | ||||||||||||||||||||||||||||||
| - Ensure the JWT secret is properly set in the agent config | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **UI shows no deployments:** | ||||||||||||||||||||||||||||||
| - Confirm the agent's `deployments_path` is accessible | ||||||||||||||||||||||||||||||
| - Check that deployments have valid `docker-compose.yml` files | ||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| ## Development | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Node.js 18 or later and npm | ||
|
|
||
| ### Setup | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The development server starts at `http://localhost:5173`. | ||
|
|
||
| ### Project Structure | ||
|
|
||
| ``` | ||
| ui/ | ||
| ├── src/ | ||
| │ ├── assets/ Static assets and global styles | ||
| │ ├── components/ Reusable Vue components (DataTable, etc.) | ||
| │ ├── layouts/ Page layouts (DashboardLayout) | ||
| │ ├── views/ Page components (HomeView, DeploymentsView, etc.) | ||
| │ ├── stores/ Pinia stores (auth, deployments) | ||
| │ ├── router/ Vue Router configuration | ||
| │ ├── services/ API client services (axios instances) | ||
| │ ├── types/ TypeScript type definitions | ||
| │ ├── App.vue Root component | ||
| │ └── main.ts Application entry point | ||
| ├── public/ Public static files | ||
| └── index.html HTML entry point | ||
| ``` | ||
|
|
||
| ### Available Scripts | ||
|
|
||
| | Command | Description | | ||
| |---|---| | ||
| | `npm run dev` | Start development server | | ||
| | `npm run build` | Build for production | | ||
| | `npm run preview` | Preview production build locally | | ||
| | `npm run lint` | Run ESLint | | ||
| | `npm run format` | Format code with Prettier | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ## Overview | ||
|
|
||
| FlatRun UI provides a user-friendly dashboard for managing Docker deployments through the FlatRun Agent. It offers real-time monitoring, container management, and a streamlined deployment workflow. | ||
|
|
||
| ### Features | ||
|
|
||
| - **Deployment Management** - Create, start, stop, and delete Docker Compose deployments | ||
| - **Container Monitoring** - Real-time status, resource usage, and health checks | ||
| - **Log Viewer** - Live streaming logs with search and filtering | ||
| - **Docker Resource Management** - Images, volumes, and networks overview | ||
| - **SSL Certificate Tracking** - Monitor certificate expiration and status | ||
| - **Quick App Templates** - Deploy common applications with pre-configured templates | ||
| - **System Health Dashboard** - CPU, memory, and disk usage monitoring | ||
| - **JWT Authentication** - Secure API key-based authentication | ||
|
|
||
| ### Tech Stack | ||
|
|
||
| - **Framework:** Vue 3 with Composition API | ||
| - **Language:** TypeScript | ||
| - **Build Tool:** Vite | ||
| - **State Management:** Pinia | ||
| - **Routing:** Vue Router | ||
| - **UI Components:** PrimeVue | ||
| - **HTTP Client:** Axios |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Nginx configuration for
/apiis missing therewritedirective if the backend agent doesn't expect the/apiprefix, or it may need trailing slash consistency. Also,proxy_set_header X-Forwarded-Foris a standard best practice for identifying the client IP through proxies.