A real-time stock dashboard built with SvelteKit, featuring live updates via Server-Sent Events (SSE).
src/
āāā lib/
ā āāā components/
ā ā āāā CompanyLogo.svelte # Reusable logo component with fallback
ā ā āāā Sparkline.svelte # SVG-based sparkline chart
ā ā āāā StockTable.svelte # Main data table with SSE integration
ā āāā server/
ā ā āāā stocks.ts # Mock stock data generator
ā āāā table.svelte.ts # Svelte 5 reactive table adapter
āāā routes/
ā āāā api/
ā āāā stocks-sse/ # SSE Endpoint for real-time updates
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
This project is configured with @sveltejs/adapter-vercel for seamless deployment to Vercel.
The svelte.config.js is already set up to use the Vercel adapter:
import adapter from '@sveltejs/adapter-vercel';
export default {
kit: { adapter: adapter() }
};
You can also deploy directly from your terminal using the Vercel CLI:
# Install Vercel CLI globally
npm i -g vercel
# Login to Vercel
vercel login
# Deploy to preview (development)
vercel
# Deploy to production
vercel --prod