π 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.
πTable of Contents
πΌοΈ Preview Screenshots
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
- Clone this repository or download from MGalaCyber
- Make sure you have Node.js installed on your machine.
- Install the dependencies using your preferred package manager:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
- Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
- 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