diff --git a/.eslintrc.json b/.eslintrc.json index 6153746e7..f0a758841 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,14 @@ { - "extends": "next/core-web-vitals", - "plugins": ["simple-import-sort"], + "extends": ["next/core-web-vitals"], + "plugins": ["simple-import-sort", "@typescript-eslint"], + "overrides": [ + { + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "extends": ["plugin:@typescript-eslint/recommended"] + } + ], "rules": { "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0c738d8f..21649db25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: - name: Set environment variables run: | echo "DATABASE_URL=postgresql://postgres:password@localhost:5432/db" >> $GITHUB_ENV + echo "SECRET_PASSWORD=abcdefghijklmnopqrstuvwxyz1234567890" >> $GITHUB_ENV - name: Install dependencies run: yarn install --frozen-lockfile diff --git a/README.md b/README.md index 46967ca6d..30e79a8a4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-orange.svg)](https://www.gnu.org/licenses/agpl-3.0) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/donate/?hosted_button_id=7QXP2CUBLY88E) - ![hero](./docs/images/hero-image.png) Rallly is a free group meeting scheduling tool – built with [Next.js](https://github.com/vercel/next.js/), [Prisma](https://github.com/prisma/prisma) & [TailwindCSS](https://github.com/tailwindlabs/tailwindcss) @@ -18,18 +17,13 @@ git clone https://github.com/lukevella/rallly.git cd rallly ``` -_optional_: Configure your SMTP server. Without this, Rallly won't be able to send out emails. You can set the following environment variables in a `.env` in the root of the project +Once inside the directory create a `.env` file where you can set your environment variables. There is a `sample.env` that you can use as a reference. +```bash +cp sample.env .env ``` -# support email - used as FROM email by SMTP server -SUPPORT_EMAIL=foo@yourdomain.com -# SMTP server - required if you want to send emails -SMTP_HOST=your-smtp-server -SMTP_PORT=587 -SMTP_SECURE="false" -SMTP_USER=your-smtp-user -SMTP_PWD=your-smtp-password -``` + +_See [configuration](#-configuration) to see what parameters are availble._ Build and run with `docker-compose` @@ -54,20 +48,7 @@ Copy the sample `.env` file then open it and set the variables. cp sample.env .env ``` -Fill in the required environment variables. - -``` -# postgres database - not needed if running with docker-compose -DATABASE_URL=postgres://your-database/db -# support email - used as FROM email by SMTP server -SUPPORT_EMAIL=foo@yourdomain.com -# SMTP server - required if you want to send emails -SMTP_HOST=your-smtp-server -SMTP_PORT=587 -SMTP_SECURE="false" -SMTP_USER=your-smtp-user -SMTP_PWD=your-smtp-password -``` +_See [configuration](#-configuration) to see what parameters are availble._ Install dependencies @@ -91,6 +72,19 @@ yarn build yarn start ``` +## ⚙️ Configuration + +| Parameter | Default | Description | +| --------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| DATABASE_URL | postgres://postgres:postgres@rallly_db:5432/db | A postgres database URL. Leave out if using the docker-compose file since it will spin up and connect to its own database instance. | +| SECRET_PASSWORD | - | A long string (minimum 25 characters) that is used to encrypt session data. | +| SUPPORT_EMAIL | - | An email address that will appear as the FROM email for all emails being sent out. | +| SMTP_HOST | - | Host name of your SMTP server | +| SMTP_PORT | - | Port of your SMTP server | +| SMTP_SECURE | false | Set to "true" if SSL is enabled for your SMTP connection | +| SMTP_USER | - | Username to use for your SMTP connection | +| SMTP_PWD | - | Password to use for your SMTP connection | + ## 👨‍💻 Contributors If you would like to contribute to the development of the project please reach out first before spending significant time on it. diff --git a/components/badge.tsx b/components/badge.tsx new file mode 100644 index 000000000..5c114b219 --- /dev/null +++ b/components/badge.tsx @@ -0,0 +1,26 @@ +import clsx from "clsx"; +import React from "react"; + +const Badge: React.VoidFunctionComponent<{ + children?: React.ReactNode; + color?: "gray" | "amber" | "green"; + className?: string; +}> = ({ children, color = "gray", className }) => { + return ( +
+ {children} +
+ ); +}; + +export default Badge; diff --git a/components/button/button.tsx b/components/button/button.tsx index 27a138abd..9c2350c5c 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -12,7 +12,6 @@ export interface ButtonProps { htmlType?: React.ButtonHTMLAttributes["type"]; type?: "default" | "primary" | "danger" | "link"; form?: string; - href?: string; rounded?: boolean; title?: string; onClick?: React.MouseEventHandler; @@ -27,7 +26,6 @@ const Button: React.ForwardRefRenderFunction = ( className, icon, disabled, - href, rounded, ...passThroughProps }, diff --git a/components/compact-button.tsx b/components/compact-button.tsx index e4cbf947f..6722206c0 100644 --- a/components/compact-button.tsx +++ b/components/compact-button.tsx @@ -17,7 +17,7 @@ const CompactButton: React.VoidFunctionComponent = ({ return (