Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta 5 #131

Merged
merged 251 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
87b22d1
Merge branch 'next' into fix/refactor-redirection
jthrilly Apr 22, 2024
1d466ca
recreate pnpm lock and fix ts errors during build
jthrilly Apr 22, 2024
8e4dc1d
fix merge conflicts
jthrilly Apr 22, 2024
38dbc46
bump packages
jthrilly Apr 22, 2024
b0a8c9e
revert zod and react-hook-form version bumps
jthrilly Apr 22, 2024
5d06478
update zod and react-hooks-form and update build workflow
jthrilly Apr 23, 2024
37b49a8
update build workflow to use next cache
jthrilly Apr 23, 2024
93b0417
add missing lodash dependency
jthrilly Apr 23, 2024
fe7897b
experiment with different kinds of data fetching
jthrilly Apr 23, 2024
420d65d
experiment with server side search params in nested server component
jthrilly Apr 24, 2024
ac05f4e
implement rough signup and login flow
jthrilly Apr 25, 2024
97a4eec
fix signout - performance is now insane
jthrilly Apr 25, 2024
0736547
correctly implement setup redirection, and fix anonymous recruitment …
jthrilly Apr 25, 2024
928125b
refine by using unstsable_cache and query tags for revalidation
jthrilly Apr 25, 2024
b9d1edb
generalize optimistic switch concept
jthrilly Apr 25, 2024
24cc529
implement protocol upload via server actions
jthrilly Apr 25, 2024
05d84e3
import actions directly inside of protocol import hook
jthrilly Apr 25, 2024
13a9fc1
WIP of rendering for interviews route
jthrilly Apr 25, 2024
6ea2b64
wip interview route
jthrilly Apr 25, 2024
3f4f8a8
working interview sync
jthrilly Apr 26, 2024
f84233c
use auth function in layout and use transition pending state to disab…
jthrilly Apr 26, 2024
0d61654
linting
jthrilly Apr 29, 2024
021af06
rework setup
jthrilly Apr 29, 2024
8b23063
try noStore with participants query
jthrilly Apr 29, 2024
b9d1e32
add baseUrl to route redirection
jthrilly Apr 29, 2024
199d121
correct implementation of revalidateTag
jthrilly Apr 29, 2024
79fe843
add further missing revalidations
jthrilly Apr 29, 2024
fa92728
add missing event to participant deletion
jthrilly Apr 29, 2024
96d863f
remove API auth from addEvent
jthrilly Apr 29, 2024
ecdf140
remove flex from PageHeading to allow margin to collapse
jthrilly Apr 29, 2024
cc9292c
delete unused files
jthrilly Apr 29, 2024
d9db1bd
upgrade nextjs and react
jthrilly Apr 29, 2024
5c3e558
remove api auth requirement from queries and implement server-only im…
jthrilly Apr 30, 2024
8db2974
ensure mutations use auth protection
jthrilly Apr 30, 2024
b89a2e7
add simple loading state to signin and signout
jthrilly Apr 30, 2024
cd6867f
remove server-only and add use server to protocol queries, to allow c…
jthrilly May 2, 2024
1b837e8
update packages
jthrilly May 2, 2024
4070d12
merge with next
jthrilly May 2, 2024
5307b63
port data export fixes
jthrilly May 2, 2024
68a585b
fix FileExportManager not returning a promise
jthrilly May 2, 2024
07a260c
change build workflow to just lint
jthrilly May 2, 2024
5a88171
reorganise and clean up
jthrilly May 2, 2024
bc7573a
reenable check for analytics
jthrilly May 2, 2024
6439f22
update react-resize-aware to fix error with boolean option component
jthrilly May 2, 2024
e44df23
correct padding on textarea
jthrilly May 2, 2024
9d86020
remove unused suspense boundary and add type inference from protocol …
jthrilly May 2, 2024
13a377c
remove unused import
jthrilly May 2, 2024
d3bd90f
use addEvent in insertProtocol and dont await the return of side effects
jthrilly May 2, 2024
d1e8fd5
Merge branch 'next' into experiment/remove-trpc
jthrilly May 2, 2024
60abf4a
fix: finish interview
buckhalt May 2, 2024
0b19200
Merge branch 'experiment/remove-trpc' of https://github.com/complexda…
buckhalt May 2, 2024
dcc270f
fix: hiding banner in interview should not redirect
buckhalt May 2, 2024
25cc289
fix: no protocols in select protocol dropdown
buckhalt May 2, 2024
778a99c
push a new history iteam for each state change to allow using back bu…
buckhalt May 2, 2024
0693003
make optional param disable redirect
buckhalt May 3, 2024
c8e0429
fix: redirect to setup on reset app
buckhalt May 3, 2024
ff3b90f
fix: reimplement callbackurl for redirect to signin
buckhalt May 3, 2024
f33ae4e
refactor: logout triggers revalidation of / path, lets requirePageAut…
buckhalt May 3, 2024
5ef8fe2
fix: redirect to setup
buckhalt May 6, 2024
5d14f19
fix typo
buckhalt May 6, 2024
c8e9670
reimplement client versions of settings switches
buckhalt May 6, 2024
c622273
fix naming on new client switch components
buckhalt May 6, 2024
7daf0fd
fix: close delete participants modal after delete
buckhalt May 7, 2024
d0a58fa
port export session refactor to experimental trpc branch
jthrilly May 8, 2024
31debb6
additional linting
jthrilly May 9, 2024
cb258c8
further linting
jthrilly May 9, 2024
0687dfa
make safe local storage hook write valid initial data when current da…
jthrilly May 9, 2024
c20daca
dont destructure value/setValue in safe local storage to bypass stran…
jthrilly May 9, 2024
baa11c0
install knip, and add task to workflow
jthrilly May 9, 2024
ddd2a34
remove unused files
jthrilly May 9, 2024
0d0a758
remove duplicate exports
jthrilly May 9, 2024
5c9f829
remove unused exported types
jthrilly May 9, 2024
f02fa9a
encode interaction sounds as mp3
jthrilly May 9, 2024
fb02fae
remove enzyme tests
jthrilly May 9, 2024
fa85f24
fix unlisted dependencies
jthrilly May 9, 2024
4cc59a3
remove further unused files
jthrilly May 9, 2024
a302386
run knip --fix
jthrilly May 9, 2024
5b55b18
recreate pnpm lockfile
jthrilly May 9, 2024
85300dc
remove unused files
jthrilly May 9, 2024
4ea42c9
fix remaining knip issues
jthrilly May 9, 2024
ca93b05
fix formatting issues caused by knip
jthrilly May 9, 2024
4969422
building and linting
jthrilly May 9, 2024
90b1925
Merge pull request #130 from complexdatacollective/feature/knip
jthrilly May 9, 2024
be6025f
add missing crypto dependencies
jthrilly May 9, 2024
5f4ff65
add missing deps to knip ignore
jthrilly May 9, 2024
08efb6d
dont check for updated records in setAnonymousrecruitment
jthrilly May 9, 2024
2990770
Merge pull request #118 from complexdatacollective/experiment/remove-…
jthrilly May 13, 2024
c3bcf52
merge with next
jthrilly May 13, 2024
6471638
commit lockfile
jthrilly May 13, 2024
9749466
remove unused tests
jthrilly May 13, 2024
1f8ef71
implement vitest for testing
jthrilly May 13, 2024
c252fff
revert to lucia v2
buckhalt May 13, 2024
89c714f
add back in auth.d.ts
buckhalt May 13, 2024
9fac52c
ignore knip unused type export in auth.ts (false positive)
jthrilly May 14, 2024
3617381
merge with next
jthrilly May 14, 2024
a09cc97
revert optional chaining in network-query/query.js - was causing a te…
jthrilly May 14, 2024
ff35a1b
reinstate several tests, update imports, and add test task to build w…
jthrilly May 14, 2024
29e275d
rm node-rs packages added for lucia v3
buckhalt May 14, 2024
378a7a1
tests passing
jthrilly May 14, 2024
73f8b27
update prettier config to use different format, and reinstate other t…
jthrilly May 14, 2024
8c4302c
fix knip issues
jthrilly May 14, 2024
ee6f38c
update pnpm lock
jthrilly May 14, 2024
cd04994
remove console.log
jthrilly May 14, 2024
40f6602
Merge pull request #129 from complexdatacollective/refactor/file-export
jthrilly May 14, 2024
e8d8958
Merge branch 'main' into next
jthrilly May 14, 2024
ea55934
resolve discrepency with main
jthrilly May 14, 2024
ed15307
remove further unused exports
jthrilly May 14, 2024
d788d8d
reinstate functions without export
jthrilly May 14, 2024
256fdec
docker image building
jthrilly May 14, 2024
de138a3
reimplement ui for failed sign in
buckhalt May 14, 2024
3040f7e
working docker setup with migrations
jthrilly May 14, 2024
5712325
add vercel-build task that includes db migration step
jthrilly May 15, 2024
1e533e0
Merge branch 'next' into fix/signin-error-messaging
jthrilly May 15, 2024
10411c7
resolve linting
jthrilly May 15, 2024
763bac8
proof of concept of different approach
jthrilly May 15, 2024
25e786c
loginFormSchema for correct types in form
buckhalt May 15, 2024
2496ca5
use accepted setError name type
buckhalt May 15, 2024
c7cc633
remove console.logs
buckhalt May 15, 2024
e8a082f
fix: delete selected participants by id
buckhalt May 15, 2024
af42543
resolve review feedback
jthrilly May 16, 2024
1fbeaa4
Merge pull request #132 from complexdatacollective/fix/signin-error-m…
jthrilly May 16, 2024
df302cb
merge with next
jthrilly May 16, 2024
d797446
update dev compose file
jthrilly May 16, 2024
7b1f7da
introduce artificial DB query delay in development
jthrilly May 16, 2024
a80ae05
add sharp to ignored list in knip config
jthrilly May 16, 2024
a5c40c8
update prisma
jthrilly May 17, 2024
dfb7f73
remove require statements fro ActionButton and Button and dont show S…
jthrilly May 17, 2024
9892270
bring in changes from next
jthrilly May 17, 2024
f7a2843
revert env variable changes
jthrilly May 17, 2024
f77df01
fix env vars
jthrilly May 17, 2024
24e1923
update lockfile
jthrilly May 17, 2024
6d85f85
remove unused deps
jthrilly May 17, 2024
0d07e70
Merge branch 'next' into feature/docker
jthrilly May 17, 2024
22f0979
upgrade to pnpm 9.1.1
jthrilly May 17, 2024
3acb734
implement migration handling script
jthrilly May 20, 2024
1d76f58
remove cross-env
jthrilly May 20, 2024
388c8e0
remove history push from interview navigation
buckhalt May 20, 2024
4d101a4
fix missing files. working compose setup! 🚀
jthrilly May 20, 2024
5ded110
first pass at building docker image on GA
jthrilly May 20, 2024
88ee361
move UTAPI construction to only be in use server files so that it isn…
jthrilly May 20, 2024
b2950c4
cleanup unused line
jthrilly May 20, 2024
2304cf7
Update docker.yml
jthrilly May 20, 2024
adf6f44
update docker compose prod
jthrilly May 20, 2024
ff50983
remove labels to allow for multiple deployments
jthrilly May 21, 2024
8155361
reimplement activity feed table as client component
jthrilly May 21, 2024
7c51978
debounce updating filter params
buckhalt May 21, 2024
8fd35d8
Merge pull request #135 from complexdatacollective/fix/activity-feed-…
jthrilly May 22, 2024
5b63d2d
add back the dialog components
mrkarimoff May 22, 2024
12d574c
chore: Refactor Dialog components and export as DialogVariants
mrkarimoff May 22, 2024
938f5ab
add docker compose to dev task
jthrilly May 22, 2024
f17148f
resolve issue with react-useportal not being compatible with type:mod…
jthrilly May 22, 2024
40fc546
merge with next
jthrilly May 22, 2024
64a9a1a
update dev task to use correct compose file, and add loading spinner …
jthrilly May 22, 2024
25a08b3
fix stale data on activity feed when reseting & replace unstable_cach…
mrkarimoff May 22, 2024
3e8a21c
remove external network
jthrilly May 22, 2024
24b38ff
fix: stale protocol summary card
buckhalt May 22, 2024
76d8eae
remove network name so that network name can be created each time
jthrilly May 22, 2024
e4aa426
fix: adding event when deleting all participants
buckhalt May 22, 2024
0172b64
fix: limit interviews
buckhalt May 22, 2024
b67e440
fix: exporting interviews with 0% progress fails
buckhalt May 22, 2024
4dd8023
fix: revalidate queries when deleting objects with cascade onDelete
buckhalt May 22, 2024
13c5ae5
fix: reimplement tracking InterviewCompleted
buckhalt May 22, 2024
b8584bb
fix re-render of protocol import toasts
mrkarimoff May 23, 2024
b59425b
update with latest next
jthrilly May 23, 2024
f6d4ebf
fix: revalidate summary statistics tag after resetting app settings
mrkarimoff May 23, 2024
fe4ccc4
refactor usePortal hook to fix modal issue in interviewer
mrkarimoff May 23, 2024
dfd37fd
reimplement recruitment test section
buckhalt May 23, 2024
a5cca71
move suspense and fallback from pg to recruitment test section server…
buckhalt May 23, 2024
4f3cb66
remove: unused function
buckhalt May 23, 2024
7a6b704
fix: add activity table event for data exported
buckhalt May 23, 2024
b002a6f
add k6 load test example
jthrilly May 23, 2024
d59f765
Merge branch 'next' into feature/docker
jthrilly May 23, 2024
0a08a23
update to analytics@6.0.0 and rename NEXT_PUBILC_DISABLE_ANALYTICS ->…
jthrilly May 23, 2024
c2ebba2
fix hostname inference in analytics package
jthrilly May 23, 2024
0042585
Merge pull request #136 from complexdatacollective/fix/recruitment-te…
jthrilly May 24, 2024
ad6ec01
make node panel default to closed on first render
jthrilly May 27, 2024
cafb2bd
pin framer motion version and remove console log in node panels
jthrilly May 27, 2024
73ae2ea
update framer motion and use percentage value for node animation to w…
jthrilly May 27, 2024
2f516db
fix: activity feed table double flash behavior
mrkarimoff May 28, 2024
b6e2e0e
fix: prevent whitespace as label and identifier
buckhalt May 28, 2024
79b8c4d
fix: if no label is entered in form, data.label should be undefined
buckhalt May 28, 2024
0a765ae
move validation to schema, prevent leading and trailing whitespace on…
buckhalt May 28, 2024
023084c
wip validate identifier and label using schemas
buckhalt May 28, 2024
baa45af
refine participantLabelRequiredSchema so that it is required when ide…
buckhalt May 28, 2024
1e436ab
fix schemas for csv, ensure that empty space is not considered presen…
buckhalt May 28, 2024
5952c1d
refactor: update formatExportableSessions to use sessionParticipant i…
mrkarimoff May 29, 2024
95ffdde
fix: data export when no identifier provided
buckhalt May 29, 2024
8e1695c
fix: uniqueness validation when editing
buckhalt May 29, 2024
1b5416a
fix: empty string label should be undefined in db
buckhalt May 29, 2024
8b68f78
fix: spelling
buckhalt May 29, 2024
7309f46
small formatting fix
buckhalt May 29, 2024
6a33e9e
Revert "refactor: update formatExportableSessions to use sessionParti…
buckhalt May 29, 2024
e10b7a6
fix refetching behavior by using clearOndefault option in nuqs
mrkarimoff May 30, 2024
e6750c0
revert changes in the activity route handler
mrkarimoff May 30, 2024
d6f6ef9
Merge pull request #139 from complexdatacollective/fix/activityFeed-r…
mrkarimoff May 30, 2024
9913612
make sure caseId always exists by using optional label and falling ba…
jthrilly May 30, 2024
bbb60bf
merge with main
jthrilly May 30, 2024
8d5965e
merge with next
jthrilly May 30, 2024
40ca6b7
improve navigation in the protocols page
mrkarimoff May 30, 2024
1850bfe
improve navigation in the protocols page
mrkarimoff May 30, 2024
06260b8
fix: import csv with empty string values for identifier should create id
buckhalt May 30, 2024
bc0ec2d
improve mavigation in the interviews page
mrkarimoff May 30, 2024
b5c7548
Revert "Merge pull request #135 from complexdatacollective/fix/activi…
jthrilly May 30, 2024
be2874e
implement SettingSectionSkeleton and change PageHeaderSkeleton bg
mrkarimoff May 30, 2024
fe01251
improve navigation to the settings page
mrkarimoff May 30, 2024
2fe06cb
reimplement activity feed as an RSC
jthrilly May 30, 2024
bff451b
dont key page ActivityFeed
jthrilly May 30, 2024
8cbe514
knip
jthrilly May 30, 2024
7141e0c
refactor: improve participant schemas using utility func for whitespc…
buckhalt May 30, 2024
e451d46
Merge pull request #143 from complexdatacollective/feature/i-want-my-…
buckhalt May 30, 2024
2535978
improve UX in the dashboard page
mrkarimoff May 30, 2024
7651da4
tests: add tests to cover importing participants. adjust schemas to p…
buckhalt May 30, 2024
e1a0507
simplify schema logic by moving check to util func
buckhalt May 30, 2024
a6ec017
merge next
buckhalt May 30, 2024
ef63ad3
make all files lint, even outside of app directory
jthrilly May 30, 2024
62273da
update PageHeaderSkeleton bg color
mrkarimoff May 31, 2024
2d221ab
fix minor warnings
mrkarimoff May 31, 2024
b01041e
Merge pull request #140 from complexdatacollective/fix/blank-particip…
jthrilly May 31, 2024
88d8fde
remove unused code from lodash replacements
jthrilly May 31, 2024
395fc5d
Merge branch 'next' into fix/linting
jthrilly May 31, 2024
c4b7489
remove unused participantID schema
jthrilly May 31, 2024
dc59204
remove unused participantID schema
jthrilly May 31, 2024
b09cc45
implement basic protocol schema version check
jthrilly May 31, 2024
51400cf
update import
jthrilly May 31, 2024
fae4369
Merge branch 'next' of https://github.com/complexdatacollective/Fresc…
mrkarimoff May 31, 2024
f34764f
Merge pull request #145 from complexdatacollective/fix/linting
jthrilly May 31, 2024
60e06ec
Merge branch 'next' into feature/docker
jthrilly May 31, 2024
c059e3b
dont import getBaseUrl in client component
jthrilly May 31, 2024
ec19fb9
Merge pull request #133 from complexdatacollective/feature/docker
jthrilly May 31, 2024
c56880f
adjust DataTableSkeleton columns and filters
mrkarimoff May 31, 2024
42a4e04
refactor AnonymousRecruitmentWarning section to use RSC
mrkarimoff May 31, 2024
d3bf9b8
make the header color the darker version of background
mrkarimoff May 31, 2024
edebdea
remove background-daker
jthrilly May 31, 2024
3201bf0
adjust table skeleton parameters
jthrilly May 31, 2024
2f5a9d2
adjust interviews table skeleton
jthrilly May 31, 2024
c7fc89f
adjust table parameters in suspense with loading.tsx
mrkarimoff May 31, 2024
5cae0bc
Merge pull request #144 from complexdatacollective/refactor/improve-p…
mrkarimoff May 31, 2024
0d2c39f
update uploadthing deps
buckhalt May 31, 2024
d2a88cf
Merge pull request #146 from complexdatacollective/update/uploadthing
jthrilly Jun 3, 2024
39da21c
update analytics to beta.5 to attempt to deal with window.location.or…
jthrilly Jun 3, 2024
3317560
update getBaseUrl to default to window.location.origin if available
jthrilly Jun 3, 2024
dca060c
handle window not defined in recruitment url button
jthrilly Jun 3, 2024
3e01dcd
bump version
jthrilly Jun 3, 2024
0900974
remove loading state for the AnonymousRecruitmentWarning component
mrkarimoff Jun 3, 2024
98ede78
fix stale data on the dashboard pages after resetting the app
mrkarimoff Jun 3, 2024
2289373
remove getBaseUrl from onboard route handler
buckhalt Jun 3, 2024
f99d760
Revert "remove getBaseUrl from onboard route handler"
buckhalt Jun 3, 2024
57b1b02
fix `syncInterview` issue
mrkarimoff Jun 3, 2024
b188afa
fix: onboard redirect base url
buckhalt Jun 3, 2024
49e5684
use dynamic key for revalidation in interview sync
buckhalt Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 22 additions & 39 deletions .env.example
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
9 changes: 4 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');

