diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..b874506 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +NEXT_PUBLIC_API_BASE_URL= +NEXT_PUBLIC_ENABLE_FORM_COLLAB="true" +NEXT_PUBLIC_GOOGLE_CLIENT_ID= +PORT="3000" \ No newline at end of file diff --git a/README.md b/README.md index e215bc4..054b4e8 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,110 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# Formsify Frontend (`fe-formsify`) -## Getting Started +Frontend Formsify menggunakan Next.js (App Router) dan terhubung ke backend `be-formsify`. -First, run the development server: +## Repository Links + +- Frontend repo: https://github.com/Cyaside/fe-formsify +- Backend repo: https://github.com/Cyaside/be-formsify + +## Tech Stack + +- Next.js 16 (App Router) +- React 19 +- TypeScript 5 +- Tailwind CSS 4 +- TanStack React Query (server state/data fetching) +- Zustand (client state) +- DnD Kit (`@dnd-kit/core`, `@dnd-kit/sortable`) untuk drag-drop builder +- Socket.IO Client untuk realtime collaboration +- Recharts untuk analytics chart +- Framer Motion untuk animation/interactions + +## Prasyarat + +- Node.js 20+ +- npm +- Backend sudah berjalan (default `http://localhost:4000`) + +## Environment Variables + +Buat file `fe-formsify/.env.local`: atau bisa lihat di .env.example + +```env +NEXT_PUBLIC_API_BASE_URL=http://localhost:4000 +NEXT_PUBLIC_GOOGLE_CLIENT_ID= +NEXT_PUBLIC_ENABLE_FORM_COLLAB=false +``` + +Keterangan: + +- `NEXT_PUBLIC_API_BASE_URL`: base URL backend API. +- `NEXT_PUBLIC_GOOGLE_CLIENT_ID`: isi jika Google Sign-In dipakai. +- `NEXT_PUBLIC_ENABLE_FORM_COLLAB`: aktifkan fitur collab realtime di UI. + +## Instalasi dan Menjalankan ```bash +cd fe-formsify +npm install npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +Frontend default di `http://localhost:3000`. + +## Build dan Lint + +```bash +npm run lint +npm run build +``` + +## Menjalankan di Production + +```bash +npm run build +npm run start +``` + +`start` menggunakan `PORT` environment variable. Jika tidak diisi, gunakan port sesuai runtime platform. + +## Catatan Integrasi Backend + +- Pastikan `NEXT_PUBLIC_API_BASE_URL` mengarah ke backend yang benar. +- Pastikan backend mengizinkan origin frontend pada `CORS_ORIGIN`. +- Jika collab diaktifkan, backend juga harus set `ENABLE_FORM_COLLAB=true`. + +## Notes Tambahan : + +- Terkadang saat proses membuat form, ada bug kecil di mana perubahan terlihat revert (contoh: klik **Add question**, lalu pertanyaan sempat hilang dan perlu klik lagi) Ini biasanya masalah koneksi. +- Autosave menggunakan on-change namun Socket.IO tetap mengaktifkan **polling fallback transport** (kalau websocket gagal karena proxy atau network) untuk ningkatin stabilitas koneksi di deployment (khususnya di belakang proxy/load balancer), karena pure WebSocket kadang menyebabkan sync tidak stabil. + +## Demo Video + +### Login & Register + +![Login & Register Demo](./readme/loginregister.gif) + +### Dashboard + +![Dashboard Demo](./readme/dashboard.gif) + +### Form Builder 1 -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +![Form Builder 1 Demo](./readme/form.gif) -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +### Form Builder 2 -## Learn More +![Form Builder 2 Demo](./readme/form2.gif) -To learn more about Next.js, take a look at the following resources: +### Fill Form -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +![Fill Form Demo](./readme/fill.gif) -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +### Responses -## Deploy on Vercel +![Responses Demo](./readme/response.gif) -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. +### Collaboration -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +![Collaboration Demo](./readme/collab.gif) diff --git a/components.json b/components.json new file mode 100644 index 0000000..ee95561 --- /dev/null +++ b/components.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "rtl": false, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "registries": { + "@react-bits": "https://reactbits.dev/r/{name}.json" + } +} diff --git a/package-lock.json b/package-lock.json index 508b4e8..5937954 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "framer-motion": "^12.34.2", + "gsap": "^3.14.2", "lucide-react": "^0.575.0", "next": "16.1.6", "react": "19.2.3", @@ -1988,13 +1989,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -2059,9 +2060,9 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz", - "integrity": "sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -4224,6 +4225,12 @@ "dev": true, "license": "ISC" }, + "node_modules/gsap": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/gsap/-/gsap-3.14.2.tgz", + "integrity": "sha512-P8/mMxVLU7o4+55+1TCnQrPmgjPKnwkzkXOK1asnR9Jg2lna4tEY5qBJjMmAaOBDDZWtlRjBXjLa0w53G/uBLA==", + "license": "Standard 'no charge' license: https://gsap.com/standard-license." + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -5351,9 +5358,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 08d3cbc..c4e6328 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "framer-motion": "^12.34.2", + "gsap": "^3.14.2", "lucide-react": "^0.575.0", "next": "16.1.6", "react": "19.2.3", diff --git a/readme/collab.gif b/readme/collab.gif new file mode 100644 index 0000000..ede9daf Binary files /dev/null and b/readme/collab.gif differ diff --git a/readme/dashboard.gif b/readme/dashboard.gif new file mode 100644 index 0000000..b8d58c7 Binary files /dev/null and b/readme/dashboard.gif differ diff --git a/readme/fill.gif b/readme/fill.gif new file mode 100644 index 0000000..bf2e6e4 Binary files /dev/null and b/readme/fill.gif differ diff --git a/readme/form.gif b/readme/form.gif new file mode 100644 index 0000000..e860165 Binary files /dev/null and b/readme/form.gif differ diff --git a/readme/form2.gif b/readme/form2.gif new file mode 100644 index 0000000..ec585f9 Binary files /dev/null and b/readme/form2.gif differ diff --git a/readme/loginregister.gif b/readme/loginregister.gif new file mode 100644 index 0000000..bb9d45f Binary files /dev/null and b/readme/loginregister.gif differ diff --git a/readme/response.gif b/readme/response.gif new file mode 100644 index 0000000..72fc307 Binary files /dev/null and b/readme/response.gif differ diff --git a/src/app/globals.css b/src/app/globals.css index cc104cf..8f7a6b1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -48,6 +48,10 @@ --motion-fast: 150ms; --motion-medium: 250ms; --motion-slow: 400ms; + --landing-bg-tint: rgba(0, 0, 0, 0.18); + --scrollbar-track: #121216; + --scrollbar-thumb: #4c1d95; + --scrollbar-thumb-hover: #6d28d9; } .light { @@ -96,6 +100,10 @@ --motion-fast: 150ms; --motion-medium: 250ms; --motion-slow: 400ms; + --landing-bg-tint: rgba(255, 255, 255, 0); + --scrollbar-track: #eef2f7; + --scrollbar-thumb: #a78bfa; + --scrollbar-thumb-hover: #8b5cf6; } @theme inline { @@ -152,6 +160,47 @@ body { transition: background 0.2s ease, color 0.2s ease; } +html, +body { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); +} + +*::-webkit-scrollbar { + width: 11px; + height: 11px; +} + +*::-webkit-scrollbar-button { + display: none; + width: 0; + height: 0; +} + +*::-webkit-scrollbar-track { + background: var(--scrollbar-track); + border-radius: 999px; +} + +*::-webkit-scrollbar-thumb { + background: linear-gradient(180deg, var(--scrollbar-thumb), var(--scrollbar-thumb-hover)); + border: 2px solid var(--scrollbar-track); + border-radius: 999px; +} + +*::-webkit-scrollbar-thumb:hover { + background: var(--scrollbar-thumb-hover); +} + +*::-webkit-scrollbar-corner { + background: var(--scrollbar-track); +} + .marquee-mask { mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%); diff --git a/src/app/page.tsx b/src/app/page.tsx index 11ca663..d957147 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,19 +1,23 @@ import AboutSection from "@/widgets/landing/AboutSection"; import ContactSection from "@/widgets/landing/ContactSection"; import HeroSection from "@/widgets/landing/HeroSection"; +import LandingBackground from "@/widgets/landing/LandingBackground"; import StepsSection from "@/widgets/landing/StepsSection"; import TestimonialsSection from "@/widgets/landing/TestimonialsSection"; import Footer from "@/shared/ui/Footer"; export default function Home() { return ( -
- - - - - -