Frontend web application for M-OBS (Mantle Observability Stack) - built with SvelteKit.
GitHub: https://github.com/hackonteam/m-obs-frontend
Main Repository: https://github.com/hackonteam/m-obs
Modern, responsive web application for monitoring and analyzing Mantle blockchain transactions in real-time.
- π Dashboard - Real-time metrics with interactive charts
- π Transaction Explorer - Search, filter, and analyze transactions
- π₯ Provider Health - Monitor RPC provider performance
- π Alert Management - Configure and manage custom alerts
- π Contract Watchlist - Track specific contracts
- βοΈ Settings - Configure application preferences
- Framework: SvelteKit 2.x
- Language: TypeScript
- Styling: Tailwind CSS + DaisyUI
- Charts: uPlot (high-performance time-series)
- Build Tool: Vite
- Package Manager: pnpm
- Node.js 20+ (LTS)
- pnpm 8+ (
npm install -g pnpm) - M-OBS Backend API running
Create .env file in the frontend directory:
# Backend API URL
PUBLIC_API_URL=http://localhost:8000
# Optional: Application name/branding
PUBLIC_APP_NAME=M-OBSFor production deployment on Vercel:
PUBLIC_API_URL=https://m-obs-api.onrender.compnpm installpnpm dev
# Or specify host/port
pnpm dev --host 0.0.0.0 --port 5173Application will be available at: http://localhost:5173
pnpm buildpnpm previewpnpm lintpnpm checkfrontend/
βββ src/
β βββ routes/ # SvelteKit pages
β β βββ +layout.svelte # Root layout with sidebar
β β βββ +page.svelte # Dashboard (overview)
β β βββ providers/
β β β βββ +page.svelte # Provider health page
β β βββ transactions/
β β β βββ +page.svelte # Transaction list
β β β βββ [hash]/
β β β βββ +page.svelte # Transaction detail
β β βββ alerts/
β β β βββ +page.svelte # Alert management
β β βββ settings/
β β βββ +page.svelte # Settings page
β βββ lib/
β β βββ api/
β β β βββ client.ts # API client with typed methods
β β βββ components/
β β βββ charts/
β β βββ LineChart.svelte # uPlot chart wrapper
β βββ app.html # HTML template
β βββ app.css # Global styles
βββ static/
β βββ favicon.svg # Application icon
βββ package.json
βββ svelte.config.js
βββ tailwind.config.js
βββ tsconfig.json
βββ vite.config.ts
- Backend API: Deployed and accessible (see backend README)
- GitHub Account: Repository pushed to GitHub
- Vercel Account: Sign up at https://vercel.com
- Go to https://vercel.com/dashboard
- Click "Add New..." β "Project"
- Import from GitHub:
https://github.com/hackonteam/m-obs-frontend - Click "Import"
Vercel will auto-detect SvelteKit. Configure:
- Project Name:
m-obs(or your preferred name) - Framework Preset: SvelteKit
- Root Directory:
./(if deploying from root) or leave empty - Build Command:
pnpm build(auto-detected) - Output Directory:
.svelte-kit(auto-detected) - Install Command:
pnpm install(auto-detected)
Add environment variable:
PUBLIC_API_URL=https://m-obs-api.onrender.com
Replace with your actual backend API URL from Render.
- Click "Deploy"
- Wait 2-3 minutes for build and deployment
- Note your deployment URL:
https://m-obs.vercel.app(or custom domain)
Update your backend API's CORS_ORIGINS environment variable on Render to include your Vercel URL:
CORS_ORIGINS=https://m-obs.vercel.appRestart the backend API service on Render.
Visit your Vercel URL and verify:
- β Dashboard loads with metrics
- β Transactions page works
- β Provider health shows data
- β Charts render correctly
- β No CORS errors in browser console
- Go to your project β "Settings" β "Domains"
- Add your custom domain (e.g.,
monitor.yourdomain.com) - Follow DNS configuration instructions
- Wait for DNS propagation (5-60 minutes)
Add your custom domain to backend's CORS_ORIGINS:
CORS_ORIGINS=https://monitor.yourdomain.comVercel automatically deploys:
- Production: Pushes to
mainbranch - Preview: Pull requests and other branches
In Vercel project settings β "Environment Variables":
- Production: API URL for production backend
- Preview: API URL for staging backend (optional)
- Development: Local API URL
Optimize build times:
- Use pnpm workspace caching (auto-configured)
- Minimize dependencies
- Use
pnpm install --frozen-lockfilein CI
Every pull request gets a preview URL:
- Test changes before merging
- Share with team for review
- Automatic cleanup after merge
Symptoms: Browser console shows CORS errors, API calls fail
Solution:
- Check
PUBLIC_API_URLin Vercel environment variables - Verify backend's
CORS_ORIGINSincludes your Vercel URL - Restart backend API service after CORS changes
Symptoms: "Failed to fetch" errors, 500 errors
Solution:
- Verify backend API is running:
curl https://your-api-url.onrender.com/health - Check
PUBLIC_API_URLenvironment variable - Check browser Network tab for actual error
Symptoms: Vercel build fails
Solution:
- Check build logs in Vercel dashboard
- Run
pnpm buildlocally to reproduce - Verify
package.jsondependencies - Check Node.js version compatibility
Symptoms: White screen, no content
Solution:
- Check browser console for JavaScript errors
- Verify
PUBLIC_API_URLis set correctly - Check API health endpoint
- Review Vercel function logs
Symptoms: Dashboard shows layout but no charts
Solution:
- Check browser console for uPlot errors
- Verify API returns data:
/metrics/overview - Check network tab for failed requests
- Verify metrics data format matches chart expectations
SvelteKit + Vercel automatically optimizes images. Use:
<img src="/image.png" alt="Description" />SvelteKit automatically code-splits by route.
Use dynamic imports for heavy components:
const HeavyComponent = await import('$lib/components/Heavy.svelte');Configure in svelte.config.js:
export default {
kit: {
csp: {
mode: 'auto'
}
}
};Enable in project settings:
- Go to "Analytics" tab
- Enable Web Analytics
- View real-time metrics
Consider adding Sentry:
pnpm add @sentry/sveltekitConfigure in hooks.client.ts and hooks.server.ts.
import { apiClient } from '$lib/api/client';
// In your Svelte component
let transactions = [];
onMount(async () => {
const result = await apiClient.getTransactions({
status: 'failed',
limit: 10
});
transactions = result.items;
});- Create
src/routes/your-page/+page.svelte - Add navigation in
src/routes/+layout.svelte - Implement page logic and UI
<!-- src/lib/components/MetricCard.svelte -->
<script lang="ts">
export let title: string;
export let value: number;
export let trend: 'up' | 'down' | 'neutral' = 'neutral';
</script>
<div class="card bg-base-100 shadow-xl">
<div class="card-body">
<h2 class="card-title">{title}</h2>
<p class="text-3xl">{value}</p>
</div>
</div><button class="btn btn-primary">
Primary Button
</button>
<div class="alert alert-warning">
Warning message
</div># Development
pnpm dev # Start dev server
pnpm dev --open # Start and open browser
# Production
pnpm build # Build for production
pnpm preview # Preview production build
# Quality
pnpm lint # Run ESLint
pnpm check # Type check
pnpm format # Format code with Prettier
# Package management
pnpm add <pkg> # Add dependency
pnpm add -D <pkg> # Add dev dependency
pnpm remove <pkg> # Remove dependency
pnpm update # Update dependencies- β‘ Fast HMR (Hot Module Replacement)
- π¦ Automatic code splitting
- π¨ CSS scoped by default
- π§ Simple, minimal API
- π Server-side rendering support
- π¨ Utility-first styling
- π± Responsive by default
- π― Small production bundle (PurgeCSS)
- π§ Highly customizable
- π¨ Pre-built UI components
- π Multiple themes
- βΏ Accessible by default
- π¦ Works with Tailwind
- β‘ Extremely fast rendering
- π Time-series optimized
- π Small bundle size (~45KB)
- π― Perfect for real-time charts
- Fork the repository
- Create feature branch:
git checkout -b feature/your-feature - Make changes and test locally
- Run type checking:
pnpm check - Commit:
git commit -m "feat: your feature" - Push:
git push origin feature/your-feature - Create Pull Request
HackOn Team Vietnam
- Bernie Nguyen - Founder/Leader/Full-stack/Main developer
- Thien Vo - Front-end developer intern
- Canh Trinh - Researcher, Back-end developer intern
- Sharkyz Duong Pham - Business developer lead
- Hieu Tran - Business developer
Collaboration: Phu Nhuan Builder
Contact:
- Email: work.hackonteam@gmail.com
- Telegram: https://t.me/hackonteam
MIT License - see LICENSE file in main repository
- Main Repository: https://github.com/hackonteam/m-obs
- Backend Repository: https://github.com/hackonteam/m-obs-backend
- Frontend Repository: https://github.com/hackonteam/m-obs-frontend
- Live Demo: https://m-obs.vercel.app (your URL)
- Backend API: https://m-obs-api.onrender.com (your URL)