Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
168b5c2
Add basic webcam views
Mar 18, 2024
1cf383a
Only send "you joined this channel" when the user actually joined the…
Mar 18, 2024
2fe553d
Wow I made a lot of changes
May 29, 2024
29718e6
Add some permissions instead of requiring SuperUser
Jun 15, 2024
daa5140
Merge branch 'main' of https://github.com/ystv/experimental-hypotheti…
Jun 15, 2024
d2c3d7c
Do some testing with go2rtc
Jun 22, 2024
ab2cb89
Add basic webcam functionality
Jul 7, 2024
9975bb9
Add home page and news feed
markspolakovs Aug 19, 2024
6d80342
Merge branch 'main' of https://github.com/ystv/experimental-hypotheti…
archessmn Aug 20, 2024
2115e0b
Merge remote-tracking branch 'origin/main' into slack-fixes
archessmn Aug 31, 2024
6264f79
Handle slack error in a better way
archessmn Aug 31, 2024
72bc515
Update signUpSheetActions.ts to remove debug code and simplify explan…
archessmn Sep 1, 2024
4cb9d9a
Merge branch 'main' of https://github.com/ystv/internal-site into use…
archessmn Sep 2, 2024
10abfaf
Add Role creation, editing and deleting, tidy up other pages
archessmn Sep 3, 2024
a7c9d18
Fix required permissions
archessmn Sep 3, 2024
d60b834
Update page.tsx
archessmn Sep 3, 2024
04022a0
Rename /user/[id] page to /user/me and remove dead code
archessmn Sep 3, 2024
8aeaa24
Rename getSearchParams to rawSearchParams
archessmn Sep 3, 2024
136abdb
Better feedback on give user role fail
archessmn Sep 3, 2024
511c8bf
Add documentation
archessmn Sep 3, 2024
91f9314
Rename admin permissions and remove unused ones
archessmn Sep 3, 2024
f6c3510
Remove old permissions and multi-user references
archessmn Sep 4, 2024
7fd5da4
Merge branch 'main' into user-management
archessmn Sep 4, 2024
b82ef7f
Switch admin page data fetching to tanstack query
archessmn Sep 5, 2024
580dc25
Merge branch 'mp/homepage' into kory/navigation
Keeeeeeeen Sep 5, 2024
ae430f6
Moves footer into nav to fix main body size issues
Keeeeeeeen Sep 5, 2024
4efd013
Remove unused contexts
archessmn Sep 5, 2024
e73df03
Youtube caching and some light styling changes
Keeeeeeeen Sep 6, 2024
87a77fc
nav go brr
Keeeeeeeen Sep 6, 2024
55e4eb3
I should go to bed maybe
Keeeeeeeen Sep 7, 2024
4af0be2
Fix invalid URL is env.ts
archessmn Sep 8, 2024
d22a539
Add Nix flake for development
archessmn Sep 9, 2024
b74d877
Create certificates folder on SSL generation
archessmn Sep 9, 2024
d5bdcdb
Re-enable sourcemap uploading to Sentry in builds (#148)
markspolakovs Sep 10, 2024
8f78304
Pass in Sentry auth token as Docker secret rather than build arg (#149)
markspolakovs Sep 10, 2024
1527223
Merge pull request #147 from ystv/mia/mkcert-install-fix
archessmn Sep 10, 2024
0845b4b
Merge pull request #145 from ystv/mia/env-fix
archessmn Sep 10, 2024
bae5e52
Enable Prisma tracing in Sentry (#151)
markspolakovs Sep 11, 2024
f8d23d2
Wrap all server actions in Sentry.withServerActionInstrumentation (#150)
markspolakovs Sep 12, 2024
8dd2058
Cache getUser and resolvePermissionsForUser (#152)
markspolakovs Sep 12, 2024
2451d5f
#CheckWithTech: Error handling and correct perms check (#153)
markspolakovs Sep 12, 2024
078eab8
[INT-194] Only open slack socket on the persistent server (#154)
archessmn Sep 12, 2024
5739377
Remove PR deployments when merged to main
archessmn Sep 14, 2024
c9d070e
Fix regex in preview removal
archessmn Sep 14, 2024
ed7f0b4
Use library cleanup function
archessmn Sep 15, 2024
3be818e
Merge pull request #146 from ystv/mia/nix-flake
archessmn Sep 15, 2024
8ca9503
Merge branch 'main' into user-management
archessmn Sep 15, 2024
f4c9dfb
Remove Prisma instrumentation in edge runtime (#157)
markspolakovs Sep 15, 2024
5f6f18d
Replace calls to getCurrentUser in page components with mustGetCurren…
markspolakovs Sep 15, 2024
4b32838
Replace slackApiConnection import with one that'll work after build.
archessmn Sep 16, 2024
7afb0de
Merge pull request #158 from ystv/mia/slack-module-error-fix
archessmn Sep 16, 2024
afe6031
Fix some of the errors and warnings in the build process
archessmn Sep 17, 2024
e129b5d
Merge pull request #159 from ystv/mia/build-error-fixes
archessmn Sep 17, 2024
7557612
Merge branch 'main' into slack-fixes
archessmn Sep 17, 2024
3eb3fe7
Optimise clash checking by querying at the sheet level
markspolakovs Sep 17, 2024
3adccdb
Stop clash modal refetching on mount
archessmn Sep 18, 2024
48cae86
Invalidate clashes when sheets are updated
archessmn Sep 18, 2024
63975ff
Merge pull request #107 from ystv/slack-fixes
archessmn Sep 18, 2024
6c10fe2
Correct permissions in layouts for admin pages
archessmn Sep 18, 2024
15b28c2
Merge branch 'main' into user-management
archessmn Sep 18, 2024
8576930
Update app/(authenticated)/admin/users/UserView.tsx
archessmn Sep 19, 2024
d4dc939
Update app/(authenticated)/admin/roles/RoleCard.tsx
archessmn Sep 19, 2024
73ff3ff
Update app/(authenticated)/admin/roles/RoleView.tsx
archessmn Sep 19, 2024
40edf31
Add alert on public events to distinguish them (#161)
markspolakovs Sep 20, 2024
7a1b2bc
Merge branch 'main' into remove-dead-previews
archessmn Sep 22, 2024
6f7e396
Merge pull request #155 from ystv/remove-dead-previews
archessmn Sep 22, 2024
de2733d
Merge pull request #160 from ystv/mp/optimise-clash-check-cache
archessmn Sep 23, 2024
8ec2677
Remove unused use server declarations
archessmn Sep 23, 2024
fb244de
Error logging and permissions handling
archessmn Sep 23, 2024
fd9e99a
Fix build errors
archessmn Sep 23, 2024
00f4462
Merge branch 'main' into int-165-webcams
archessmn Oct 1, 2024
fdfef78
Update index.ts to only load slackApp if slack is enabled
archessmn Oct 1, 2024
a17b617
Merge pull request #137 from ystv/user-management
archessmn Oct 1, 2024
b518d6b
Merge pull request #162 from ystv/mia/server-slack-fix
archessmn Oct 1, 2024
8c68df9
Add webcam view page with permissions
archessmn Oct 3, 2024
2a4a1a8
Merge branch 'main' into int-165-webcams
archessmn Oct 3, 2024
5ca99ea
Remove public event banner on event page
markspolakovs Oct 3, 2024
90b1bab
Appease prettier
archessmn Oct 3, 2024
94be9f3
Appease prettier again
archessmn Oct 3, 2024
eb7bdf0
Fix permissions and imports for actions
archessmn Oct 3, 2024
cd0d3be
Merge pull request #163 from ystv/int-165-webcams
archessmn Oct 3, 2024
c657c77
Merge pull request #164 from ystv/mp/no-public-banner-on-event-page
archessmn Oct 3, 2024
7d243f8
Make nickname not required when editing a user
archessmn Oct 3, 2024
f0bf67b
Merge pull request #165 from ystv/mia/edit-user-fix
archessmn Oct 3, 2024
866ef10
Add titles to pages to differentiate tabs
archessmn Oct 7, 2024
18be8a3
[INT-200] Check database connection on startup and on `/healthz` endp…
archessmn Oct 7, 2024
1243903
Remove some grim imports
archessmn Oct 8, 2024
2b10538
Basic page for deleting session data
archessmn Oct 8, 2024
3c2aff0
Forgot I deadnamed myself in the docs lol
archessmn Oct 8, 2024
206b898
Merge pull request #170 from ystv/mia/bad-docs-bad
archessmn Oct 8, 2024
d55946f
Merge pull request #167 from ystv/int-200-healthz-should-check-databa…
archessmn Oct 8, 2024
5b6063f
Rename SetClientData to PageInfo
archessmn Oct 8, 2024
424e4cb
Merge pull request #169 from ystv/int-198-page-for-managing-session-data
archessmn Oct 8, 2024
d661f20
Merge pull request #166 from ystv/int-199-set-event-title-bars-to-the…
archessmn Oct 9, 2024
d963d80
[INT-201] #CheckWithTech enhancements (#168)
markspolakovs Oct 9, 2024
12f5f2b
Unbreak slack actions import (+ add lint) (#171)
markspolakovs Oct 9, 2024
f7c55b5
Run server build through tsc-alias to fix import issues once and for …
markspolakovs Oct 9, 2024
e34b961
Add env var to disable socket mode (#173)
markspolakovs Oct 9, 2024
e2907dc
Tell Bolt to not listen on port 3000 (#174)
markspolakovs Oct 9, 2024
d1ec3de
Make webcam loading spinners appear/disappear more reliably (#175)
markspolakovs Oct 12, 2024
4b06aba
Use ramdisk for faster(?) Jenkins builds
markspolakovs Oct 12, 2024
e0164ef
Merge pull request #177 from ystv/mp/jenkins-ramdisk
archessmn Oct 14, 2024
8fa8fa6
[INT-205] Handle case where channel is too large for old in_channel c…
archessmn Oct 15, 2024
5b3dacf
[INT-204] Replace URL search calendar state with history state + TanS…
markspolakovs Oct 15, 2024
912a24f
#CheckWithTech: Better handle users without Slack (#178)
markspolakovs Oct 15, 2024
892ecf9
Remove dead code
archessmn Oct 15, 2024
0c13727
[INT-206] Rework post-login redirects
archessmn Oct 15, 2024
901a7e8
Post-login redirects for slack
archessmn Oct 15, 2024
01d3dd5
Fix build stuff
archessmn Oct 15, 2024
f36248f
Simplify socketio implementation
archessmn Oct 18, 2024
e48c885
Remove dead code and fix logic
archessmn Oct 18, 2024
83d9ada
Update socket docs
archessmn Oct 18, 2024
ea88ac6
Update README to include socket.io docs
archessmn Oct 18, 2024
7bf10f5
Redirect on check with tech sign in prompt
archessmn Oct 18, 2024
9c336cc
Merge pull request #181 from ystv/int-206-implement-post-login-redire…
archessmn Oct 18, 2024
023272c
Use boltjs CodedError checks
archessmn Oct 18, 2024
0b4cfee
Update implementing_socket_io.md
archessmn Oct 18, 2024
52fd3aa
Merge branch 'main' into mia/socket-fuckery
archessmn Oct 18, 2024
c48b4b8
Merge pull request #182 from ystv/mia/socket-fuckery
archessmn Oct 18, 2024
bbeb4a1
Merge pull request #180 from ystv/int-205-set-channel-failing-if-alre…
archessmn Oct 19, 2024
26a23e4
Add some awaits (#183)
markspolakovs Oct 19, 2024
062aadd
Move COOKIE_NAME to auth core and rename
archessmn Oct 20, 2024
9b536b8
Merge pull request #184 from ystv/mia/cookie-fix
archessmn Oct 20, 2024
140c521
added word breaks for long words in title
ben260 Oct 20, 2024
6afe09c
Merge pull request #185 from ystv/int-133-long-event-titles-cut-off-o…
ben260 Oct 20, 2024
3e60984
added the <br> love to check with tech requests
ben260 Oct 20, 2024
594ba7d
formatting
ben260 Oct 20, 2024
eb715e3
Run yarn prettify to fix formatting issues
archessmn Oct 21, 2024
9d1f8e6
Parse slack errors semi-properly
archessmn Oct 21, 2024
8a9658c
Merge pull request #186 from ystv/int-208-calendarevent-checkwithtech…
archessmn Oct 21, 2024
6070eda
Merge pull request #187 from ystv/mia/slack-error-fix
archessmn Oct 21, 2024
3dc71b0
Add some basic docs for how to contribute to the project.
archessmn Oct 22, 2024
93d14c8
adding permissions for new workshop type
ben260 Oct 23, 2024
01ec9f3
new type and colours key component
ben260 Oct 23, 2024
6020dca
add colour coding to page
ben260 Oct 23, 2024
fbd5449
Bump prisma version
archessmn Oct 23, 2024
bd94840
Create pull_request_template.md
markspolakovs Oct 23, 2024
c88fed7
Update contributing.md
archessmn Oct 24, 2024
ef49fa6
Merge pull request #190 from ystv/mia/bump-prisma
archessmn Oct 24, 2024
499796e
Merge pull request #192 from ystv/mp/pr-template
archessmn Oct 24, 2024
715bbb5
Update colours to improve contrast
archessmn Oct 24, 2024
05ef63c
Add info for PR templates #192
archessmn Oct 24, 2024
4cd2837
Update contributing.md to remove PR template
archessmn Oct 24, 2024
fdee34d
Merge pull request #188 from ystv/mia/contributing-docs
archessmn Oct 24, 2024
7808ec9
reordered new permission and removed unused type
ben260 Oct 24, 2024
792e8da
Merge pull request #189 from ystv/int-93-can-we-have-different-colour…
ben260 Oct 24, 2024
75bc187
[INT-209] Update CheckWithTech Slack message even if requestor doesn'…
markspolakovs Nov 26, 2024
4fc38da
Handle all statuses
markspolakovs Nov 26, 2024
6f33d4a
No longer need this assertion
markspolakovs Nov 26, 2024
6def56b
Don't follow up for notes
markspolakovs Nov 26, 2024
953b09c
Merge pull request #193 from ystv/int-209-cwt-approval-not-synced-bac…
archessmn Dec 3, 2024
5cd2937
Add map for CheckWithTech to prisma schema
archessmn Dec 10, 2024
f21d757
Merge pull request #194 from ystv/mia-has-ocd
archessmn Dec 10, 2024
79066c5
Change Dev to internal-site
archessmn Dec 31, 2024
e86b478
Merge pull request #195 from ystv/mia/calendar-to-internal-site
archessmn Dec 31, 2024
faff24b
Make prod and preview internal-site too
archessmn Dec 31, 2024
ba39d10
Merge pull request #196 from ystv/mia/calendar-to-internal-site
archessmn Dec 31, 2024
27791bd
Change more things over from [REDACTED] to internal-site
archessmn Jan 1, 2025
afa9de7
Merge pull request #197 from ystv/mia/un-deadname-internal-site
archessmn Jan 1, 2025
c78b02a
Add home page and news feed
markspolakovs Aug 19, 2024
6962ffa
Moves footer into nav to fix main body size issues
Keeeeeeeen Sep 5, 2024
991a762
Youtube caching and some light styling changes
Keeeeeeeen Sep 6, 2024
a08abcd
nav go brr
Keeeeeeeen Sep 6, 2024
e07d08e
I should go to bed maybe
Keeeeeeeen Sep 7, 2024
810cf3b
Merge branch 'kory/navigation' of https://github.com/ystv/internal-si…
Keeeeeeeen Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
# NB: These are _not_ prefixed with NEXT_PUBLIC because we don't want their values to be sewn into the Docker image
# Base configuration
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/calendar_2023"
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/internal_site"
PUBLIC_URL=http://localhost:3000
SESSION_SECRET= # A random string, in production should be a secure secret e.g. `openssl rand -base64 32`

# Google login configuration
GOOGLE_CLIENT_ID=
GOOGLE_PERMITTED_DOMAINS=york.ac.uk
GOOGLE_PERMITTED_DOMAINS=york.ac.uk,ystv.co.uk


# Needed for youtube integration, optional otherwise. This is *not* the client secret!
GOOGLE_API_KEY=
# AdamRMS configuration
ADAMRMS_EMAIL=
ADAMRMS_PASSWORD=
ADAMRMS_BASE=
ADAMRMS_PROJECT_TYPE_ID=


# Slack configuration
SLACK_ENABLED=false
SESSION_SECRET=
COOKIE_DOMAIN=localhost
SESSION_SECRET=
SLACK_ENABLED=
SLACK_BOT_TOKEN=
SLACK_APP_TOKEN=
SLACK_SIGNING_SECRET=
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_TEAM_ID= # Should be set only if the slack integration is used across multiple workspaces
SLACK_USER_FEEDBACK_CHANNEL=
SENTRY_PROJECT_ID=
# SLACK_BOT_TOKEN=
# SLACK_APP_TOKEN=
# SLACK_SIGNING_SECRET=
# SLACK_CLIENT_ID=
# SLACK_CLIENT_SECRET=
# Should be set if the slack integration is used across multiple workspaces
SLACK_TEAM_ID=
# Use https://www.streamweasels.com/tools/youtube-channel-id-and-user-id-convertor/ to convert
YOUTUBE_CHANNEL_ID=UCwViVJcFiwBSDmzhaHiagqw
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": [
"next/core-web-vitals",
"prettier",
"plugin:storybook/recommended"
"plugin:storybook/recommended",
"plugin:@tanstack/query/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
Expand Down
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
https://linear.app/ystv/issue/INT-XXX <!-- fill this in, or remove if there isn't one -->

## What

<!-- What does this PR do? One sentence if possible. -->

## Why

<!-- How does this PR improve YSTV members' lives? -->

## How

<!-- Is there anything noteworthy about how you implemented it? Something for the reviewer to be aware of? -->

## Testing

<!-- Give evidence that it works, to save your reviewer's time. Talk about how you tested it. Include screenshots. -->
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
/.direnv

# testing
/coverage
Expand Down Expand Up @@ -48,4 +49,6 @@ next-env.d.ts
# Sentry Auth Token
.sentryclirc

certificates
certificates
# Sentry Config File
.env.sentry-build-plugin
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ FROM node:20-bookworm-slim AS base
RUN apt-get update -y && apt-get install -y ca-certificates git openssl

FROM base AS build
RUN apt-get update -y && apt-get install -y build-essential python3
WORKDIR /app
COPY ./.yarn/ .yarn/
COPY . /app/
RUN --mount=type=cache,id=calendar2023-yarn,target=.yarn/cache yarn install --immutable --inline-builds
RUN --mount=type=cache,id=internal-site-yarn,target=.yarn/cache yarn install --immutable --inline-builds

ENV NODE_ENV=production
ARG GIT_REV
ENV GIT_REV=$GIT_REV
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
ARG VERSION
ENV VERSION=$VERSION
RUN SKIP_ENV_VALIDATION=1 PUBLIC_URL="http://localhost:3000" yarn run build
RUN --mount=type=secret,id=sentry-auth-token \
SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry-auth-token) \
SKIP_ENV_VALIDATION=1 \
PUBLIC_URL="http://localhost:3000" \
yarn run build

FROM base
COPY --from=build /app/dist /app/dist
Expand Down
28 changes: 16 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
def imageTag = ''
pipeline {
agent {
label 'docker'
node {
label 'docker && ramdisk'
customWorkspace '/mnt/ramdisk/build/workspace/internal-site'
}
}

environment {
Expand All @@ -25,14 +28,14 @@ pipeline {
}
stage('Build Images') {
environment {
SENTRY_AUTH_TOKEN = credentials('calendar-sentry-auth-token')
SENTRY_AUTH_TOKEN = credentials('internal-site-sentry-auth-token')
}
steps {
sh """docker build \\
--build-arg GIT_REV=${env.GIT_COMMIT} \\
--build-arg VERSION=${env.TAG_NAME ?: 'v0.0.0'} \\
--build-arg SENTRY_AUTH_TOKEN=\$SENTRY_AUTH_TOKEN \\
-t registry.comp.ystv.co.uk/ystv/calendar2023:${imageTag}\\
--secret id=sentry-auth-token,env=SENTRY_AUTH_TOKEN \\
-t registry.comp.ystv.co.uk/ystv/internal-site:${imageTag}\\
.
"""
}
Expand All @@ -47,7 +50,7 @@ pipeline {
}
}
steps {
dockerPush image: 'registry.comp.ystv.co.uk/ystv/calendar2023', tag: imageTag
dockerPush image: 'registry.comp.ystv.co.uk/ystv/internal-site', tag: imageTag
}
}

Expand All @@ -56,7 +59,7 @@ pipeline {
changeRequest target: 'main'
}
steps {
deployPreview action: 'deploy', job: 'calendar-preview', urlSuffix: 'internal.dev.ystv.co.uk'
deployPreview action: 'deploy', job: 'internal-site-preview', urlSuffix: 'internal.dev.ystv.co.uk'
}
}

Expand All @@ -66,11 +69,12 @@ pipeline {
}
steps {
build job: 'Deploy Nomad Job', parameters: [
string(name: 'JOB_FILE', value: 'calendar-dev.nomad'),
text(name: 'TAG_REPLACEMENTS', value: "registry.comp.ystv.co.uk/ystv/calendar2023:${imageTag}")
string(name: 'JOB_FILE', value: 'internal-site-dev.nomad'),
text(name: 'TAG_REPLACEMENTS', value: "registry.comp.ystv.co.uk/ystv/internal-site:${imageTag}")
], wait: true
deployPreview action: 'cleanup'
sh "nomad alloc exec -task calendar-dev -job calendar-dev npx -y prisma migrate deploy --schema lib/db/schema.prisma"
deployPreview action: 'cleanupMerge'
sh "nomad alloc exec -task internal-site-dev -job internal-site-dev npx -y prisma migrate deploy --schema lib/db/schema.prisma"
}
}

Expand All @@ -81,10 +85,10 @@ pipeline {
}
steps {
build job: 'Deploy Nomad Job', parameters: [
string(name: 'JOB_FILE', value: 'calendar-prod.nomad'),
text(name: 'TAG_REPLACEMENTS', value: "registry.comp.ystv.co.uk/ystv/calendar2023:${imageTag}")
string(name: 'JOB_FILE', value: 'internal-site-prod.nomad'),
text(name: 'TAG_REPLACEMENTS', value: "registry.comp.ystv.co.uk/ystv/internal-site:${imageTag}")
], wait: true
sh "nomad alloc exec -task calendar-prod -job calendar-prod npx -y prisma migrate deploy --schema lib/db/schema.prisma"
sh "nomad alloc exec -task internal-site-prod -job internal-site-prod npx -y prisma migrate deploy --schema lib/db/schema.prisma"
}
}
}
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# YSTV Calendar
# YSTV Internal Site

This is the repo for https://internal.ystv.co.uk.
Formerly known as `experimental-hypothetical-new-internal-site-idea`.

## Getting Started

To set up a local copy of the new calendar, you will need
To set up a local copy of the new internal site, you will need

- Node.js (18 or later) - https://nodejs.org/en/download
- Yarn - once you have Node installed, run `corepack enable`
Expand All @@ -31,7 +31,7 @@ You will also need to set up the following:

### Postgres Database

Once you have PostgreSQL installed, run `createdb calendar_2023`.
Once you have PostgreSQL installed, run `createdb internal_site`.

Now run `yarn prisma db push` to set up the database tables.
If you get a permissions error, check your PostgreSQL authentication settings - you should have a `local all all peer` line in your pg_hba.conf.
Expand Down Expand Up @@ -80,13 +80,21 @@ Open [http://localhost:3000](http://localhost:3000) or [https://localhost:3000](

To get admin permissions, sign in once with Google, then run `yarn do promoteUser <your email>`.

## Development

There are some docs written for developing specific features but otherwise looking at the code and the [Next.js documentation](https://nextjs.org/docs) is the best place to get started.

Feature specific docs:

- [Socket.io communication](/docs/development/implementing_socket_io.md)

## Structure

- app/ - pages
- features/ - business logic functinality
- lib/ - low level utilities (auth, db, etc.)
- server/ - custom server that handles socket.io communication

## Development
## Contributing

We use [Linear](https://linear.app/ystv) to track issues - to access it, sign in with your @ystv.co.uk Google account (ask a Computing Team member if you don't have one).
Some documentation about how to contribute and some standards to follow is available [here](/docs/contributing.md)
3 changes: 0 additions & 3 deletions app/(authenticated)/(superuser)/admin/page.tsx

This file was deleted.

71 changes: 0 additions & 71 deletions app/(authenticated)/(superuser)/admin/positions/page.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions app/(authenticated)/(superuser)/layout.tsx

This file was deleted.

15 changes: 15 additions & 0 deletions app/(authenticated)/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import ErrorPage from "@/components/ErrorPage";
import { hasPermission } from "@/lib/auth/server";
import { notFound } from "next/navigation";

export default async function AuthenticatedLayout({
children,
}: {
children: React.ReactNode;
}) {
if (await hasPermission("Admin.Positions", "Admin.Roles", "Admin.Users")) {
return <>{children}</>;
} else {
return <ErrorPage code={403} message="Forbidden" />;
}
}
26 changes: 26 additions & 0 deletions app/(authenticated)/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { PageInfo } from "@/components/PageInfo";
import { Button, Card, Stack } from "@mantine/core";
import Link from "next/link";

export const dynamic = "force-dynamic";

export default function AdminPage() {
return (
<>
<PageInfo title="Admin" />
<Card>
<Stack>
<Link href={"/admin/users"}>
<Button variant="default">Users</Button>
</Link>
<Link href={"/admin/positions"}>
<Button variant="default">Crew Positions</Button>
</Link>
<Link href={"/admin/roles"}>
<Button variant="default">Roles</Button>
</Link>
</Stack>
</Card>
</>
);
}
Loading
Loading