@autom8te/create-starter-templates
v0.0.4
Published
Starter templates for creating NextJS or Express projects.
Downloads
3
Readme
create-starter-templates
Templates
Next.js
- NextUI
- yup
- FontAwesome
- Supabase
- Docker
Express.js
- Supabase
- Docker
Requirements
Before starting, ensure you have the following installed and configured:
- Node.js: Installation guide
- Yarn: Run
npm install --global yarnto install Yarn via npm. - Supabase: A Supabase project.
- Supabase CLI: See here.
Getting Started
Next.js
- Create a new Next.js app with
npx @autom8te/create-starter-templates@latest -n <project_name> --nextjs. Replaceproject_namewith your camelCase project name - Navigate to new project folder
- Run
yarn - Run
yarn dev - Go to
http://localhost:3000in browser
Express.js
- Create a new Express.js server with
npx @autom8te/create-starter-templates@latest -n <project_name> --express. Replaceproject_namewith your camelCase project name - Navigate to new project folder
- Run
yarn - Run
yarn start - Go to
http://localhost:8100in browser
You can also set the backend port with --be-port. Setting the backend port allows you to customize the ports used by all backend services, which as of now is the Express server and all local Supabase services. As of now, 10 digits of the ports will be used.
The important ones to know are
1: Supabase's API port3: Supabase's self hosted UI8: Express server
All other ports can be seen in Supabase's config.toml file generated in /supabase.
For example, npx @autom8te/create-starter-templates@latest -n <project_name> --express --be-port 7654 will set a backend base port of 765# that will be used for all backend services.
[!TIP] You can create both project types in a single command with
npx @autom8te/create-starter-templates@latest -n <project_name> --nextjs --express
Supabase Project Setup
A local Supabase is already initialized for you in the Express project! This template runs supabase init and already has some SQL migrations in there.
- Express - Run
supabase startin the project root. - Express - Edit the
.env.sharedfile'sSUPABASE_KEYwith theservice_rolekey from thesupabase start's output. - NextJs - Edit the
.env.localfile's
NEXT_PUBLIC_SUPABASE_KEYwith theanonkey from thesupabase start's output.NEXT_PUBLIC_SUPABASE_URLwith theAPI URLfrom thesupabase start's output.
Docker
In any of the projects, run docker compose up -d --build.
[!IMPORTANT] In Express.js' template, make sure to have your env vars in
.env.local. In Next.js' template, make sure to update theargsindocker-compose.yml.
