├── app ├── api │ ├── lib │ │ ├── email │ │ │ └── index.ts │ │ ├── validation │ │ │ ├── index.ts │ │ │ └── errors.ts │ │ ├── jwt │ │ │ ├── errors.ts │ │ │ └── index.ts │ │ ├── error │ │ │ ├── details.js │ │ │ └── index.ts │ │ ├── request │ │ │ └── index.ts │ │ ├── auth │ │ │ ├── errors.ts │ │ │ └── index.ts │ │ └── nlp │ │ │ └── index.js │ ├── auth │ │ ├── docs │ │ │ ├── login.auth.architecture.excalidraw.png │ │ │ ├── token.auth.architecture.excalidraw.png │ │ │ └── request.auth.architecture.excalidraw.png │ │ ├── login │ │ │ ├── schema.ts │ │ │ └── route.ts │ │ ├── register │ │ │ ├── schema.ts │ │ │ └── route.ts │ │ ├── logout │ │ │ └── route.ts │ │ └── token │ │ │ └── route.ts │ └── tasks │ │ └── route.ts ├── favicon.ico ├── components │ ├── Tasks │ │ ├── index.ts │ │ ├── Calender.tsx │ │ ├── List.tsx │ │ ├── Timer.tsx │ │ ├── Form.tsx │ │ └── Item.tsx │ ├── Layout │ │ ├── Main.tsx │ │ ├── index.ts │ │ ├── LandingRoot.tsx │ │ ├── SideNav.tsx │ │ ├── DashboardRoot.tsx │ │ ├── Header.tsx │ │ ├── LandingRootWithMobileNav.tsx │ │ ├── DashboardRootWithMobileNav.tsx │ │ └── SideDrawer.tsx │ ├── search.tsx │ ├── FormDrawer.tsx │ ├── Navigation.tsx │ ├── theme.tsx │ ├── form.tsx │ └── Header.tsx ├── layout.tsx ├── lib │ ├── schemas.ts │ └── time.ts ├── legacy_tasks │ ├── layout.tsx │ └── page.tsx ├── globals.css ├── login │ └── page.tsx ├── register │ └── page.tsx └── page.tsx ├── .eslintrc.json ├── public ├── bg.jpg ├── logo.png ├── landing.png ├── landing-time.jpeg ├── landing-happy.jpeg ├── landing-study.jpeg ├── vercel.svg └── next.svg ├── next.config.mjs ├── docs ├── architecture.excalidraw.png └── tasks-mockup.excalidraw.png ├── prisma ├── migrations │ ├── migration_lock.toml │ └── 20250127003108_init │ │ └── migration.sql ├── extensions │ ├── exists.ts │ └── password.ts ├── _schema.prisma ├── schema.prisma └── scripts │ └── generateFixtures.ts ├── postcss.config.mjs ├── lib ├── utils.ts └── auth.ts ├── components.json ├── .gitignore ├── tsconfig.json ├── components └── ui │ ├── label.tsx │ ├── textarea.tsx │ ├── progress.tsx │ ├── input.tsx │ ├── toaster.tsx │ ├── checkbox.tsx │ ├── switch.tsx │ ├── badge.tsx │ ├── popover.tsx │ ├── radio-group.tsx │ ├── scroll-area.tsx │ ├── tabs.tsx │ ├── card.tsx │ ├── button.tsx │ ├── calendar.tsx │ ├── dialog.tsx │ ├── form.tsx │ ├── toast.tsx │ ├── select.tsx │ └── dropdown-menu.tsx ├── middleware.ts ├── hooks ├── use-timer.ts └── use-toast.ts ├── package.json ├── tailwind.config.ts └── README.md /app/api/lib/email/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /public/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/bg.jpg -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/app/favicon.ico -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/logo.png -------------------------------------------------------------------------------- /public/landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/landing.png -------------------------------------------------------------------------------- /public/landing-time.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/landing-time.jpeg -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /public/landing-happy.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/landing-happy.jpeg -------------------------------------------------------------------------------- /public/landing-study.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/public/landing-study.jpeg -------------------------------------------------------------------------------- /docs/architecture.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/docs/architecture.excalidraw.png -------------------------------------------------------------------------------- /docs/tasks-mockup.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/docs/tasks-mockup.excalidraw.png -------------------------------------------------------------------------------- /prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" -------------------------------------------------------------------------------- /app/api/auth/docs/login.auth.architecture.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/app/api/auth/docs/login.auth.architecture.excalidraw.png -------------------------------------------------------------------------------- /app/api/auth/docs/token.auth.architecture.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/app/api/auth/docs/token.auth.architecture.excalidraw.png -------------------------------------------------------------------------------- /app/api/auth/docs/request.auth.architecture.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdallah-sameh-ragab/adhd-mindflow/main/app/api/auth/docs/request.auth.architecture.excalidraw.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 | -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /app/components/Tasks/index.ts: -------------------------------------------------------------------------------- 1 | import Form from "./Form"; 2 | import * as Task from "./Item"; 3 | import Calender from "./Calender"; 4 | import List from "./List"; 5 | import * as Timer from "./Timer"; 6 | export default { Form, ...Task, Calender, List, ...Timer }; -------------------------------------------------------------------------------- /app/api/auth/login/schema.ts: -------------------------------------------------------------------------------- 1 | import { z } from "zod"; 2 | 3 | export const schema = z.object({ 4 | email: z.string().email('Invalid email address').min(6, 'Email must be at least 6 characters long'), 5 | password: z.string().min(6, 'Password must be at least 6 characters long') 6 | }); 7 | 8 | export type type = z.infer; 9 | -------------------------------------------------------------------------------- /app/components/Layout/Main.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from "@mui/joy"; 2 | 3 | export default function Main(props: BoxProps) { 4 | return ( 5 | 11 | ); 12 | } -------------------------------------------------------------------------------- /app/api/auth/register/schema.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod'; 2 | 3 | export const schema = z.object({ 4 | email: z.string().email('Invalid email address').min(6, 'Email must be at least 6 characters long'), 5 | password: z.string().min(6, 'Password must be at least 6 characters long'), 6 | name: z.string().min(2, 'Name must be at least 2 characters long') 7 | }); 8 | 9 | export type type = z.infer; -------------------------------------------------------------------------------- /app/components/Tasks/Calender.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | import { DateCalendar } from '@mui/x-date-pickers' 3 | import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; 4 | import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; 5 | 6 | export default function Calender() { 7 | return ( 8 | 9 | 10 | 11 | ); 12 | } -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | } 20 | } -------------------------------------------------------------------------------- /app/api/lib/validation/index.ts: -------------------------------------------------------------------------------- 1 | import { SafeParseReturnType } from "zod" 2 | 3 | export const parseValidationIssues = (validation:SafeParseReturnType) => { 4 | const issues: { [key: string]: string[] } = {} 5 | validation.error?.issues.forEach(issue => { 6 | const field = issue.path[0] 7 | const message = issue.message 8 | 9 | if (issues[field]) { 10 | issues[field].push(message) 11 | } else { 12 | issues[field] = [message] 13 | } 14 | }) 15 | return issues 16 | } -------------------------------------------------------------------------------- /app/components/Layout/index.ts: -------------------------------------------------------------------------------- 1 | import Main from "./Main"; 2 | import Header from "./Header"; 3 | import DashboardRoot from "./DashboardRoot"; 4 | import DashboardRootWithMobileNav from "./DashboardRootWithMobileNav"; 5 | import SideDrawer from "./SideDrawer"; 6 | import SideNav from "./SideNav"; 7 | import LandingRootWithMobileNav from "./LandingRootWithMobileNav"; 8 | 9 | export default { 10 | Main, 11 | Header, 12 | DashboardRoot, 13 | DashboardRootWithMobileNav, 14 | LandingRootWithMobileNav, 15 | SideDrawer, 16 | SideNav 17 | } -------------------------------------------------------------------------------- /app/components/Layout/LandingRoot.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from "@mui/joy"; 2 | 3 | export default function LandingRoot(props: BoxProps) { 4 | return ( 5 | 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 | .vscode/* 38 | .env* 39 | .todo 40 | .*/ -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/api/lib/validation/errors.ts: -------------------------------------------------------------------------------- 1 | import { ApiException } from "../error"; 2 | 3 | /** 4 | * Represents an error that occurs when the request format is invalid. 5 | * @extends ApiException 6 | */ 7 | export class RequestError extends ApiException { 8 | message: string = 'Invalid request format'; 9 | code: string = this.code + '.request'; 10 | } 11 | 12 | /** 13 | * Represents an error that occurs when the request body is not valid JSON. 14 | * @extends RequestError 15 | */ 16 | export class InvalidJsonError extends RequestError { 17 | message: string = "the request body is not valid JSON"; 18 | code: string = this.code + '.json'; 19 | } -------------------------------------------------------------------------------- /app/components/Layout/SideNav.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from "@mui/joy"; 2 | 3 | export default function SideNav(props: BoxProps) { 4 | return ( 5 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/components/Layout/DashboardRoot.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from "@mui/joy"; 2 | 3 | export default function DashboardRoot(props: BoxProps) { 4 | return ( 5 | 22 | ); 23 | } -------------------------------------------------------------------------------- /app/components/search.tsx: -------------------------------------------------------------------------------- 1 | import { Input, IconButton, Typography } from '@mui/joy'; 2 | import { SearchRounded } from '@mui/icons-material'; 3 | export function Search() { 4 | return } 9 | endDecorator={ 13 | 14 | Enter 15 | 16 | } 17 | sx={{ 18 | alignSelf: 'center', 19 | display: { 20 | // xs: 'none', 21 | sm: 'flex', 22 | }, 23 | }} />; 24 | } -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import "./globals.css"; 3 | import { ThemeProvider } from "./components/theme"; 4 | import Layout from "./components/Layout"; 5 | import react from 'react' 6 | import Navigation from "./components/Navigation"; 7 | import Header from "./components/Header"; 8 | 9 | export const metadata: Metadata = { 10 | title: "Create Next App", 11 | description: "Generated by create next app", 12 | }; 13 | 14 | export default function RootLayout({ 15 | children, 16 | }: Readonly<{ 17 | children: React.ReactNode; 18 | }>) { 19 | 20 | return ( 21 | 22 | 23 | 24 | {children} 25 | 26 | 27 | 28 | ); 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/api/lib/jwt/errors.ts: -------------------------------------------------------------------------------- 1 | import { ApiException } from "../error"; 2 | 3 | export class TokenError extends ApiException { 4 | message: string = 'Something went wrong with your token'; 5 | code: string = this.code + '.token'; 6 | statusCode: number = 401; 7 | } 8 | 9 | // api.auth.token.invalid 10 | export class InvalidTokenError extends TokenError { 11 | message: string = 'Invalid token'; 12 | code: string = this.code + '.invalid'; 13 | } 14 | 15 | // api.auth.token.expired 16 | export class ExpiredTokenError extends TokenError { 17 | message: string = 'Token has expired'; 18 | code: string = this.code + '.expired'; 19 | } 20 | 21 | // api.auth.token.missing 22 | export class MissingTokenError extends TokenError { 23 | message: string = 'Token is missing'; 24 | code: string = this.code + '.missing'; 25 | } -------------------------------------------------------------------------------- /app/api/lib/error/details.js: -------------------------------------------------------------------------------- 1 | export default { 2 | auth: { 3 | GenericError: { 4 | message: "An error occurred while authenticating the request", 5 | code: "100" 6 | }, 7 | InvalidToken: { 8 | message: "Invalid token provided", 9 | code: "101" 10 | }, 11 | ExpiredToken: { 12 | message: "Provided token has expired", 13 | code: "102" 14 | }, 15 | MissingToken: { 16 | message: "No token provided", 17 | code: "103" 18 | }, 19 | Unauthorized: { 20 | message: "Unauthorized usage of token", 21 | code: "104" 22 | }, 23 | UserDoesNotExist: { 24 | message: "User does not exist", 25 | code: "105" 26 | }, 27 | } 28 | } -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 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/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 |