-
Notifications
You must be signed in to change notification settings - Fork 1
Add dashboard for explore data #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cf62f7b
chore: adds dashboard features
oliveirara 7ccb51e
Added Dev Container Folder
oliveirara 5a297ef
chore: fixes data path for streamlit deploy
oliveirara 891986b
fix: update minio endpoint url
oliveirara 71d1e92
chore: remove dashboard directory
oliveirara ccf2025
feat: create initial dashboard application
oliveirara 07b9701
feat: prepare data for dashboard from minio
oliveirara 2e985c8
build: add github actions workflow for react dashboard deployment
oliveirara 41d3579
build: add pyarrow and fastparquet to dependencies
oliveirara e0e26aa
ci: configure deployment workflow
oliveirara 13a3b20
docs: add README for dashboard setup and usage
oliveirara 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,33 @@ | ||
| { | ||
| "name": "Python 3", | ||
| // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
| "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", | ||
| "customizations": { | ||
| "codespaces": { | ||
| "openFiles": [ | ||
| "README.md", | ||
| "dashboard/streamlit-css.py" | ||
| ] | ||
| }, | ||
| "vscode": { | ||
| "settings": {}, | ||
| "extensions": [ | ||
| "ms-python.python", | ||
| "ms-python.vscode-pylance" | ||
| ] | ||
| } | ||
| }, | ||
| "updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'", | ||
| "postAttachCommand": { | ||
| "server": "streamlit run dashboard/streamlit-css.py --server.enableCORS false --server.enableXsrfProtection false" | ||
| }, | ||
| "portsAttributes": { | ||
| "8501": { | ||
| "label": "Application", | ||
| "onAutoForward": "openPreview" | ||
| } | ||
| }, | ||
| "forwardPorts": [ | ||
| 8501 | ||
| ] | ||
| } | ||
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,79 @@ | ||
| name: Deploy React Dashboard to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| paths: [ 'dashboard/**' ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
oliveirara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
| cache-dependency-path: 'dashboard/package-lock.json' | ||
oliveirara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| cd dashboard | ||
| pip install pandas numpy minio pyarrow fastparquet | ||
|
|
||
| - name: Prepare data from MinIO | ||
| env: | ||
| MINIO_ENDPOINT_URL: ${{ secrets.MINIO_ENDPOINT_URL }} | ||
| MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }} | ||
| MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }} | ||
| run: | | ||
| cd dashboard | ||
| python prepare_data.py | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| cd dashboard | ||
| npm ci | ||
|
|
||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v4 | ||
|
|
||
| - name: Build | ||
| run: | | ||
| cd dashboard | ||
| export BASE_PATH=/slcomp/ | ||
| npm run build | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: 'dashboard/dist' | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/streamlit' | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
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
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,22 @@ | ||
| node_modules/ | ||
| dist/ | ||
| .DS_Store | ||
| *.log | ||
| *.cache | ||
|
|
||
| # Local env files (never commit secrets) | ||
| .env* | ||
| !.env.example | ||
|
|
||
| # Generated data files | ||
| public/data/*.json | ||
|
|
||
| # Vite / TypeScript build artifacts | ||
| tsbuildinfo.tsbuildinfo | ||
|
|
||
| # Editor | ||
| .idea/ | ||
| .vscode/ | ||
|
|
||
| # Coverage / tests (future) | ||
| coverage/ |
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,34 @@ | ||
| # LaStBeRu Dashboard | ||
|
|
||
| Interactive dashboard for exploring astronomical lens data. | ||
|
|
||
| ## Features | ||
| * Sky map | ||
| * Filtering | ||
| * Data & consolidated parameter tables | ||
| * Image cutout gallery | ||
|
|
||
| ## Quick Start | ||
| ```bash | ||
| npm install | ||
| npm run dev # http://localhost:5173 | ||
| ``` | ||
|
|
||
| ## Data Files (place in `public/data/`) | ||
| | File | Purpose | | ||
| |------|---------| | ||
| | `database.json` | Main dataset | | ||
| | `consolidated_database.json` | Consolidated dataset | | ||
| | `cutouts.json` | Image cutout metadata | | ||
| | `dictionary.json` | Reference dictionary | | ||
|
|
||
| ## Theming | ||
| Edit `src/theme.ts` (palette, breakpoints, shadows, transitions). | ||
|
|
||
|
|
||
| ## Scripts | ||
| ```bash | ||
| npm run dev # Start dev server | ||
| npm run build # Production bundle | ||
| npm run lint # ESLint | ||
| ``` |
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,28 @@ | ||
| export default [ | ||
| { | ||
| ignores: ['dist/', 'node_modules/', '*.config.js'], | ||
| }, | ||
| { | ||
| files: ['src/**/*.{ts,tsx}'], | ||
| languageOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| parser: await import('@typescript-eslint/parser').then(m => m.default), | ||
| parserOptions: { | ||
| ecmaFeatures: { jsx: true }, | ||
| }, | ||
| }, | ||
| plugins: { | ||
| '@typescript-eslint': await import('@typescript-eslint/eslint-plugin').then(m => m.default), | ||
| 'react-hooks': await import('eslint-plugin-react-hooks').then(m => m.default), | ||
| 'react-refresh': await import('eslint-plugin-react-refresh').then(m => m.default), | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
| '@typescript-eslint/no-explicit-any': 'warn', | ||
| 'react-hooks/rules-of-hooks': 'error', | ||
| 'react-hooks/exhaustive-deps': 'warn', | ||
| 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
| }, | ||
| }, | ||
| ]; |
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,28 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta name="description" content="LaStBeRu Explorer - Interactive dashboard for astronomical data exploration" /> | ||
| <meta name="author" content="CosmoObs" /> | ||
| <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src 'self' data: blob: https: http:; style-src 'self' 'unsafe-inline'; script-src 'self'; connect-src 'self' https: http:; object-src 'none';" /> | ||
oliveirara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <title>The LaStBeRu Explorer</title> | ||
| <link rel="icon" type="image/png" href="/telescope.png" /> | ||
oliveirara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <style> | ||
| body { | ||
| background: radial-gradient(circle at 20% 20%, #13242d 0%, #091015 60%, #060b0f 100%); | ||
| margin: 0; | ||
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; | ||
| } | ||
| #root { min-height: 100vh; } | ||
| ::-webkit-scrollbar { width: 10px; } | ||
| ::-webkit-scrollbar-track { background: #0d171d; } | ||
| ::-webkit-scrollbar-thumb { background: linear-gradient(#274753,#1b3038); border-radius: 5px; } | ||
| ::-webkit-scrollbar-thumb:hover { background: linear-gradient(#2f5c6b,#23404a); } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.