A modern, full-stack web application for creating, managing, and analyzing custom feedback forms with real-time analytics and response management.
- Dynamic Form Builder: Create forms with multiple question types (short answer, paragraph, multiple choice, checkboxes, dropdown, file upload)
- Real-time Form Editor: Live preview and editing capabilities
- Form Templates: Quick start with pre-built templates
- Form Settings: Control response collection, confirmation messages, and access permissions
- Response Analytics: Real-time visualization of form responses
- Data Export: Export responses in multiple formats
- Response Management: View, filter, and manage individual responses
- Form Performance: Track completion rates and engagement metrics
- Secure Authentication: JWT-based authentication with HTTP-only cookies
- User Management: Registration, login, and profile management
- Protected Routes: Role-based access control
- Data Privacy: Secure data handling and storage
- Responsive Design: Mobile-first approach with TailwindCSS
- Intuitive Interface: Clean, modern UI with smooth interactions
- Real-time Updates: Live form preview and instant feedback
- Loading States: Comprehensive loading and error handling
βββββββββββββββββββ HTTP/HTTPS βββββββββββββββββββ
β ββββββββββββββββββββΊβ β
β Frontend β β Backend β
β (React SPA) β β (Node.js) β
β β β β
βββββββββββββββββββ βββββββββββββββββββ
β β
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Browser β β MongoDB β
β Storage β β Database β
β β β β
βββββββββββββββββββ βββββββββββββββββββ
- React 18.2.0 - Modern UI library with hooks
- React Router DOM - Client-side routing
- Axios - HTTP client with interceptors
- TailwindCSS - Utility-first CSS framework
- Vite - Fast build tool and development server
- React Hook Form - Efficient form handling
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing
- Multer - File upload handling
- Cloudinary - Cloud image storage
- ESLint - Code linting and formatting
- Prettier - Code formatting
- Nodemon - Development server auto-restart
- CORS - Cross-origin resource sharing
feedback/
βββ Backend/ # Server-side application
β βββ controllers/ # Route controllers
β β βββ user.controller.js
β β βββ form.controller.js
β β βββ store.controller.js
β βββ models/ # Database models
β β βββ user.model.js
β β βββ form.model.js
β β βββ store.model.js
β βββ routes/ # API routes
β β βββ user.route.js
β β βββ form.routes.js
β β βββ store.route.js
β βββ middleware/ # Custom middleware
β β βββ auth.middleware.js
β β βββ multer.middleware.js
β βββ utils/ # Utility functions
β β βββ ApiError.js
β β βββ ApiResponse.js
β β βββ asyncHandler.js
β βββ uploads/ # File upload directory
β βββ .env # Environment variables
β βββ app.js # Express app configuration
β βββ server.js # Server entry point
β βββ package.json
β
βββ Frontend/ # Client-side application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ Context/ # React Context providers
β β βββ utils/ # Utility functions
β β β βββ api.js # Centralized API management
β β βββ assets/ # Static assets
β β βββ App.jsx # Main application component
β β βββ main.jsx # Application entry point
β βββ public/ # Static public files
β βββ .env # Environment variables
β βββ index.html # HTML entry point
β βββ package.json
β βββ tailwind.config.js # TailwindCSS configuration
β βββ vite.config.js # Vite configuration
β
βββ README.md # Project documentation
- Node.js (v16 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/anuj308/feedback.git cd feedback/Backend -
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the Backend directory:# Database Configuration MONGODB_URI=mongodb://localhost:27017/feedback-app DB_NAME=feedback # Server Configuration PORT=9000 # CORS Configuration CORS_ORIGIN=http://localhost:5173 # JWT Configuration ACCESS_TOKEN_SECRET=your-super-secret-jwt-key-here ACCESS_TOKEN_EXPIRY=1d REFRESH_TOKEN_SECRET=your-refresh-token-secret-here REFRESH_TOKEN_EXPIRY=10d # Cloudinary Configuration (Optional) CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-api-key CLOUDINARY_API_SECRET=your-api-secret # Environment NODE_ENV=development
-
Start the backend server
# Development mode npm run dev # Production mode npm start
The backend server will start on
http://localhost:9000
-
Navigate to frontend directory
cd ../Frontend -
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the Frontend directory:# API Configuration VITE_API_BASE_URL=/api/v1 VITE_BACKEND_URL=http://localhost:9000 # Environment VITE_NODE_ENV=development # Debug flags VITE_DEBUG_API=true VITE_DEBUG_COMPONENTS=false # App configuration VITE_APP_NAME=Feedback Form Builder VITE_APP_VERSION=1.0.0
-
Start the frontend development server
npm run dev
The frontend application will start on
http://localhost:5173
- Access the application at
http://localhost:5173 - Create an account or login with existing credentials
- Create your first form using the intuitive form builder
- Share your form with respondents
- Analyze responses using the built-in analytics dashboard
POST /api/v1/user/register- User registrationPOST /api/v1/user/login- User loginPOST /api/v1/user/logout- User logoutGET /api/v1/user/current-user- Get current user
POST /api/v1/form/create- Create new formGET /api/v1/form/f/:id- Get form by IDPATCH /api/v1/form/f/:id- Update formDELETE /api/v1/form/f/:id- Delete formGET /api/v1/form/o/:ownerId- Get forms by owner
POST /api/v1/store- Submit form responseGET /api/v1/store/f/:formId- Get responses for formGET /api/v1/form/analytics/:id- Get form analytics
# Backend tests
cd Backend
npm test
# Frontend tests
cd Frontend
npm test- Test user registration and login
- Create and edit forms with different question types
- Submit responses and verify data persistence
- Test responsive design on different devices
- Verify authentication and authorization flows
sequenceDiagram
participant Client
participant Server
participant Database
Client->>Server: POST /user/login
Server->>Database: Verify credentials
Database-->>Server: User data
Server-->>Client: JWT token (HTTP-only cookie)
Client->>Server: Protected route request
Server->>Server: Verify JWT token
Server-->>Client: Protected resource
sequenceDiagram
participant User
participant Frontend
participant Backend
participant Database
User->>Frontend: Create form
Frontend->>Backend: POST /form/create
Backend->>Database: Save form
Database-->>Backend: Form ID
Backend-->>Frontend: Form created
Frontend-->>User: Redirect to form editor
- Hot Reload: Enabled for both frontend and backend
- CORS: Configured for local development
- Proxy: Vite proxy setup for API calls
- Environment Variables: Separate configs for dev/prod
- Build Optimization: Minified and optimized builds
- Security Headers: Implemented security best practices
- Error Handling: Comprehensive error logging
- Performance: Optimized for production deployment
# Build for production
npm run build
# Preview production build
npm run preview# Set environment variables
# Deploy using platform-specific commands- Create MongoDB Atlas cluster
- Update connection string in environment variables
- Configure network access and user permissions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow ESLint configuration
- Use Prettier for code formatting
- Write meaningful commit messages
- Add tests for new features
This project is licensed under the ISC License - see the LICENSE file for details.
- Anuj Kumar Sharma - Initial work - anuj308
- React team for the amazing framework
- Express.js community for the robust backend framework
- MongoDB team for the flexible database solution
- TailwindCSS for the utility-first CSS framework
For support, email anujkumarsharma2023@gmail.com or create an issue in the GitHub repository.
- Initial release with core functionality
- User authentication and authorization
- Form creation and management
- Response collection and analytics
- Responsive design implementation
Made with β€οΈ by Anuj Kumar Sharma