NextGate

Get start

Welcome to NextGate 🚀

We're thrilled to have you here! NextGate is your go-to solution for building fast, scalable SaaS applications on Next.js. This guide will help you get up and running in no time. Once you're set up, follow our tutorial to launch your SaaS project in just few steps!

1. Local installation

Once you have your code ready (zip file or repo access), you can install the project locally by following these steps:

npm install

Node Version

NextGate requires Node v18.18.0 or greater. Type node -v in your terminal to check version.

Node Version Manager

If your install doesn't pass and you have error like below, we recommend using a Node Version Manager (NVM) to manage your Node.js versions.

nvm install 18.18.0
nvm use 18.18.0

In codebase you can also modify the .nvmrc file to specify the Node version and then just run nvm use in the terminal.

Image

2. Create .env file

Rename the .env.example file to .env:

mv .env.example .env

3. Start the Local Server

yarn dev

Now your server is ready!

But keep calm I know setup NextGate is FAST, but you want integrate with external services like DB, Stripe, oAuth etc.

Check the project structure and important files below then go to start project page and finish the setup. 🚀

Project Structure

layouts
aceternity-UI-component.tsx
your-component.tsx
apiCall.ts
blog.ts
helpers.ts
index.ts -> db connect

Important Files

config.ts
export const appConfig = {
  // ENVIRONMENT
  NODE_ENV: process.env.NODE_ENV,
 
  // DATABASE
  DATABASE_URL: process.env.DATABASE_URL,
 
  // GOOGLE
  AUTH_GOOGLE_ID: process.env.AUTH_GOOGLE_ID,
  AUTH_GOOGLE_SECRET: process.env.AUTH_GOOGLE_SECRET,
 
  // GITHUB
  AUTH_GITHUB_ID: process.env.AUTH_GITHUB_ID,
  AUTH_GITHUB_SECRET: process.env.AUTH_GITHUB_SECRET,
 
  // EMAILS
  RESEND_FROM_EMAIL: process.env.RESEND_FROM_EMAIL,
  RESEND_API_KEY: process.env.AUTH_RESEND_KEY,
 
  // STRIPE
  STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
  STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,
  NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY:
    process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY,
 
  // APP CONFIG VARIABLES
  APP_NAME: process.env.NEXT_PUBLIC_APP_NAME ?? 'DEFAULT_APP_NAME',
 
  // ANALYTICS
  GOOGLE_ANALYTICS_ID: process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID,
  POSTHOG_API_KEY: process.env.NEXT_PUBLIC_POSTHOG_API_KEY,
  POSTHOG_HOST: process.env.NEXT_PUBLIC_POSTHOG_HOST,
 
  // your custom variables...
};
.env
NODE_ENV=test
 
NEXT_PUBLIC_BASE_URL=http://localhost:3000/
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api
 
DATABASE_URL=
 
AUTH_SECRET=
 
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=
 
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
 
AUTH_RESEND_KEY=
RESEND_FROM_EMAIL="no-replay@example.com"
 
STRIPE_SECRET_KEY=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
 
NEXT_PUBLIC_APP_NAME="AppName"
 
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=
SIMPLE_ANALYTICS=true/false

On this page