Part 12 · Building AI products
Build or Buy a FastAPI and Next.js AI SaaS Boilerplate?
Use a requirements checklist and a first-year cost example to decide whether to build your AI SaaS foundation or start from a boilerplate.
BoilerShelf Team
November 16, 2026 · 7 min read

Short answer: Build the foundation when identity, permissions, data boundaries or billing are central to your product and a starter would need deep changes. Buy a FastAPI and Next.js AI SaaS boilerplate when it meets your must-have requirements, your team can maintain its code, and adapting it costs less than building the same foundation. BoilerShelf sells source-code kits.
This guide lists what the foundation contains, gives rough time estimates, and offers questions for judging any boilerplate, including ours. BoilerShelf sells source-code kits, so we are not neutral. That is why the cases where you should not buy are listed too.
How is an AI SaaS foundation different from a normal SaaS starter?
Many SaaS starters are built around a JavaScript backend, a login page and a subscription screen. An AI product adds needs those starters often do not cover:
- A Python backend. The libraries for models, documents and retrieval are strongest in Python, so the API is usually FastAPI with a separate Next.js frontend.
- Long-running work. Ingesting a document or running an evaluation takes minutes. That needs a job queue and workers, and a way to show progress.
- Model calls as infrastructure. Several providers, retries, timeouts, and a record of what each call cost.
- Usage as a cost. Each user action spends real money, so limits and metering are needed from the first paying customer.
- Streaming. Answers appear token by token, which affects the API, the proxy settings and the interface.
What does a FastAPI and Next.js AI SaaS boilerplate have to cover?
Estimates below are for one experienced developer building each part to a standard you would put in front of paying users, including tests and the edge cases. They are our estimates, not measurements, and your pace will differ.
| Part | What it includes | Estimate |
|---|---|---|
| Authentication | Sign-up, login, password reset, email verification, token refresh, logout everywhere | 1 to 2 weeks |
| Roles and permissions | Roles, permission checks on every route, an admin role | 3 to 5 days |
| Multi-tenancy | Organisations or workspaces, invitations, data scoped per tenant | 1 to 2 weeks |
| LLM gateway | One interface over several providers, retries, fallback, cost log | 1 week |
| Background jobs | Queue, workers, retries, progress, failure handling | 3 to 5 days |
| Billing | Checkout, plans, webhooks, failed payments, plan limits | 1 to 2 weeks |
| Usage metering | Counting usage per tenant, enforcing limits | 3 to 5 days |
| Admin area | User list, usage view, the support actions you need | 1 week |
| Frontend shell | Layout, navigation, forms, tables, loading and error states, authentication flow | 1 to 2 weeks |
| Deployment | Containers, environment configuration, migrations, health checks | 3 to 5 days |
Added up, the ranges in the table come to 42 to 70 working days if each week means five working days and every task is done one after another. That is an estimate, not a measured delivery schedule. Label each part required for launch, needed later or outside scope, and estimate your own critical path. A team that has built these parts before will be faster. A team doing it for the first time is usually slower, because the time goes on the cases found after launch: the webhook that arrives twice, the refresh request from two tabs, the job that fails halfway.
When should you build the foundation yourself?
- The foundation is your product. If your selling point is an unusual permission model or billing model, you need to own every line.
- You have strict requirements that a general kit will not meet, such as a specific compliance standard or an existing identity system.
- You already have one. A team with its own tested starter should use it.
- The goal is to learn. Building authentication once is a good education. Just do not do it on a deadline.
- The project is a throwaway prototype. A weekend demo needs none of this.
When does buying a boilerplate make sense?
- You are a small team and the foundation is delaying the part customers pay for.
- You deliver projects for clients and rebuild the same base each time.
- You can read the code. A boilerplate is a head start for people who could have built it; it is not a substitute for understanding it.
Due diligence worksheet for a boilerplate
| Requirement | Evidence to request or try | Decision |
|---|---|---|
| Authentication and access | Sign in, check protected routes, and confirm roles and tenant scope on the backend. Verify required identity integrations. | Pass only if mandatory permissions and integration needs are demonstrated. |
| Streaming and background work | Run one streamed model response through the intended host. Check cancellation, queue retries, failure recovery and a job status update. | Estimate missing adapters or infrastructure before scoring fit. |
| Billing and metering | If needed, test a signed webhook, a repeated delivery and entitlement changes. Check quota enforcement and model cost records. | Treat missing mandatory billing or budget controls as a gap with an owner and cost. |
| Deployment and maintenance | Start from a clean checkout. Run migrations, inspect dependency pins and tests, and test rollback. Read the support and update terms. | Record setup, integration, verification and maintenance effort for both paths. |
| Source and delivery terms | Confirm the exact edition, accessible source, permitted projects and any client handover terms on the current licence. | Treat incompatible usage terms as a blocker. |
Sources: FastAPI deployment concepts · Next.js self-hosting · Celery task guidance · Stripe webhook documentation
Ten questions to ask before buying any boilerplate
- Is the stack the one you would have chosen? A kit in a framework your team does not know costs more than it saves.
- Do you get the full source, and can you change everything? No compiled parts, no licence server.
- What does the licence allow? One project or many? Client work? Handing the source to a client? Read the actual text.
- What is not included? A seller who lists what is missing is easier to trust than one who lists everything.
- Can you see it before paying? Screenshots of real screens, a demo, the file structure, the documentation.
- How long does setup take, and what does it need? Accounts, API keys, services, and whether it starts with one command.
- Is it one payment or a subscription, and what happens with updates? Know what you get later, if anything.
- Are there tests, and what do they cover? Ask the seller. "No" is an acceptable answer if the price reflects it; a vague answer is not.
- How is tenant data kept separate? For anything multi-tenant, ask where the tenant filter is enforced.
- What is the refund policy? And what counts as a valid reason.
If a seller cannot answer these from the product page, ask by email. How quickly and plainly they reply tells you about the support.
How do you compare the cost of building and buying?
Use the same acceptance criteria and horizon for both options. Build cost covers implementation, validation and maintenance. Buy cost covers the purchase, code review, integration, validation and maintenance. Add recurring licence, hosting, model and storage costs when they differ. Compare delivery dates separately from labour hours. Record uncertainties and rerun the comparison when a key estimate changes.
| Illustrative input | Build | Buy |
|---|---|---|
| Implementation or adaptation | 90 hours to build | 12 hours to review + 35 hours to adapt |
| Verification | 25 hours | 25 hours |
| Maintenance in year one | 20 hours | 25 hours |
| One-time licence | $0 | $300 |
| Total at $50 per hour | $6,750 | $5,150 |
In this hypothetical first-year example, comparable runtime costs are excluded. The buy option costs $1,600 less and breaks even at 129 total labour hours under the stated assumptions. The $300 is a fictional input, not a BoilerShelf price or measured saving. If buy-side labour exceeds the break-even point, build is cheaper on these inputs. A mandatory requirement still has to pass either way.
Related guides
- AI SaaS architecture on FastAPI and Next.js: if you decide to build, how the parts fit together.
- One LLM gateway for several providers in FastAPI: one of the parts in the table above, in detail.
Frequently asked questions
How long does it take to build an AI SaaS foundation?
It depends on which parts you need and who builds them. List the parts you need for launch, estimate each one, and add them along your own critical path. The ranges in this guide are estimates, not measurements, and your pace will differ.
Is a boilerplate worth it for a prototype?
Usually not. A weekend demo needs none of the foundation. A boilerplate pays off when you are heading for paying users.
What should the licence of a boilerplate allow?
Check whether it covers one project or many, whether you can build client work on it, and whether you may hand the finished source to a client. Read the actual licence text before you buy.
Where to go next
BoilerShelf sells FastAPI and Next.js source-code kits. BoilerShelf AI SaaS Core is the foundation kit, and each product page lists what is and is not included. Browse the full store, and read the licence terms and the refund policy before you buy.
The idea in short
A new AI SaaS needs the same foundation each time: authentication and roles, tenancy, a gateway for model calls, background jobs, billing and metering, an admin area and deployment. The decision is whether your team builds that foundation or starts from code that already has it.
Patterns covered: Build versus buy · Authentication · Multi-tenancy · LLM gateway · Background jobs
- Boilerplate
- FastAPI
- Next.js
- Ai saas
- Build vs buy

