Modern portfolio powered by a SvelteKit 2 + Tailwind CSS 4 frontend and a Rust/Actix-Web API backed by PostgreSQL. The UI fetches live portfolio data from the API so content updates do not require rebuilding the site.
Live site: https://mahmudul.com.bd
- Stack
- Architecture
- Features
- Quick start
- Environment
- Project structure
- Scripts
- API
- Deployment
- Contact
- Frontend: SvelteKit 2, Vite, TypeScript, Tailwind CSS 4, Iconify
- Backend: Rust, Actix-Web, SQLx, Tokio, PostgreSQL
- Tooling: npm, Cargo, dotenvy, Tailwind/PostCSS
- SvelteKit app runs as an SPA (SSR/prerender disabled) built with
@sveltejs/adapter-staticand served with an SPA fallback. - All page content is requested at runtime from
GET /api/portfolioexposed by the Rust API. - API connects to PostgreSQL; on startup it auto-creates tables and seeds default data if empty.
PUBLIC_API_BASE_URLcontrols which API host the frontend calls (defaults tohttp://localhost:8089).
- Responsive, theme-toggleable UI (light/dark) with smooth scroll/animation helpers.
- Data-driven sections: Hero, Stats, Services, Professional Works, Hobby Projects, Resume, Skills, Contact.
- Single source of content in the database; seeds include sample portfolio data.
- Downloadable résumé and outbound social/contact links.
Prerequisites: Node 20+, npm, Rust (stable), Cargo, and a running PostgreSQL instance.
- Clone & enter the project
git clone https://github.com/mahbd/portfolio.git
cd portfolio- Environment
cp .env.example .env
# If you run the backend from its folder, also copy it there
cp .env backend/.envAdjust DATABASE_URL, PORT, and PUBLIC_API_BASE_URL as needed.
- Database
Create the database referenced by
DATABASE_URL(defaultpostgres://postgres:postgres@localhost:5432/portfolio). Example:
createdb portfolio- Start the backend (API)
cd backend
cargo runThe server listens on PORT (default 8089) and seeds data on first run.
- Start the frontend
npm install
npm run dev # defaults to http://localhost:5173
# or expose on your LAN
npm run dev:host| Variable | Default | Used by | Purpose |
|---|---|---|---|
PUBLIC_API_BASE_URL |
http://localhost:8089 |
frontend | Base URL for API calls |
DATABASE_URL |
postgres://postgres:postgres@localhost:5432/portfolio |
backend | PostgreSQL connection string |
PORT |
8089 |
backend | Port for the Actix server |
.
├─ src/ # SvelteKit app
│ ├─ routes/ # +page.svelte/+layout and load logic
│ └─ lib/ # Components, stores, actions, types, API client
├─ static/ # Public assets (images, resume)
├─ backend/ # Rust API service
│ ├─ src/ # actix-web handlers, models, DB bootstrap & seeding
│ └─ Cargo.toml
├─ .env.example # Shared env defaults
└─ package.json # Frontend scripts
- Frontend:
npm run dev,npm run dev:host,npm run build,npm run preview,npm run check - Backend:
cargo run(dev),cargo build --release,cargo test
GET /health→ returnsokfor liveness checks.GET /api/portfolio→ returns the full portfolio payload consumed by the SvelteKit app.
Frontend
- Build static assets:
npm run build(output inbuild/). Serve with any static host that supports SPA fallbacks. - Set
PUBLIC_API_BASE_URLto your deployed API origin at build time.
Backend
- Build:
cargo build --release - Provide
DATABASE_URLandPORTin the runtime environment. - Deploy to any container host (Fly.io, Render, Railway, etc.) and allow CORS for the frontend origin (currently permissive in code).
- Portfolio: https://mahmudul.com.bd
- Email: mahbd17@hotmail.com
- Facebook: https://facebook.com/maha48bd20thb
- LinkedIn: https://www.linkedin.com/in/mah20t/
- GitHub: https://github.com/mahbd
- Codeforces: https://codeforces.com/profile/mahbd