NexusForge is a cutting-edge boilerplate for Next.js 14, featuring shadcn/ui, Stripe integration, Lucia authentication, Prisma ORM, PostgreSQL, S3 compatibility, Tailwind CSS, and the full T3 stack with tRPC.
Ensure you have the following installed:
- Node.js (v18 or later)
- pnpm
- PostgreSQL
- Git
-
Clone the repository:
git clone https://github.com/your-username/nexusforge.git cd nexusforge
-
Install dependencies:
pnpm install
-
Rename
.env.example
to.env
:cp .env.example .env
-
Open
.env
and update all the variables with your actual values. -
The
env.js
file in the root directory ensures type safety for your environment variables. If you add new environment variables, make sure to update both.env
andenv.js
.
-
Start the development server:
pnpm dev
-
Open
http://localhost:3000
in your browser. -
The tRPC API routes are located in
/server/api/routers
. Add new routers here and import them in/server/api/root.ts
. -
The Prisma schema is located at
prisma/schema.prisma
. After making changes to the schema, run:pnpm db:push
-
To seed the database:
pnpm db:seed
-
Install Playwright browsers:
pnpm playwright install
-
Run Playwright tests:
pnpm test:e2e
-
To open Playwright UI for debugging:
pnpm test:e2e:ui
-
Playwright test files are located in the
e2e
directory. Add new tests there.
-
Build the application:
pnpm build
-
Start the production server:
pnpm start
-
For database migrations in production:
pnpm db:migrate:deploy
-
Ensure all environment variables are properly set in your production environment.
-
Set up a reverse proxy (e.g., Nginx) and SSL certificates for secure HTTPS connections.
-
Configure your Stripe webhook endpoint in the Stripe dashboard to point to your production URL.
- If you encounter TypeScript errors related to environment variables, ensure that both
.env
andenv.js
are properly configured. - For database connection issues, check your
DATABASE_URL
in the.env
file and ensure your PostgreSQL server is running. - If Playwright tests fail, make sure you have the latest browsers installed and your application is running on the expected port.
For more detailed information, refer to the documentation of individual packages used in NexusForge.