/** @type {import("eslint").Linter.Config} */
Expand All @@ -19,15 +18,15 @@ const config = {
parserOptions: {
project: path.join(__dirname, 'tsconfig.json'),
},
plugins: ['@typescript-eslint', 'eslint-plugin-local-rules'],
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:@typescript-eslint/recommended',
'next/core-web-vitals',
'prettier',
],
ignorePatterns: ['node_modules', '*.stories.*', '*.test.*'],
ignorePatterns: ['node_modules', '*.stories.*', '*.test.*', 'public', '.eslintrc.cjs',],
rules: {
"@next/next/no-img-element": "off",
"import/no-anonymous-default-export": "off",
Expand All @@ -42,7 +41,7 @@ const config = {
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
'error',
{
argsIgnorePattern: '^_',
},
Expand All @@ -54,7 +53,7 @@ const config = {
}
],
'no-unreachable': 'error',
'local-rules/require-data-mapper': 'error',
},
};

module.exports = config;
38 changes: 20 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Lint

on:
pull_request:
Expand All @@ -13,30 +13,26 @@ jobs:
SKIP_ENV_VALIDATION: true

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- name: Enable Corepack
run: corepack enable

- name: Use Node 20.x
uses: actions/setup-node@v4
with:
version: 8
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup next cache
with:
path: |
Expand All @@ -49,4 +45,10 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-

