├── app ├── favicon.ico ├── api │ └── sentry-example-api │ │ └── route.ts ├── loading.tsx ├── global-error.tsx ├── layout.tsx ├── patients │ └── [userId] │ │ ├── new-appointment │ │ ├── page.tsx │ │ └── success │ │ │ └── page.tsx │ │ └── register │ │ └── page.tsx ├── page.tsx ├── admin │ └── page.tsx ├── sentry-example-page │ └── page.tsx └── globals.css ├── public ├── favicon.ico ├── assets │ ├── gifs │ │ └── success.gif │ ├── images │ │ ├── admin.png │ │ ├── dr-cruz.png │ │ ├── dr-lee.png │ │ ├── dr-green.png │ │ ├── dr-peter.png │ │ ├── dr-powell.png │ │ ├── dr-sharma.png │ │ ├── cancelled-bg.png │ │ ├── dr-cameron.png │ │ ├── dr-remirez.png │ │ ├── pending-bg.png │ │ ├── register-img.png │ │ ├── dr-livingston.png │ │ ├── onboarding-img.png │ │ ├── appointment-img.png │ │ └── appointments-bg.png │ └── icons │ │ ├── check.svg │ │ ├── arrow.svg │ │ ├── user.svg │ │ ├── email.svg │ │ ├── upload.svg │ │ ├── appointments.svg │ │ ├── cancelled.svg │ │ ├── calendar.svg │ │ ├── pending.svg │ │ ├── close.svg │ │ ├── check-circle.svg │ │ ├── loader.svg │ │ ├── logo-icon.svg │ │ └── logo-full.svg ├── vercel.svg └── next.svg ├── postcss.config.mjs ├── instrumentation.ts ├── components ├── ThemeProvider.tsx ├── ui │ ├── label.tsx │ ├── separator.tsx │ ├── textarea.tsx │ ├── input.tsx │ ├── checkbox.tsx │ ├── popover.tsx │ ├── radio-group.tsx │ ├── button.tsx │ ├── input-otp.tsx │ ├── table.tsx │ ├── dialog.tsx │ ├── form.tsx │ ├── alert-dialog.tsx │ ├── command.tsx │ └── select.tsx ├── SubmitButton.tsx ├── StatusBadge.tsx ├── StatCard.tsx ├── FileUploader.tsx ├── AppointmentModal.tsx ├── forms │ ├── PatientForm.tsx │ ├── AppointmentForm.tsx │ └── RegisterForm.tsx ├── table │ ├── columns.tsx │ └── DataTable.tsx ├── PasskeyModal.tsx └── CustomFormField.tsx ├── components.json ├── .vscode └── settings.json ├── .gitignore ├── lib ├── appwrite.config.ts ├── utils.ts ├── actions │ ├── patient.actions.ts │ └── appointment.actions.ts └── validation.ts ├── .eslintrc.json ├── tsconfig.json ├── sentry.server.config.ts ├── sentry.edge.config.ts ├── types ├── appwrite.types.ts └── index.d.ts ├── sentry.client.config.ts ├── next.config.mjs ├── package.json ├── constants └── index.ts ├── tailwind.config.ts └── README.md /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/assets/gifs/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/gifs/success.gif -------------------------------------------------------------------------------- /public/assets/images/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/admin.png -------------------------------------------------------------------------------- /public/assets/images/dr-cruz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-cruz.png -------------------------------------------------------------------------------- /public/assets/images/dr-lee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-lee.png -------------------------------------------------------------------------------- /public/assets/images/dr-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-green.png -------------------------------------------------------------------------------- /public/assets/images/dr-peter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-peter.png -------------------------------------------------------------------------------- /public/assets/images/dr-powell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-powell.png -------------------------------------------------------------------------------- /public/assets/images/dr-sharma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-sharma.png -------------------------------------------------------------------------------- /public/assets/images/cancelled-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/cancelled-bg.png -------------------------------------------------------------------------------- /public/assets/images/dr-cameron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-cameron.png -------------------------------------------------------------------------------- /public/assets/images/dr-remirez.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-remirez.png -------------------------------------------------------------------------------- /public/assets/images/pending-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/pending-bg.png -------------------------------------------------------------------------------- /public/assets/images/register-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/register-img.png -------------------------------------------------------------------------------- /public/assets/images/dr-livingston.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/dr-livingston.png -------------------------------------------------------------------------------- /public/assets/images/onboarding-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/onboarding-img.png -------------------------------------------------------------------------------- /public/assets/images/appointment-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/appointment-img.png -------------------------------------------------------------------------------- /public/assets/images/appointments-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianhajdin/healthcare/HEAD/public/assets/images/appointments-bg.png -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /public/assets/icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /instrumentation.ts: -------------------------------------------------------------------------------- 1 | export async function register() { 2 | if (process.env.NEXT_RUNTIME === "nodejs") { 3 | await import("./sentry.server.config"); 4 | } 5 | 6 | if (process.env.NEXT_RUNTIME === "edge") { 7 | await import("./sentry.edge.config"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /public/assets/icons/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /components/ThemeProvider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { ThemeProvider as NextThemesProvider } from "next-themes"; 4 | import { type ThemeProviderProps } from "next-themes/dist/types"; 5 | 6 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 7 | return {children}; 8 | } 9 | -------------------------------------------------------------------------------- /app/api/sentry-example-api/route.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unreachable */ 2 | import { NextResponse } from "next/server"; 3 | 4 | export const dynamic = "force-dynamic"; 5 | 6 | // A faulty API route to test Sentry's error monitoring 7 | export function GET() { 8 | throw new Error("Sentry Example API Route Error"); 9 | return NextResponse.json({ data: "Testing Sentry Error..." }); 10 | } 11 | -------------------------------------------------------------------------------- /public/assets/icons/user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/loading.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image"; 2 | 3 | export default function Loading() { 4 | return ( 5 |
6 | loader 13 | Loading... 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": false, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /public/assets/icons/email.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.formatOnSave": true, 4 | "editor.codeActionsOnSave": { 5 | "source.fixAll.eslint": "explicit", 6 | "source.addMissingImports": "explicit" 7 | }, 8 | "prettier.tabWidth": 2, 9 | "prettier.useTabs": false, 10 | "prettier.semi": true, 11 | "prettier.singleQuote": false, 12 | "prettier.jsxSingleQuote": false, 13 | "prettier.trailingComma": "es5", 14 | "prettier.arrowParens": "always", 15 | "[typescriptreact]": { 16 | "editor.defaultFormatter": "esbenp.prettier-vscode" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | # Sentry Config File 39 | .env.sentry-build-plugin 40 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/upload.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /lib/appwrite.config.ts: -------------------------------------------------------------------------------- 1 | import * as sdk from "node-appwrite"; 2 | 3 | export const { 4 | NEXT_PUBLIC_ENDPOINT: ENDPOINT, 5 | PROJECT_ID, 6 | API_KEY, 7 | DATABASE_ID, 8 | PATIENT_COLLECTION_ID, 9 | DOCTOR_COLLECTION_ID, 10 | APPOINTMENT_COLLECTION_ID, 11 | NEXT_PUBLIC_BUCKET_ID: BUCKET_ID, 12 | } = process.env; 13 | 14 | const client = new sdk.Client(); 15 | 16 | client.setEndpoint(ENDPOINT!).setProject(PROJECT_ID!).setKey(API_KEY!); 17 | 18 | export const databases = new sdk.Databases(client); 19 | export const users = new sdk.Users(client); 20 | export const messaging = new sdk.Messaging(client); 21 | export const storage = new sdk.Storage(client); 22 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["import"], 3 | "extends": [ 4 | "next/core-web-vitals", 5 | "standard", 6 | "plugin:tailwindcss/recommended", 7 | "prettier" 8 | ], 9 | "rules": { 10 | "no-undef": "off", 11 | "import/order": [ 12 | "error", 13 | { 14 | "groups": [ 15 | "builtin", 16 | "external", 17 | "internal", 18 | "parent", 19 | "sibling", 20 | "index" 21 | ], 22 | "newlines-between": "always", 23 | "alphabetize": { 24 | "order": "asc", 25 | "caseInsensitive": true 26 | } 27 | } 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /public/assets/icons/appointments.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/assets/icons/cancelled.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/assets/icons/calendar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/global-error.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as Sentry from "@sentry/nextjs"; 4 | import NextError from "next/error"; 5 | import { useEffect } from "react"; 6 | 7 | export default function GlobalError({ 8 | error, 9 | }: { 10 | error: Error & { digest?: string }; 11 | }) { 12 | useEffect(() => { 13 | Sentry.captureException(error); 14 | }, [error]); 15 | 16 | return ( 17 | 18 | 19 | {/* `NextError` is the default Next.js error page component. Its type 20 | definition requires a `statusCode` prop. However, since the App Router 21 | does not expose status codes for errors, we simply pass 0 to render a 22 | generic error message. */} 23 | 24 | 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /sentry.server.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry on the server. 2 | // The config you add here will be used whenever the server handles a request. 3 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 4 | 5 | import * as Sentry from "@sentry/nextjs"; 6 | 7 | Sentry.init({ 8 | dsn: "https://3d627de24f5d06a1fc39000a06ca9a94@o4506813739368448.ingest.us.sentry.io/4507458386526208", 9 | 10 | // Adjust this value in production, or use tracesSampler for greater control 11 | tracesSampleRate: 1, 12 | 13 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 14 | debug: false, 15 | 16 | // Uncomment the line below to enable Spotlight (https://spotlightjs.com) 17 | // spotlight: process.env.NODE_ENV === 'development', 18 | }); 19 | -------------------------------------------------------------------------------- /sentry.edge.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). 2 | // The config you add here will be used whenever one of the edge features is loaded. 3 | // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. 4 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 5 | 6 | import * as Sentry from "@sentry/nextjs"; 7 | 8 | Sentry.init({ 9 | dsn: "https://3d627de24f5d06a1fc39000a06ca9a94@o4506813739368448.ingest.us.sentry.io/4507458386526208", 10 | 11 | // Adjust this value in production, or use tracesSampler for greater control 12 | tracesSampleRate: 1, 13 | 14 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 15 | debug: false, 16 | }); 17 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as LabelPrimitive from "@radix-ui/react-label"; 4 | import { cva, type VariantProps } from "class-variance-authority"; 5 | import * as React from "react"; 6 | 7 | import { cn } from "@/lib/utils"; 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ); 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )); 24 | Label.displayName = LabelPrimitive.Root.displayName; 25 | 26 | export { Label }; 27 | -------------------------------------------------------------------------------- /components/SubmitButton.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image"; 2 | 3 | import { Button } from "./ui/button"; 4 | 5 | interface ButtonProps { 6 | isLoading: boolean; 7 | className?: string; 8 | children: React.ReactNode; 9 | } 10 | 11 | const SubmitButton = ({ isLoading, className, children }: ButtonProps) => { 12 | return ( 13 | 33 | ); 34 | }; 35 | 36 | export default SubmitButton; 37 | -------------------------------------------------------------------------------- /components/ui/separator.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as SeparatorPrimitive from "@radix-ui/react-separator"; 4 | import * as React from "react"; 5 | 6 | import { cn } from "@/lib/utils"; 7 | 8 | const Separator = React.forwardRef< 9 | React.ElementRef, 10 | React.ComponentPropsWithoutRef 11 | >( 12 | ( 13 | { className, orientation = "horizontal", decorative = true, ...props }, 14 | ref 15 | ) => ( 16 | 27 | ) 28 | ); 29 | Separator.displayName = SeparatorPrimitive.Root.displayName; 30 | 31 | export { Separator }; 32 | -------------------------------------------------------------------------------- /components/StatusBadge.tsx: -------------------------------------------------------------------------------- 1 | import clsx from "clsx"; 2 | import Image from "next/image"; 3 | 4 | import { StatusIcon } from "@/constants"; 5 | 6 | export const StatusBadge = ({ status }: { status: Status }) => { 7 | return ( 8 |
15 | doctor 22 |

29 | {status} 30 |

31 |
32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /public/assets/icons/pending.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /components/StatCard.tsx: -------------------------------------------------------------------------------- 1 | import clsx from "clsx"; 2 | import Image from "next/image"; 3 | 4 | type StatCardProps = { 5 | type: "appointments" | "pending" | "cancelled"; 6 | count: number; 7 | label: string; 8 | icon: string; 9 | }; 10 | 11 | export const StatCard = ({ count = 0, label, icon, type }: StatCardProps) => { 12 | return ( 13 |
20 |
21 | appointments 28 |

{count}

29 |
30 | 31 |

{label}

32 |
33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { cn } from "@/lib/utils"; 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |