A modern React frontend application for uploading files and processing them through a technical specification extraction workflow. Features user authentication, drag-and-drop file upload, and real-time processing results.
- 🔐 User Authentication - Secure login/signup system
- 📁 File Upload - Drag & drop interface supporting PDF, DOC, DOCX, TXT
- ⚡ Real-time Processing - Direct integration with technical specification extraction workflow
- 📊 Results Display - View, copy, and download extracted content
- 🎨 Modern UI - Beautiful, responsive design with Tailwind CSS
- 🔒 Secure - JWT-based authentication with token management
npm install
Create a .env.local
file in the root directory and add your N8N webhook URL:
NEXT_PUBLIC_N8N_WEBHOOK_URL=https://n8n.arrowpipes.site/webhook/b918489b-0898-4b69-a91d-eb7277ab9dca
npm run dev
Open http://localhost:3000 in your browser.
Your N8N workflow should:
- Accept POST requests with multipart/form-data containing a
file
field - Process the uploaded file (extract text, analyze content, etc.)
- Return a response in one of these formats:
- Plain text:
"extracted content here"
- JSON object:
{"message": "extracted content", "status": "success"}
- JSON with text field:
{"text": "extracted content"}
- Plain text:
- Webhook Trigger - Accepts file uploads
- Extract from File - Processes PDF/DOC files
- Message Model - Formats the response
- Respond to Webhook - Returns the result
├── app/
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main page component
├── components/
│ ├── FileUpload.tsx # File upload component
│ ├── LoginForm.tsx # Authentication form
│ ├── Logo.tsx # Company logo component
│ └── ResultDisplay.tsx # Results display component
├── hooks/
│ └── useAuth.tsx # Authentication hook
├── lib/
│ └── api.ts # API client functions
├── public/
│ └── images/ # Static images (logo, background)
└── README.md
The app includes a simple authentication system with predefined credentials:
- Login: Use the provided username and password
- Session Management: Automatic token storage and logout
- Protected Routes: Dashboard requires authentication
Default Credentials:
- Username: admin
- Password: password123
Note: This is a demo implementation with hardcoded credentials. For production, implement proper user management and database storage.
Supports multiple file formats:
- PDF (.pdf)
- Microsoft Word (.doc, .docx)
- Text Files (.txt)
Maximum file size: 10MB
The frontend communicates with your N8N webhook via:
// Send file to N8N webhook
const formData = new FormData()
formData.append('file', file)
const response = await fetch(N8N_WEBHOOK_URL, {
method: 'POST',
body: formData
})
- Built with Tailwind CSS
- Custom components in
app/globals.css
- Responsive design for mobile and desktop
Update the accept
property in components/FileUpload.tsx
:
accept: {
'application/pdf': ['.pdf'],
'your/mime-type': ['.ext']
}
Update the webhook URL in lib/api.ts
or via environment variables.
-
Build the application:
npm run build
-
Set production environment variables:
- Update
NEXT_PUBLIC_N8N_WEBHOOK_URL
to your production technical specification extraction instance - Configure proper CORS settings
- Update
-
Deploy to your preferred hosting platform (Vercel, Netlify, etc.)
- Implement proper user storage (database) for production
- Add rate limiting for file uploads
- Validate file types and sizes server-side
- Use HTTPS in production
- CORS Errors: Ensure your N8N instance allows requests from your frontend domain
- File Upload Fails: Check file size limits and supported formats
- Authentication Issues: Verify login credentials
- Technical Specification Extraction Connection: Confirm webhook URL and workflow instance accessibility
Add console logging to track API calls:
// In lib/api.ts
console.log('Sending request to:', N8N_WEBHOOK_URL)
console.log('Response:', response.data)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this project for your own applications.