-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from complexdatacollective/next
Beta 5
- Loading branch information
Showing
614 changed files
with
13,680 additions
and
31,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,22 @@ | ||
# Since the ".env" file is gitignored, you can use the ".env.example" file to | ||
# build a new ".env" file when you clone the repo. Keep this file up-to-date | ||
# when you add new variables to `.env`. | ||
|
||
# This file will be committed to version control, so make sure not to have any | ||
# secrets in it. If you are cloning this repo, create a copy of this file named | ||
# ".env" and populate it with your secrets. | ||
|
||
# When adding additional environment variables, the schema in "/src/env.mjs" | ||
# should be updated accordingly. | ||
|
||
# Vercel Postgres | ||
POSTGRES_URL="************" | ||
POSTGRES_PRISMA_URL="************" | ||
POSTGRES_URL_NO_SSL="************" | ||
POSTGRES_URL_NON_POOLING="************" | ||
POSTGRES_USER="************" | ||
POSTGRES_HOST="************" | ||
POSTGRES_PASSWORD="************" | ||
POSTGRES_DATABASE="************" | ||
|
||
NEXT_PUBLIC_URL="http://localhost:3000" | ||
|
||
|
||
# Uploadthing | ||
UPLOADTHING_SECRET="" | ||
UPLOADTHING_APP_ID="" | ||
|
||
|
||
# optional global override for analytics | ||
# can be used to diable analytics in development | ||
#NEXT_PUBLIC_DISABLE_ANALYTICS=true | ||
|
||
# optional manual specification for installation ID. Useful in scenarios such as | ||
# CI/CD where the installation ID cannot be automatically determined because | ||
# there is no database. Also useful for ensuring consistent ID between DB | ||
# resets. | ||
#INSTALLATION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
|
||
# ------------------- | ||
# Optional environment variables - uncomment to use | ||
# ------------------- | ||
|
||
#SANDBOX_MODE=false # true or false - if true, the app will use the sandbox mode, which disables resetting the database and other features | ||
#PUBLIC_URL="http://yourdomain.com" # When using advanced deployment, this is required. Set to the domain name of your app | ||
#DISABLE_ANALYTICS=true # true or false - if true, the app will not send anonymous analytics data to the server | ||
#INSTALLATION_ID="your-app-name" # A unique identifier for your app, used for analytics. Generated automatically if not set. | ||
|
||
# ------------------- | ||
# Required environment variables | ||
# ------------------- | ||
|
||
UPLOADTHING_SECRET=sk_live_xxxxxx # Your UploadThing secret key | ||
UPLOADTHING_APP_ID=xxxxxxx # Your UploadThing app ID | ||
|
||
POSTGRES_USER="postgres" # Your PostgreSQL username | ||
POSTGRES_PASSWORD="postgres" # Your PostgreSQL password | ||
POSTGRES_DATABASE="postgres" # Your PostgreSQL database name | ||
POSTGRES_HOST="postgres" # Your PostgreSQL host | ||
POSTGRES_PRISMA_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DATABASE}?schema=public" # A pooled connection URL for Prisma. | ||
POSTGRES_URL_NON_POOLING="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DATABASE}?schema=public" # A non-pooling connection URL for Prisma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss"], | ||
"printWidth": 80, | ||
"quoteProps": "consistent", | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use sever'; | ||
|
||
import { revalidateTag } from 'next/cache'; | ||
import type { Activity, ActivityType } from '~/lib/data-table/types'; | ||
import { prisma } from '~/utils/db'; | ||
|
||
export async function addEvent( | ||
type: ActivityType, | ||
message: Activity['message'], | ||
) { | ||
try { | ||
await prisma.events.create({ | ||
data: { | ||
type, | ||
message, | ||
}, | ||
}); | ||
|
||
revalidateTag('activityFeed'); | ||
|
||
return { success: true, error: null }; | ||
} catch (error) { | ||
return { success: false, error: 'Failed to add event' }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use server'; | ||
|
||
import { revalidateTag } from 'next/cache'; | ||
import { redirect } from 'next/navigation'; | ||
import { requireApiAuth } from '~/utils/auth'; | ||
import { prisma } from '~/utils/db'; | ||
|
||
export async function setAnonymousRecruitment(input: boolean) { | ||
await requireApiAuth(); | ||
|
||
await prisma.appSettings.updateMany({ | ||
data: { | ||
allowAnonymousRecruitment: input, | ||
}, | ||
}); | ||
|
||
revalidateTag('allowAnonymousRecruitment'); | ||
|
||
return input; | ||
} | ||
|
||
export async function setLimitInterviews(input: boolean) { | ||
await requireApiAuth(); | ||
await prisma.appSettings.updateMany({ | ||
data: { | ||
limitInterviews: input, | ||
}, | ||
}); | ||
|
||
revalidateTag('limitInterviews'); | ||
|
||
return input; | ||
} | ||
|
||
export const setAppConfigured = async () => { | ||
await requireApiAuth(); | ||
|
||
try { | ||
await prisma.appSettings.updateMany({ | ||
data: { | ||
configured: true, | ||
}, | ||
}); | ||
|
||
revalidateTag('appSettings'); | ||
} catch (error) { | ||
return { error: 'Failed to update appSettings', appSettings: null }; | ||
} | ||
|
||
redirect('/dashboard'); | ||
}; |
Oops, something went wrong.