This is a starter template using the following stack:
- Framework - Next.js (App Router)
- Language - TypeScript
- Auth - Auth.js
- Database - Postgres
- Deployment - Vercel
- Styling - Tailwind CSS
- Components - Shadcn UI
- Analytics - Vercel Analytics
- Formatting - Prettier
This template uses the new Next.js App Router. This includes support for enhanced layouts, colocation of components, tests, and styles, component-level data fetching, and more.
During the deployment, Vercel will prompt you to create a new Postgres database. This will add the necessary environment variables to your project.
Inside the Vercel Postgres dashboard, create a table based on the schema defined in this repository.
CREATE TYPE status AS ENUM ('active', 'inactive', 'archived');
CREATE TABLE products (
id SERIAL PRIMARY KEY,
image_url TEXT NOT NULL,
name TEXT NOT NULL,
status status NOT NULL,
price NUMERIC(10, 2) NOT NULL,
stock INTEGER NOT NULL,
available_at TIMESTAMP NOT NULL
);
Then, uncomment app/api/seed.ts and hit http://localhost:3000/api/seed to seed the database with products.
Next, copy the .env.example file to .env and update the values. Follow the instructions in the .env.example file to set up your GitHub OAuth application.
npm i -g vercel
vercel link
vercel env pullFinally, run the following commands to start the development server:
pnpm install
pnpm dev
You should now be able to access the application at http://localhost:3000.
This project uses act to run GitHub Actions locally in Docker containers, providing an identical environment to GitHub's runners.
-
Install act:
# macOS brew install act # Or install manually curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
-
Ensure Docker is running:
docker info
If Docker isn't running, start Docker Desktop.
The project includes pre-configured files:
.actrc- Docker image configuration for Ubuntu runners.secrets- Environment variables for local testing (GitHub secrets)
List available workflows:
act --listRun the PR tests workflow (recommended):
act pull_request --container-architecture linux/amd64 --job build-testRun with dry-run to see what would execute:
act pull_request --container-architecture linux/amd64 --job build-test --dryrunRun specific workflow events:
# Simulate pull request
act pull_request
# Simulate push to main
act pushThe local GitHub Actions workflow runs:
- PostgreSQL Service - Spins up a containerized Postgres database
- Code Checkout - Uses your local repository
- pnpm Installation - Installs dependencies with caching
- Node.js Setup - Configures Node.js 20 with package manager caching
- Environment Setup - Creates test environment with database connection
- Linting - Runs ESLint checks
- Testing - Executes all Jest tests (98 tests across 9 suites)
- Building - Creates optimized production build
- 🔄 Identical Environment - Same containers and steps as GitHub Actions
- 🚀 Fast Feedback - Test changes before pushing to GitHub
- 🔒 Isolated Database - Uses containerized PostgreSQL instead of production
- 💰 Cost Effective - No GitHub Actions minutes consumed for testing
- 🐛 Debug Locally - Easier to troubleshoot CI issues
Docker socket issues on macOS:
# Ensure Docker Desktop is running
open -a Docker
# Check Docker status
docker infoPermission issues:
# Make sure your user is in the docker group
sudo usermod -aG docker $USERCache issues:
# Clear act cache if needed
act --rm