Simple Monolith is a lightweight alternative to Next.js that performs server-side rendering (SSR) only for bots and serves a static site to real users.
This architecture ensures:
- Blazing Fast Performance: Real users get a static SPA served directly from CDNs/disk.
- Perfect SEO: Bots (Google, Bing, Twitter, etc.) get fully rendered HTML via Puppeteer.
- Clean Separation: Dedicated packages for API, Frontend, and SSR.
- npx create-simple-monolith-app
- cd
- npm install
To start all services (API, Frontend Dev Server, SSR Server):
npm run devThis will start:
- API: http://localhost:3001
- Frontend (Vite Dev): http://localhost:3000
- SSR Server (Entry Point): http://localhost:8080
You can also run specific parts of the stack:
npm run apis: Runs only the API service.npm run frontend: Runs only the frontend (standard React dev server).npm run ssr: Runs the frontend and the SSR server together.Note: You must run
npm run buildfirst so that the SSR server has static assets to serve to users.npm run console: Runs the SSR Console (http://localhost:3002).
👉 You should access the app via http://localhost:8080
The ssr package includes a special Console app for debugging.
- Visit Console: Go to http://localhost:3002.
- Test a Path: Enter
/or any other path to see the rendered HTML. - Simulate Bot via curl:
curl -A "Googlebot" http://localhost:8080/
When deploying simple-monolith, you typically need to host two separate services:
- APIs: Run the
npm run apisscript (or deploy thepackages/apisfolder). - Frontend + SSR: Run the
npm run ssrscript. This handles both the bot detection/SSR server and serves the static frontend assets to users.Important: Ensure you run
npm run buildbefore starting the SSR service in production.
Note: The frontend script is primarily for development or if you only want to serve the static site without SSR/bot detection (e.g., on Netlify/Vercel static hosting), but you would lose the SEO benefits of this framework.
npm run buildThis triggers turbo run build, which builds the React app into packages/frontend/dist.
To scaffold a new project based on this template, you can run:
npx create-simple-monolith-app <project-name>(Note: Since this is a specialized repo, simply cloning this structure works effectively as a starting point).