This is the source code for maltesphotography.de written in Next.js using PostgreSQL and Tailwind.
yarn install
Create a .env
file in the root of the project by copying/renaming the .env.example
.
DATABSE_URL
If your database user can create multiple databases, you only need this, otherwise SHADOW_DATABASE_URL
is needed
SHADOW_DATABASE_URL
Another database URL. More information why this is needed in cloud-environments
Make sure to also add the following to the data source in prisma/schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
-> shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
NEXTAUTH_URL
This is the root of your application for example https://maltesphotography.de
.
NEXT_PUBLIC_URL
Used for the client side http client. Should be the same as NEXTAUTH_URL
.
NEXTAUTH_SECRET
Used to encrypt the NextAuth.js JWT and to hash email verification tokens.
GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
Github OAuth Credentials used to log into the admin interface at /admin
Note: Set the callback url to https://<NEXTAUTH_URL>/api/auth/callback
!
GITHUB_ALLOWED_USER_IDS
A comma-separated list of github user ids that can login via OAuth (Admin)
You can find yours here: https://api.github.com/users/your-github-username. It will also be printed on failed login attempts.
npx prisma migrate deploy
npm run build
npm run start
This starts the application on port 3000. This can be modified by using yarn start --port <PORT>
You need to proxy all requests to this url in your web-server / proxy.