Vite SPAs
Vite SPAs on monolayer
This section describes the integration of Vite Single-Page Applications (SPAs) on monolayer, including supported platform capabilities, static hosting, and deployment configurations.
Introduction to Vite SPAs on monolayer
Vite is a modern, ultra-fast frontend build tool used to build static, client-side Single-Page Applications (SPAs). monolayer provides zero-configuration, native support for deploying static Vite SPAs directly to a global Content Delivery Network (CDN).
When you deploy a Vite SPA, monolayer automatically builds your static assets and configures the runtime environment to serve your application efficiently.
Vite Platform Capabilities
Because Vite SPAs compile into static assets that run entirely inside your users' browsers, they do not have a server-side runtime. Consequently, Vite applications do not support native server-side monolayer capabilities directly.
Global Static Hosting
monolayer deploys your compiled Vite assets directly to Amazon CloudFront.
- Edge distribution. Your static HTML, JavaScript, and CSS files are distributed close to your users, reducing load times.
- TLS termination. Connections are secured automatically with Transport Layer Security (TLS) certificates at the edge.
- Edge caching. Static assets are cached at edge locations to minimize latency.
External API Integration
To enable database access, background tasks, or other server-side capabilities, you should pair your Vite frontend with external Application Programming Interfaces (APIs).
- Backend pairing. You can deploy a separate FastAPI service or Next.js backend on monolayer to handle server-side processing.
- API calls. Your client-side Vite application can perform HTTP requests to your backend endpoints to retrieve and modify data.
Capabilities Roadmap
Support for the remaining monolayer platform capabilities is actively being developed. The following services will be available soon:
- Asynchronous background tasks. Support for offloading background tasks and queuing work asynchronously is coming soon.
- Real-time communications. Native real-time WebSocket support is coming soon.
- Scheduled cron jobs. Running scheduled tasks using cron syntax is coming soon.
- Object storage with buckets. Secure object storage backed by Amazon Simple Storage Service (Amazon S3) is coming soon.