- Nextjs if I need to do some quick demo or test something and having a frontend. (Also, I haven't tried the authentication with Nextjs, it might be as easy to use as the one Django provides).
- Astro/Vitepress for online documentation and static sites (I am testing both for small projects).
I'm reading up Elixir/Phoenix to spice things up though.
Is there any kind of database service for no setup, tuning, or maintenance?
A complete frontend+backend page at /my_path with a file at /my_path/page.tsx with ~20 lines in a single file that handles backend request, DB query, backend response, frontend html templating and client-side JS interactivity.
Internal path is app/[stateName]/page.tsx
Public route is domainName.com/(any state name)
// Prisma is ORM that handles DB req/res async function getStateInfo(stateName: string) {
const state: State | null = await prisma.state.findUnique({
where: { name: stateName },
});
return state;
}type StatePageParams = { params: { stateName: string }};
export default async function StatePage({ params }: StatePageParams) {
const stateInfo = await getStateInfo(params.stateName);
return (
<main className="container flex flex-col items-center justify-center p-2">
{stateInfo ? (
<div>
<h1 className="text-lg"> {stateInfo.name} </h1>
</div>
<InteractiveClientCard />
) : null}
</main>
);
}Nextjs + Hasura