- Framework: Next.js
- Database: PlanetScale
- Deployment: Vercel
- Styling: Tailwind CSS
- Analytics: Vercel Analytics
git clone https://github.com/plasmadice/portfolio.git
cd portfolio
yarn install
yarn dev
Create a .env
file similar to .env.example
.
- Create a Planetscale and crete a database
- Go to the console page for you database and enter this query:
CREATE TABLE views (
slug VARCHAR(255) NOT NULL PRIMARY KEY,
count INT NOT NULL
);
- Grab the connect link and place it in .env file as
DATABASE_URL
Best to first reach out to the original to see if there have been significant updates.
In order for the environment variable NEXT_PUBLIC_URL
to operate correctly you need to set two extra scoped .env variables in Vercel.
Locally - Set in .env.local
Preview - NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL
Production - NEXT_PUBLIC_URL=https://www.yourdomain.com
Be sure to specify www
if vercel automatically redirects there!
The .env.production file may not be needed. It contains NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL
. If you yarn build
and yarn start
this may be needed for some things to work locally, but this may not be the case.