├── .eslintrc.json ├── .gitignore ├── README.md ├── bun.lockb ├── next.config.mjs ├── package.json ├── postcss.config.mjs ├── public ├── background.jpg ├── next.svg └── vercel.svg ├── src ├── app │ ├── (booking) │ │ ├── [username] │ │ │ └── [booking-uri] │ │ │ │ ├── [booking-time] │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ └── page.tsx │ │ └── layout.tsx │ ├── (site) │ │ ├── dashboard │ │ │ ├── booked-events │ │ │ │ └── page.tsx │ │ │ ├── event-types │ │ │ │ ├── edit │ │ │ │ │ └── [id] │ │ │ │ │ │ └── page.tsx │ │ │ │ ├── new │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── features │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ └── page.tsx │ ├── api │ │ ├── auth │ │ │ └── route.ts │ │ ├── bookings │ │ │ └── route.ts │ │ ├── busy │ │ │ └── route.ts │ │ ├── event-types │ │ │ └── route.ts │ │ ├── logout │ │ │ └── route.ts │ │ ├── oauth │ │ │ └── exchange │ │ │ │ └── route.ts │ │ └── profile │ │ │ └── route.ts │ ├── components │ │ ├── DashboardNav.tsx │ │ ├── EventTypeDelete.tsx │ │ ├── EventTypeForm.tsx │ │ ├── Header.tsx │ │ ├── Hero.tsx │ │ ├── ProfileForm.tsx │ │ ├── RightNav.tsx │ │ ├── TimePicker.tsx │ │ └── TimeSelect.tsx │ ├── favicon.ico │ └── globals.css ├── libs │ ├── nylas.ts │ ├── session.ts │ ├── shared.ts │ └── types.ts └── models │ ├── Booking.ts │ ├── EventType.ts │ └── Profile.ts ├── tailwind.config.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.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 | .idea 21 | .DS_Store 22 | *.pem 23 | 24 | # debug 25 | npm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # local env files 30 | .env*.local 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 20 | 21 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on Vercel 33 | 34 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 37 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dejwid/calendix/33542b7bacd43c9c522c37161bb4ea41bba98758/bun.lockb -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "calendix", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "axios": "^1.7.2", 13 | "clsx": "^2.1.1", 14 | "date-fns": "^3.6.0", 15 | "lucide": "^0.412.0", 16 | "lucide-react": "^0.412.0", 17 | "mongoose": "^8.5.1", 18 | "next": "14.2.5", 19 | "next-app-session": "^1.0.7", 20 | "nylas": "^7.5.2", 21 | "react": "^18", 22 | "react-dom": "^18", 23 | "react-spinners": "^0.14.1" 24 | }, 25 | "devDependencies": { 26 | "typescript": "^5", 27 | "@types/node": "^20", 28 | "@types/react": "^18", 29 | "@types/react-dom": "^18", 30 | "postcss": "^8", 31 | "tailwindcss": "^3.4.1", 32 | "eslint": "^8", 33 | "eslint-config-next": "14.2.5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dejwid/calendix/33542b7bacd43c9c522c37161bb4ea41bba98758/public/background.jpg -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/(booking)/[username]/[booking-uri]/[booking-time]/page.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | import axios from "axios"; 3 | import {format} from "date-fns"; 4 | import {FormEvent, useState} from "react"; 5 | 6 | type PageProps = { 7 | params: { 8 | username: string; 9 | "booking-uri": string; 10 | "booking-time": string; 11 | }; 12 | }; 13 | export default function BookingFormPage(props:PageProps) { 14 | const [guestName, setGuestName] = useState(''); 15 | const [guestEmail, setGuestEmail] = useState(''); 16 | const [guestNotes, setGuestNotes] = useState(''); 17 | const [confirmed, setConfirmed] = useState(false); 18 | 19 | const username = props.params.username; 20 | const bookingUri = props.params["booking-uri"]; 21 | const bookingTime = new Date(decodeURIComponent(props.params["booking-time"])); 22 | 23 | async function handleFormSubmit(ev:FormEvent) { 24 | ev.preventDefault(); 25 | const data = {guestName, guestEmail, guestNotes, username, bookingUri, bookingTime}; 26 | await axios.post('/api/bookings', data); 27 | setConfirmed(true); 28 | } 29 | 30 | return ( 31 |
32 |

33 | {format(bookingTime, 'EEEE, MMMM d, HH:mm')} 34 |

35 | {confirmed && ( 36 |
Thanks for you booking!
37 | )} 38 | {!confirmed && ( 39 |
40 | 47 | 54 |