How dansalviano/vanilla-js-spa works
This is a small vanilla-JavaScript single-page application served by Express. The browser loads the SPA shell, the client router maps URLs to views, and each view renders HTML into the app container; post-list data is held in memory and reused for detail pages. The README documents serving the app on port 3001. Source excerpts do not establish any backend data API or persistence, so none is shown.
Main entry points: index.js Client router · AbstractView.js View base · server.js Express server · Posts.js Posts list
Components 13
Static serving
- Express server
server.js - SPA shell
frontend/index.html - Static assets
frontend/static
Client routing
- Client router
frontend/static/js/index.js - View base
frontend/static/js/views/AbstractView.js
Page views
- Dashboard
frontend/static/js/views/Dashboard.js - Posts list
frontend/static/js/views/Posts.js - Post detail
frontend/static/js/views/PostView.js - Settings
frontend/static/js/views/Settings.js - 404 view
frontend/static/js/views/404.js - Snow animation
frontend/static/js/NotFound.js
Post content
- In-memory posts
frontend/static/js/views/Posts.js
Other components
- Browser user
Connections 18
- Browser user → Express server: requests app
README.md - Express server → SPA shell: serves fallback
server.js - Express server → Static assets: serves /static
server.js - Browser user → Client router: loads client
- Client router → Dashboard: selects route
frontend/static/js/index.js - Client router → Posts list: selects route
frontend/static/js/index.js - Client router → Post detail: selects route
frontend/static/js/index.js - Client router → Settings: selects route
frontend/static/js/index.js - Client router → 404 view: selects fallback
frontend/static/js/index.js - Client router → View base: renders via
frontend/static/js/index.js - Dashboard → View base: extends
frontend/static/js/views/Dashboard.js - Posts list → View base: extends
frontend/static/js/views/Posts.js - Post detail → View base: extends
frontend/static/js/views/PostView.js - Settings → View base: extends
frontend/static/js/views/Settings.js - 404 view → View base: extends
frontend/static/js/views/404.js - 404 view → Snow animation: registers script
frontend/static/js/views/404.js - Posts list → In-memory posts: renders
frontend/static/js/views/Posts.js - Post detail → In-memory posts: looks up post
frontend/static/js/views/PostView.js