NextAPI - A Next.js RESTful API Starter for building SaaS Apps
Tags: nextjs, javascript, opensource, programming
Published: 2023-02-09 11:15:46

---
title: NextAPI - A Next.js RESTful API Starter for building SaaS Apps
description: In this article, we'll learn about NextAPI, a Next.js RESTful API Starter for building SaaS Apps.
slug: nextjs-api-starter-for-building-saas-apps
published: true
canonical_url: https://www.kirandev.com/nextjs-api-starter-for-building-saas-apps
tags: nextjs, javascript, opensource, programming
---

NextAPI is a Next.js RESTful API Starter designed specifically for building SaaS apps.

NextAPI is a great starting point for anyone looking to build a SaaS app with Next.js.

Look no further than NextAPI if you want to build a SaaS application with a fully functional backend in minutes.

Learn more about [NextAPI](https://github.com/devkiran/NextAPI)

With its powerful combination of Next.js, Supabase, and Prisma, it provides the perfect foundation for creating scalable and feature-rich SaaS apps.

One of the biggest advantages of using NextAPI is that it takes care of the heavy lifting for common SaaS features such as authentication, team management, invites, subscriptions, and more.

_NextAPI is currently in beta. Please report any bugs or issues you encounter on GitHub._

## Built with

- [Next.js](https://nextjs.org/)
- [Supabase](https://supabase.io/)
- [Prisma](https://www.prisma.io/)
- [TypeScript](https://www.typescriptlang.org/)
- [React Email](https://react.email/)

## Features

- Authentication
- Team Management
- Team Invites
- Subscriptions (Coming soon)

## API routes

NextAPI comes with a set of API routes that you can use within your React components.

| Method | Path                               | Description              |
| ------ | ---------------------------------- | ------------------------ |
| POST   | /api/auth/signup                   | Sign up a new user       |
| POST   | /api/auth/signin                   | Sign in an existing user |
| POST   | /api/teams                         | Create a new team        |
| GET    | /api/teams                         | Get all teams for user   |
| GET    | /api/teams/:slug                   | Get a team               |
| DELETE | /api/teams/:slug                   | Delete a team            |
| PUT    | /api/teams/:slug                   | Update a team            |
| POST   | /api/teams/:slug/invites           | Create a new invite      |
| GET    | /api/teams/:slug/invites           | Get all invites for team |
| GET    | /api/teams/:slug/invites/:inviteId | Get an invite            |
| DELETE | /api/teams/:slug/invites/:inviteId | Delete an invite         |
| GET    | /api/teams/:slug/members           | Get all members for team |
| PUT    | /api/teams/:slug/members/:memberId | Update a member          |
| DELETE | /api/teams/:slug/members/:memberId | Delete a member          |
| GET    | /api/me                            | Get current user         |
| PUT    | /api/me                            | Update current user      |
| POST   | /api/invites/:inviteId/accept      | Accept an invite         |
| POST   | /api/invites/:inviteId/decline     | Reject an invite         |

[API Documentation](https://documenter.getpostman.com/view/13376907/2s8ZDYWgZ1)

## Emails are sent for the following events

- When a new user signs up
- When a new invite is created
- When a user is added to a team
- When a user is removed from a team

## Getting started

- Fork this repository
- Clone your forked repository
- Navigate to the project directory
- Run `npm install` to install dependencies
- Run `npm run dev` to start the development server