nextjs-api-starter-kit Tailwind Templates

Nextjs Api Starter Kit

Next.js + Tailwind CSS + Swagger Boilerplate

πŸš€ NEXTJS API Starter Kit

A powerful starter kit built with Next.js, Tailwind CSS, and Swagger UI β€” perfect for building modern REST API platforms with user authentication, dashboards, freemium upgrade pages, and built-in API documentation playground.

website SociaBuzz

πŸ“šTable of Contents


πŸ–ΌοΈ Preview Screenshots

Landing Page Dashboard

Status Swagger Playground


✨ Features

  • 🌐 Beautiful landing page (Tailwind CSS)
  • πŸ” Login & registration system
  • πŸ“Š User dashboard with access control
  • πŸ’Ž Upgrade page for free/premium plans
  • πŸ§ͺ API Playground using Swagger UI inside the dashboard
  • βš™οΈ RESTful API routes with OpenAPI documentation
  • πŸ”‘ API Key system with rate limiting
  • πŸ“ Clean and modular project structure

πŸ†š Free vs Premium Comparison

FEATURES FREE PREMIUM
Swagger UI βœ… βœ…
Landing Page βœ… βœ…
Dashboard Page βœ… βœ…
Upgrade Plan Page βœ… βœ…
Login & Register Page ❌ βœ…
Rate Limit ❌ βœ…
ApiKey Access ❌ βœ…
Account Management ❌ βœ…
Priority Support ❌ βœ…
Access to Exclusive Features ❌ βœ…
Get the Latest Updates ❌ βœ…

πŸ”‘ API Key System

This project includes a built-in API key system for managing access to protected endpoints.

How it works:

  • Every registered user is assigned a unique API key.
  • API keys must be passed in the x-api-key header.
  • Different rate limits can be set for free vs. premium users.
  • Invalid or missing API keys will result in a 401 Unauthorized error.

🧱 Tech Stack

  • Next.js
  • Tailwind CSS
  • Swagger UI (OpenAPI 3.x)
  • TypeScript / JavaScript
  • Axios / Fetch
  • MongoDB, JWT, NextAuth

πŸ›  Quick start

  1. Clone this repository or download from MGalaCyber
  2. Make sure you have Node.js installed on your machine.
  3. Install the dependencies using your preferred package manager:
    npm install
    # or
    yarn install
    # or
    pnpm install
    # or
    bun install
    
  4. Start the development server:
    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
    # or
    bun dev
    
  5. Open http://localhost:3000 in your browser to view the app.

Example request with API key:

GET /api/v1/endpoint
Host: yourdomain.com
X-Api-Key: your-api-key-goes-here

File Structure

.
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ preview
β”‚   β”‚   β”œβ”€β”€ dashboard.png
β”‚   β”‚   β”œβ”€β”€ landing.png
β”‚   β”‚   β”œβ”€β”€ playground.png
β”‚   β”‚   └── status.png
β”‚   β”œβ”€β”€ file.svg
β”‚   β”œβ”€β”€ globe.svg
β”‚   β”œβ”€β”€ next.svg
β”‚   β”œβ”€β”€ vercel.svg
β”‚   └── window.svg
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ app
β”‚   β”‚   β”œβ”€β”€ actions
β”‚   β”‚   β”‚   └── github.ts
β”‚   β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ stats
β”‚   β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”‚   └── user
β”‚   β”‚   β”‚   β”‚       └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ test
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   └── v1
β”‚   β”‚   β”‚       └── users
β”‚   β”‚   β”‚           └── route.ts
β”‚   β”‚   β”œβ”€β”€ dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ playground
β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ endpoints
β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”œβ”€β”€ login
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ status
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”‚   β”œβ”€β”€ globals.css
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   └── page.tsx
β”‚   β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ kokonutui
β”‚   β”‚   β”‚   β”œβ”€β”€ stats
β”‚   β”‚   β”‚   β”‚   └── global.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ content.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ project-list.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ settings.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sidebar.tsx
β”‚   β”‚   β”‚   └── top-nav.tsx
β”‚   β”‚   β”œβ”€β”€ ui
β”‚   β”‚   β”‚   β”œβ”€β”€ alert-dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dropdown-menu.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ label.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ progress.tsx
β”‚   β”‚   β”‚   └── tabs.tsx
β”‚   β”‚   β”œβ”€β”€ background.tsx
β”‚   β”‚   β”œβ”€β”€ footer.tsx
β”‚   β”‚   β”œβ”€β”€ preloader.tsx
β”‚   β”‚   β”œβ”€β”€ theme-provider.tsx
β”‚   β”‚   β”œβ”€β”€ theme-toggle.tsx
β”‚   β”‚   └── type-writer.tsx
β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ site.ts
β”‚   β”‚   β”œβ”€β”€ swagger.ts
β”‚   β”‚   └── swaggerCompiler.ts
β”‚   β”œβ”€β”€ hooks
β”‚   β”‚   β”œβ”€β”€ useCountUp.ts
β”‚   β”‚   └── useTextScramble.ts
β”‚   β”œβ”€β”€ lib
β”‚   β”‚   β”œβ”€β”€ responseHandlers.ts
β”‚   β”‚   └── utils.ts
β”‚   β”œβ”€β”€ sections
β”‚   β”œβ”€β”€ types
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   └── swagger.ts
β”‚   └── middleware.ts
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ components.json
β”œβ”€β”€ eslint.config.mjs
β”œβ”€β”€ LICENSE
β”œβ”€β”€ next-env.d.ts
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ package.json
β”œβ”€β”€ pnpm-lock.yaml
β”œβ”€β”€ postcss.config.mjs
β”œβ”€β”€ README.md
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json

Top categories

Loading Svelte Themes