Compare commits

..

37 commits

Author SHA1 Message Date
aebf89a83e refactor: update labels and placeholders in login form inputs
All checks were successful
docker-build / docker (pull_request) Successful in 3m24s
container-scan / Container Scan (pull_request) Successful in 4m40s
2025-05-13 23:52:50 +02:00
398c1f7abb feat: add Radix UI label component and update dependencies 2025-05-13 23:49:06 +02:00
8fd93fa7bc Merge pull request 'refactor: auth flow, middleware and login page' (#55)
All checks were successful
container-scan / Container Scan (push) Successful in 2m3s
docker-build / docker (push) Successful in 3m41s
Reviewed-on: #55
Reviewed-by: Maximilian Liebmann <lima@noreply.git.dominikstahl.dev>
2025-05-13 18:34:58 +00:00
aca229b3d3 refactor: removes unused sso logout button 2025-05-13 18:34:58 +00:00
4f974a0b70 docs: test user for development 2025-05-13 18:34:58 +00:00
b68a561886 feat: add logout page 2025-05-13 18:34:58 +00:00
20eb6ae04a refactor: dynamically generated login page 2025-05-13 18:34:58 +00:00
ddcb14e564 refactor: move auth check into pages 2025-05-13 18:34:58 +00:00
dd6b82515e chore(deps): update dependency @types/react-dom to v19.1.5
All checks were successful
container-scan / Container Scan (push) Successful in 1m51s
docker-build / docker (push) Successful in 1m54s
2025-05-13 11:00:46 +00:00
f79b7b78f9 Merge pull request 'chore(deps): update dependency @types/react to v19.1.4' (#57)
All checks were successful
container-scan / Container Scan (push) Successful in 1m21s
docker-build / docker (push) Successful in 1m4s
Reviewed-on: #57
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 21:10:15 +00:00
fc828b2ac5 chore(deps): update dependency @types/react to v19.1.4
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m26s
docker-build / docker (pull_request) Successful in 3m5s
docker-build / docker (push) Successful in 4m20s
2025-05-12 20:00:50 +00:00
749c747b3a Merge pull request 'fix(deps): update dependency lucide-react to ^0.510.0' (#53)
All checks were successful
docker-build / docker (push) Successful in 1m1s
container-scan / Container Scan (push) Successful in 1m13s
Reviewed-on: #53
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 19:37:01 +00:00
b34f45230c fix(deps): update dependency lucide-react to ^0.510.0
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m15s
docker-build / docker (push) Successful in 5m47s
docker-build / docker (pull_request) Successful in 3m10s
2025-05-12 14:01:09 +00:00
04c65cd584 chore(deps): update dependency @types/react-dom to v19.1.4
All checks were successful
docker-build / docker (push) Successful in 1m2s
container-scan / Container Scan (push) Successful in 2m14s
2025-05-12 13:00:43 +00:00
86b9b9e6ad Merge pull request 'docs: update contribution guidelines to standardize branch naming and commit message format' (#52)
All checks were successful
container-scan / Container Scan (push) Successful in 1m20s
docker-build / docker (push) Successful in 3m28s
Reviewed-on: #52
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 11:22:11 +00:00
43fe60f697 Merge pull request 'feat: add settings page' (#49)
Some checks failed
container-scan / Container Scan (push) Has been cancelled
docker-build / docker (push) Has been cancelled
Reviewed-on: #49
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 11:21:41 +00:00
9aced187eb docs: update contribution guidelines to standardize branch naming and commit message format
All checks were successful
container-scan / Container Scan (pull_request) Successful in 1m13s
docker-build / docker (pull_request) Successful in 2m40s
2025-05-12 13:15:14 +02:00
90a9c5d233 style: standardize quotes and formatting in Select, Separator, and Switch components
All checks were successful
container-scan / Container Scan (pull_request) Successful in 1m30s
docker-build / docker (pull_request) Successful in 2m53s
2025-05-12 12:57:51 +02:00
d16cfbcb71 feat: added tabs to settings window and created general settings window design 2025-05-12 12:57:46 +02:00
7949c09544 feat: add ScrollableSettingsWrapper component for scrollable settings 2025-05-12 11:11:04 +02:00
f0a8275536 feat: add Radix UI Select, Separator, and Switch components 2025-05-12 11:11:04 +02:00
fd6462e02d feat: implement Settings page with tabs 2025-05-12 11:10:58 +02:00
da5a2324c6 style: standardize quotes and formatting in Tabs component 2025-05-12 11:10:11 +02:00
033801d596 feat: add Radix UI Tabs component and update dependencies 2025-05-12 10:58:26 +02:00
f631195f8a feat: add Tabs component with Radix UI integration 2025-05-12 10:56:41 +02:00
8ef6478ea4 Merge pull request 'feat: add theme toggle' (#48)
All checks were successful
container-scan / Container Scan (push) Successful in 1m9s
docker-build / docker (push) Successful in 3m51s
Reviewed-on: #48
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 08:55:24 +00:00
749a24a44d style: standardize quotes and formatting in DropdownMenu component
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m2s
docker-build / docker (pull_request) Successful in 2m57s
2025-05-12 10:01:07 +02:00
11204f0e34 feat: restructure Home component layout and add ThemePicker 2025-05-12 10:01:07 +02:00
ce39729d74 feat: add theme picker to login page layout 2025-05-12 10:00:55 +02:00
671eab15b8 feat: add dropdown menu component and theme picker 2025-05-12 09:59:31 +02:00
92af2bbb7c Merge pull request 'fix: change login page to use radix ui labels' (#47)
All checks were successful
container-scan / Container Scan (push) Successful in 1m48s
docker-build / docker (push) Successful in 3m45s
Reviewed-on: #47
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 07:55:25 +00:00
7555cb4fe8 fix: update LabeledInput component to use Label from UI library and adjust spacing in LoginForm
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m6s
docker-build / docker (pull_request) Successful in 3m14s
2025-05-12 09:44:43 +02:00
b87a761808 feat: add Radix UI label component and update dependencies 2025-05-12 09:44:43 +02:00
cd643c3c4f Merge pull request 'chore: update yarn version'
Some checks failed
container-scan / Container Scan (push) Successful in 1m9s
docker-build / docker (push) Failing after 5m34s
Reviewed-on: #50
2025-05-12 07:29:08 +00:00
e1e788b9d2 chore(ci): enable caching
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m0s
docker-build / docker (pull_request) Successful in 2m55s
2025-05-12 09:12:39 +02:00
9c87943057 chore: update yarn version 2025-05-12 09:12:37 +02:00
2ec365213e Merge pull request 'feat: create footer message'
All checks were successful
container-scan / Container Scan (push) Successful in 2m26s
docker-build / docker (push) Successful in 3m35s
Reviewed-on: #40
Reviewed-by: Dominik <mail@dominikstahl.dev>
2025-05-12 07:02:53 +00:00
16 changed files with 233 additions and 4041 deletions

View file

@ -7,5 +7,3 @@ AUTH_AUTHENTIK_SECRET=
AUTH_AUTHENTIK_ISSUER=
NEXT_PUBLIC_APP_URL=
MEETUP_SKIP_LOGIN=

View file

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Build an image from Dockerfile
run: docker build -t git.dominikstahl.dev/dhbw-we/meetup:${{ github.sha }} .
run: docker buildx build -t meetup_trivy .
- name: Install Trivy
run: |
@ -23,8 +23,8 @@ jobs:
- name: Run Trivy vulnerability scanner
run: |
trivy image --exit-code 1 --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed --no-progress --format table git.dominikstahl.dev/dhbw-we/meetup:${{ github.sha }}
trivy image --exit-code 1 --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed --no-progress --format json git.dominikstahl.dev/dhbw-we/meetup:${{ github.sha }} > trivy-report.json
trivy image --exit-code 1 --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed --no-progress --format table meetup_trivy
trivy image --exit-code 1 --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed --no-progress --format json meetup_trivy > trivy-report.json
- name: Upload Trivy report
uses: forgejo/upload-artifact@v4
@ -33,6 +33,5 @@ jobs:
- name: Clean up Docker
run: |
docker builder prune -af --keep-storage 2GB
docker rmi $(docker images --filter=reference="git.dominikstahl.dev/dhbw-we/meetup:*" -q)
docker image prune -f
docker buildx prune --filter=until=48h -f
docker image rm meetup_trivy

View file

@ -45,6 +45,7 @@ jobs:
with:
push: true
tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag}}
cache-from: type=registry,ref=git.dominikstahl.dev/${{ env.REPO }}:buildcache
- name: Build and push (push_tag)
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6
@ -52,6 +53,7 @@ jobs:
with:
push: true
tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag }},git.dominikstahl.dev/${{ env.REPO }}:latest
cache-from: type=registry,ref=git.dominikstahl.dev/${{ env.REPO }}:buildcache
- name: Build and push (push_branch)
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6
@ -59,8 +61,9 @@ jobs:
with:
push: true
tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag }}
cache-from: type=registry,ref=git.dominikstahl.dev/${{ env.REPO }}:buildcache
cache-to: type=registry,ref=git.dominikstahl.dev/${{ env.REPO }}:buildcache,mode=max
- name: Clean up Docker
run: |
docker builder prune -af --keep-storage 2GB
docker image prune -f
docker buildx prune --filter=until=48h -f

1
.yarnrc.yml Normal file
View file

@ -0,0 +1 @@
nodeLinker: node-modules

View file

@ -4,13 +4,15 @@ FROM node:22-alpine@sha256:ad1aedbcc1b0575074a91ac146d6956476c1f9985994810e4ee02
FROM base AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN corepack enable
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --frozen-lockfile
# ----- Build -----
FROM base AS builder
WORKDIR /app
RUN corepack enable
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN yarn build

View file

@ -94,10 +94,6 @@ This project is built with a modern tech stack:
# Base URL of your application
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# Development: Skip login flow (set to "true" to bypass authentication)
# Ensure this is NOT set to "true" in production.
MEETUP_SKIP_LOGIN="false"
```
4. **Apply database migrations (Prisma):**
@ -111,11 +107,20 @@ This project is built with a modern tech stack:
- (Optional: If you need to generate Prisma Client without running migrations, use `npx prisma generate`)
5. **Run the development server:**
```bash
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) in your browser to see the application.
The test user for the application is:
```bash
email: test@example.com
password: password
```
**Self-Hosting with Docker (Planned):**
- A Docker image and `docker-compose.yml` file will be provided in the future to allow for easy self-hosting of the MeetUP application. This setup will also include database services. Instructions will be updated here once available.

