Modern CMS Built with Next.js 15
A fully typed CMS with authentication, API utilities and beautiful orange-themed UI.
A fully typed CMS with authentication, API utilities and beautiful orange-themed UI.
Everything you need in a modern CMS
Built with TypeScript, Next.js 15 and ShadCN UI components
TypeScript First
Fully typed API utilities and components for maximum developer experience.
Authentication
NextAuth.js integration with JWT and session cookie support.
API Utilities
Generic apiRequest<T> helper for all your API calls.
Typed API Requests
import { getSession } from "next-auth/react";
interface ApiRequestOptions {
endpoint: string;
method?: "GET" | "POST" | "PUT" | "DELETE";
body?: unknown;
headers?: Record<string, string>;
}
export async function apiRequest<T>(
options: ApiRequestOptions
): Promise<T> {
const session = await getSession();
const headers = {
"Content-Type": "application/json",
...options.headers,
};
if (session?.accessToken) {
headers["Authorization"] = `Bearer ${session.accessToken}`;
}
const response = await fetch(`/api${options.endpoint}`, {
method: options.method || "GET",
headers,
body: options.body ? JSON.stringify(options.body) : undefined,
credentials: "include",
});
if (!response.ok) {
throw new Error(`API request failed: ${response.statusText}`);
}
return response.json() as Promise<T>;
}
// Example usage:
const posts = await apiRequest<Post[]>({
endpoint: "/posts",
method: "GET"
});