
ReactDaisyUIDocxtemplaterPizzipFileSaverDay.js
Invitation Generator
A web application for generating Microsoft Word (.docx) invitation letters for university events, configured for Technological University Taunggyi (TUT).
Features
- Department templates: Configured for all majors and departments across the university.
- Form-driven generation: Input event type, recipient/professor, department, academic year, date, time, and venue.
- Batch recipient management: Group and member lists for bulk invitations, including drag-and-drop reordering.
- Input validation: Schema validation via Zod before document compilation.
- Local persistence: Form state automatically saves to
localStorageto prevent data loss. - Docx exports: Client-side generation and direct download of completed
.docxfiles. - Template downloads: Route to grab blank
.docxtemplates by department for manual editing.
Tech Stack
- Framework: React, Vite, TypeScript
- Styling: Tailwind CSS, DaisyUI, Lucide React
- Forms & Validation: React Hook Form, Zod
- Document Processing: Docxtemplater, Pizzip, FileSaver
- Utilities: Day.js, dnd-kit, Sonner
Getting Started
Prerequisites
- Node.js (v18 or higher recommended)
pnpm(install vianpm install -g pnpmif needed)
Installation
git clone https://github.com/nainghtetlinn/invitation-generator.git
cd invitation-generator
pnpm installDevelopment
pnpm devThe app will be available at http://localhost:5173.
Build
pnpm buildHow It Works
- Fill in event details: Select the department and add event metadata (date, time, venue, academic year).
- Add recipients: Group recipients (e.g., by class or committee) and add individual members. Reorder rows with drag-and-drop as needed.
- Generate: Click Generate to compile the data into the template and download the final
.docxfile. - Blank templates: Visit
/downloadto fetch raw.docxtemplates for individual departments.
Project Structure
invitation-generator/
├── public/
│ └── template.docx
├── src/
│ ├── components/
│ │ ├── footer.tsx
│ │ ├── form-fields.tsx
│ │ ├── group-dialog.tsx
│ │ ├── groups-table.tsx
│ │ ├── header.tsx
│ │ ├── member-dialog.tsx
│ │ ├── members-table.tsx
│ │ ├── toast.tsx
│ │ └── warning-dialog.tsx
│ ├── lib/
│ │ ├── constants.ts
│ │ ├── dto.ts
│ │ ├── schema.ts
│ │ └── utils.ts
│ ├── App.tsx
│ ├── Download.tsx
│ ├── Layout.tsx
│ ├── index.css
│ └── index.tsx
├── package.json
└── vite.config.ts
Contributing
- Fork the repo and create a branch (
git checkout -b feature/my-feature). - Commit your changes (
git commit -m 'Add my feature'). - Push to your branch (
git push origin feature/my-feature). - Open a Pull Request.
License
MIT