View file

@ -26,7 +26,7 @@
"@radix-ui/react-tabs": "^1.1.11",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.509.0",
"lucide-react": "^0.510.0",
"next": "15.3.2",
"next-auth": "^5.0.0-beta.25",
"next-themes": "^0.4.6",
@ -38,8 +38,8 @@
"@eslint/eslintrc": "3.3.1",
"@tailwindcss/postcss": "4.1.6",
"@types/node": "22.15.17",
"@types/react": "19.1.3",
"@types/react-dom": "19.1.3",
"@types/react": "19.1.4",
"@types/react-dom": "19.1.5",
"eslint": "9.26.0",
"eslint-config-next": "15.3.2",
"eslint-config-prettier": "10.1.5",
@ -50,5 +50,5 @@
"tw-animate-css": "1.2.9",
"typescript": "5.8.3"
},
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
"packageManager": "yarn@4.9.1"
}

View file

@ -1,4 +1,3 @@
import { Logout } from '@/components/user/sso-logout-button';
import { RedirectButton } from '@/components/user/redirect-button';
import { ThemePicker } from '@/components/user/theme-picker';
@ -8,7 +7,7 @@ export default function Home() {
<div className='absolute top-4 right-4'>{<ThemePicker />}</div>
<div>
<h1>Home</h1>
<Logout />
<RedirectButton redirectUrl='/logout' buttonText='Logout' />
<RedirectButton redirectUrl='/settings' buttonText='Settings' />
</div>
</div>

View file

@ -1,4 +1,4 @@
import { auth } from '@/auth';
import { auth, providerMap } from '@/auth';
import SSOLogin from '@/components/user/sso-login-button';
import LoginForm from '@/components/user/login-form';
import { redirect } from 'next/navigation';
@ -35,11 +35,15 @@ export default async function LoginPage() {
<CardContent className='gap-6 flex flex-col'>
<LoginForm />
<hr />
{providerMap.length > 0 && <hr />}
{process.env.AUTH_AUTHENTIK_ISSUER && (
<SSOLogin provider='authentik' providerDisplayName='SSO' />
)}
{providerMap.map((provider) => (
<SSOLogin
key={provider.id}
provider={provider.id}
providerDisplayName={provider.name}
/>
))}
</CardContent>
</Card>
</div>

40
src/app/logout/page.tsx Normal file
View file

@ -0,0 +1,40 @@
import { signOut } from '@/auth';
import { Button } from '@/components/ui/button';
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '@/components/ui/card';
export default function SignOutPage() {
return (
<div className='flex flex-col items-center justify-center h-screen'>
<form
action={async () => {
'use server';
await signOut({ redirectTo: '/login' });
}}
>
<Card className='w-[350px] max-w-screen'>
<CardHeader>
<CardTitle className='text-lg text-center'>Logout</CardTitle>
<CardDescription className='text-center'>
Are you sure you want to log out?
</CardDescription>
</CardHeader>
<CardContent className='gap-6 flex flex-col'>
<Button
className='hover:bg-blue-600 hover:text-white'
type='submit'
variant='secondary'
>
Logout
</Button>
</CardContent>
</Card>
</form>
</div>
);
}

View file

@ -1,3 +1,9 @@
export default function Home() {
return <div></div>;
import { auth } from '@/auth';
import { redirect } from 'next/navigation';
export default async function Home() {
const session = await auth();
if (!session?.user) redirect('/login');
else redirect('/home');
}

View file

@ -1,13 +1,49 @@
import NextAuth from 'next-auth';
import type { Provider } from 'next-auth/providers';
import Credentials from 'next-auth/providers/credentials';
import Authentik from 'next-auth/providers/authentik';
const providers: Provider[] = [
!process.env.DISABLE_PASSWORD_LOGIN &&
Credentials({
credentials: { password: { label: 'Password', type: 'password' } },
authorize(c) {
if (c.password !== 'password') return null;
return {
id: 'test',
name: 'Test User',
email: 'test@example.com',
};
},
}),
process.env.AUTH_AUTHENTIK_ID && Authentik,
].filter(Boolean) as Provider[];
export const providerMap = providers
.map((provider) => {
if (typeof provider === 'function') {
const providerData = provider();
return { id: providerData.id, name: providerData.name };
} else {
return { id: provider.id, name: provider.name };
}
})
.filter((provider) => provider.id !== 'credentials');
export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [process.env.AUTH_AUTHENTIK_ISSUER ? Authentik : null].filter(
(x) => x !== null,
),
providers,
session: {
strategy: 'jwt',
},
pages: {
signIn: '/login',
signOut: '/logout',
},
callbacks: {
authorized: async ({ auth }) => {
return !!auth;
authorized({ auth }) {
return !!auth?.user;
},
},
});

View file

@ -1,9 +1,27 @@
import { signIn } from '@/auth';
import LabeledInput from '@/components/labeled-input';
import { Button } from '@/components/ui/button';
import { AuthError } from 'next-auth';
import { redirect } from 'next/navigation';
const SIGNIN_ERROR_URL = '/error';
export default function LoginForm() {
return (
<form className='flex flex-col gap-5 w-full'>
<form
className='flex flex-col gap-5 w-full'
action={async (formData) => {
'use server';
try {
await signIn('credentials', formData);
} catch (error) {
if (error instanceof AuthError) {
return redirect(`${SIGNIN_ERROR_URL}?error=${error.type}`);
}
throw error;
}
}}
>
<LabeledInput
type='email'
label='E-Mail or Username'

View file

@ -1,18 +0,0 @@
import { signOut } from '@/auth';
import { IconButton } from '@/components/icon-button';
import { faDoorOpen } from '@fortawesome/free-solid-svg-icons';
export function Logout() {
return (
<form
action={async () => {
'use server';
await signOut({ redirectTo: '/login' });
}}
>
<IconButton type='submit' variant='destructive' icon={faDoorOpen}>
Sign Out
</IconButton>
</form>
);
}

View file

@ -1,18 +1,4 @@
import { auth } from '@/auth';
export default auth((req) => {
if (
!req.auth &&
req.nextUrl.pathname !== '/login' &&
process.env.MEETUP_SKIP_LOGIN !== 'true'
) {
const newUrl = new URL('/login', req.nextUrl.origin);
return Response.redirect(newUrl);
} else if (req.auth != null && req.nextUrl.pathname === '/') {
const newUrl = new URL('/home', req.nextUrl.origin);
return Response.redirect(newUrl);
}
});
export { auth as middleware } from '@/auth';
export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],

4061
yarn.lock

File diff suppressed because it is too large Load diff