diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e509a47 --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +DATABASE_URL= + +AUTH_SECRET= # Added by `npx auth`. Read more: https://cli.authjs.dev + +AUTH_AUTHENTIK_ID= +AUTH_AUTHENTIK_SECRET= +AUTH_AUTHENTIK_ISSUER= + +NEXT_PUBLIC_APP_URL= + +MEETUP_SKIP_LOGIN= \ No newline at end of file diff --git a/.github/workflows/container-scan.yml b/.github/workflows/container-scan.yml index 0266cdc..2139ad7 100644 --- a/.github/workflows/container-scan.yml +++ b/.github/workflows/container-scan.yml @@ -9,22 +9,11 @@ jobs: name: Container Scan runs-on: docker container: - image: node:22-bullseye@sha256:ed0338dd02fd86861a59dc1cbc2e12152f3a93c4ce5933d347d6677232000dc7 + image: ghcr.io/di0ik/forgejo_runner_container:main steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Install Docker - run: | - apt-get update - apt-get install -y ca-certificates curl - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - - name: Build an image from Dockerfile run: docker build -t git.dominikstahl.dev/dhbw-we/meetup:${{ github.sha }} . @@ -41,3 +30,9 @@ jobs: uses: forgejo/upload-artifact@v4 with: path: trivy-report.json + + - 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 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 69147b5..6ecc55f 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -12,18 +12,9 @@ on: jobs: docker: runs-on: docker + container: + image: ghcr.io/di0ik/forgejo_runner_container:main steps: - - name: Install Docker - run: | - apt-get update - apt-get install -y ca-certificates curl - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - - name: Login to Docker Hub uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 with: @@ -46,14 +37,14 @@ jobs: - name: lowercase repo name run: | - echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >>${GITHUB_ENV} - name: Build and push (pull_request) uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6 if: github.event_name == 'pull_request' with: push: true - tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag}} + tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag}} - name: Build and push (push_tag) uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6 @@ -67,4 +58,9 @@ jobs: if: github.event_name == 'push' && github.ref_type == 'branch' with: push: true - tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:main + tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag }} + + - name: Clean up Docker + run: | + docker builder prune -af --keep-storage 2GB + docker image prune -f diff --git a/.gitignore b/.gitignore index 5ef6a52..7b8da95 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/Dockerfile b/Dockerfile index 5d16c45..faee65e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,10 @@ COPY --from=builder /app/public ./public COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static +LABEL org.opencontainers.image.source="https://git.dominikstahl.dev/DHBW-WE/MeetUp" +LABEL org.opencontainers.image.title="MeetUp" +LABEL org.opencontainers.image.description="A web application for managing meetups" + EXPOSE 3000 ENV HOSTNAME="0.0.0.0" diff --git a/README.md b/README.md index a225c9e..1d4b270 100644 --- a/README.md +++ b/README.md @@ -1 +1,145 @@ -# MeetUp +# MeetUP + +## Description + +MeetUP is a social calendar application designed to make coordinating schedules with friends seamless and intuitive. It was created because it can be a hassle coordinating meetings between multiple friends and across different friend groups. MeetUP aims to simplify the process of finding mutual availability without endless back-and-forth messaging. + +## Project Status + +**Still in Development:** This project is actively under development. Core features are being built, and the application is not yet feature-complete or ready for production use. + +## Features + +### Implemented Features + +- Core infrastructure setup in progress. No user-facing features are implemented yet. + +### Planned Features (Roadmap) + +- **Friendships:** Connect with friends to share calendars. +- **Group Calendars:** Create and manage shared calendars for groups. +- **iCal Import:** Import existing calendars from iCalendar (.ics) files. +- **iCal Export:** Export personal or shared calendars in iCalendar (.ics) format. +- **Email Notifications:** Receive email alerts for event bookings, reminders, and updates. +- **View Blocked Slots:** See when friends are busy without revealing event details. +- **Book Timeslots:** Request and confirm meeting times in friends' available slots. +- **SSO Compatibility:** Planning for Single Sign-On integration. + +## Technologies Used + +This project is built with a modern tech stack: + +- **Package Manager:** [Yarn](https://yarnpkg.com/) +- **Framework:** [Next.js](https://nextjs.org/) - React framework for server-side rendering and static site generation. +- **Language:** [TypeScript](https://www.typescriptlang.org/) - Superset of JavaScript that adds static typing. +- **ORM:** [Prisma](https://www.prisma.io/) - Next-generation ORM for Node.js and TypeScript. +- **Authentication:** [Auth.js](https://authjs.dev/) (formerly NextAuth.js) - Authentication for Next.js. +- **Styling:** [Tailwind CSS](https://tailwindcss.com/) - A utility-first CSS framework. +- **UI Components:** [shadcn/ui](https://ui.shadcn.com/) - Re-usable components built using Radix UI and Tailwind CSS. +- **Containerization:** [Docker](https://www.docker.com/) (for planned self-hosting option) +- _(You can also list related tools here, e.g., ESLint, Prettier, testing libraries if you plan to use them)_ + +## Getting Started + +**Prerequisites:** + +- Node.js: Version is continually upgraded. It's recommended to use the latest LTS or a recent stable version. (Check `.nvmrc` if available). +- Yarn: Version is continually upgraded. (Check `package.json` engines field if specified). +- A database supported by Prisma (e.g., PostgreSQL, MySQL, SQLite). Ensure your database server is running. + +**Installation & Running Locally:** + +1. **Clone the repository:** + - Using SSH: + ```bash + git clone ssh://git@git.dominikstahl.dev/DHBW-WE/MeetUp.git + ``` + - Or using HTTPS (recommended for most users): + ```bash + git clone [https://git.dominikstahl.dev/DHBW-WE/MeetUp.git](https://git.dominikstahl.dev/DHBW-WE/MeetUp.git) + ``` + ```bash + cd MeetUp + ``` +2. **Install dependencies:** + ```bash + yarn install + ``` +3. **Set up environment variables:** + + - You will need to create an `AUTH_SECRET`. You can generate one using the following command: + ```bash + npx auth secret + ``` + - Copy the `.env.example` file (if it exists) to `.env.local`. If not, create `.env.local`. + ```bash + # If .env.example exists: + cp .env.example .env.local + # Otherwise, create .env.local and add the following: + ``` + - Ensure the following environment variables are set in your `.env.local` file. Adjust `DATABASE_URL` for your specific database provider and credentials. + + ```env + # Database Connection String (Prisma) + # Example for PostgreSQL: DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public" + DATABASE_URL="your_database_connection_string" + + # Generated with npx auth secret + AUTH_SECRET="your_generated_auth_secret" + + # Authentik SSO Variables (if you are using this provider) + AUTH_AUTHENTIK_ID= + AUTH_AUTHENTIK_SECRET= + AUTH_AUTHENTIK_ISSUER= + + # Base URL of your application + NEXT_PUBLIC_APP_URL="http://localhost:3000" + ``` + +4. **Apply database migrations (Prisma):** + + - Ensure your Prisma schema (`prisma/schema.prisma`) is defined. + - Run the following command to apply migrations and generate Prisma Client: + ```bash + npx prisma migrate dev + # You might be prompted to name your first migration. + ``` + - (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. + +**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. + +## Contributing + +_(This section can be expanded as your project grows and you're open to contributions.)_ + +Contributions are welcome! If you'd like to contribute, please: + +1. Fork the repository. +2. Create a new branch (`git checkout -b feature/your-feature-name` or `fix/your-bug-fix`). +3. Make your changes. +4. Commit your changes (`git commit -m 'Add some feature'`). +5. Push to the branch (`git push origin feature/your-feature-name`). +6. Open a Pull Request against the `main` (or `develop`) branch. + +Please ensure your code adheres to the project's coding standards (e.g., run linters/formatters if configured) and that any database schema changes are accompanied by a Prisma migration. + +_(Optional: You can add more details about reporting bugs, suggesting features, or coding style guides here.)_ + +--- + +**(Optional Sections You Might Want to Add Later):** + +- **Screenshots/Demo:** (Once you have UI to show) +- **API Reference:** (If you plan to expose an API) +- **Detailed Deployment Guides:** (For various platforms beyond Docker) +- **License:** (e.g., MIT, GPL - Important for open source projects) +- **Contact:** (How to get in touch with the maintainers) +- **Acknowledgements:** (Credit to any libraries, inspirations, or contributors) diff --git a/docker-compose.yml b/docker-compose.yml index 9cff22a..cee59f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,5 +3,9 @@ services: build: context: . dockerfile: Dockerfile + image: git.dominikstahl.dev/dhbw-we/meetup:main ports: - '3000:3000' + environment: + - AUTH_SECRET=secret + - AUTH_URL=http://localhost:3000 diff --git a/package.json b/package.json index f50124c..aba1ecb 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@fortawesome/free-regular-svg-icons": "^6.7.2", "@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/react-fontawesome": "^0.2.2", + "@radix-ui/react-hover-card": "^1.1.13", "@radix-ui/react-slot": "^1.2.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index b843b45..6bd8531 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -2,9 +2,16 @@ import { auth } from '@/auth'; import SSOLogin from '@/components/user/sso-login-button'; import LoginForm from '@/components/user/login-form'; import { redirect } from 'next/navigation'; +import { Button } from '@/components/ui/button'; +import Image from 'next/image'; import '@/app/globals.css'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { + HoverCard, + HoverCardTrigger, + HoverCardContent, +} from '@/components/ui/hover-card'; export default async function LoginPage() { const session = await auth(); @@ -15,20 +22,36 @@ export default async function LoginPage() { return (