- name: Run build
run: pnpm next build
run: pnpm lint

- name: Run tests
run: pnpm test

- name: Run knip
run: pnpm knip
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"printWidth": 80,
"quoteProps": "consistent",
"singleQuote": true
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"typescript.enablePromptUseWorkspaceTsdk": true,
"WillLuke.nextjs.addTypesOnSave": true,
"WillLuke.nextjs.hasPrompted": true,
"jest.jestCommandLine": "pnpm run test"
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
}
42 changes: 23 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
FROM node:18-alpine AS base
RUN corepack enable
ENV SKIP_ENV_VALIDATION=true
FROM node:lts-alpine AS base

# Install dependencies only when needed
FROM base AS deps

# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
#RUN apk add --no-cache libc6-compat
WORKDIR /app

# Prisma stuff
COPY prisma ./prisma
# Install dependencies
COPY package.json pnpm-lock.yaml* ./
COPY postinstall.mjs ./postinstall.mjs
RUN pnpm install
RUN pnpm prisma generate

# Copy package.json and lockfile, along with postinstall script
COPY package.json pnpm-lock.yaml* postinstall.js migrate-and-start.sh handle-migrations.js ./

# # Install pnpm and install dependencies
RUN corepack enable pnpm && pnpm i --frozen-lockfile

# ---------

# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Install git - this is needed to get the app version during build
RUN apk add --no-cache git

ENV NEXT_TELEMETRY_DISABLED 1

# Install git
RUN apk update && apk add --no-cache git

RUN pnpm run build
ENV SKIP_ENV_VALIDATION=true
RUN corepack enable pnpm && pnpm run build

# If using npm comment out above and use below instead
# RUN npm run build
Expand All @@ -39,7 +38,8 @@ FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.

# disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
Expand All @@ -55,13 +55,17 @@ RUN chown nextjs:nodejs .next
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/handle-migrations.js ./
COPY --from=builder --chown=nextjs:nodejs /app/migrate-and-start.sh ./
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma

USER nextjs

EXPOSE 3000

ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

CMD ["node", "server.js"]
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
# CMD HOSTNAME="0.0.0.0" npm run start:prod
CMD ["sh", "migrate-and-start.sh"]
25 changes: 25 additions & 0 deletions actions/activityFeed.ts
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' };
}
}
51 changes: 51 additions & 0 deletions actions/appSettings.ts
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');
};
Loading