A modern, responsive FAQ web application built with Next.js that dynamically fetches questions and answers from GitHub Issues. Perfect for community projects that need an easy-to-maintain FAQ system.
- Dynamic Content: Automatically fetches FAQ data from GitHub Issues
- Real-time Search: Filter questions and answers with instant search
- Responsive Design: Works beautifully on desktop, tablet, and mobile
- Dark Mode Support: Automatic dark/light theme switching
- Accessible UI: Built with accessibility best practices
- Auto-refresh: Updates content every 24 hours automatically
- Error Handling: Graceful error states with retry functionality
The application fetches FAQ data from the stayinginbern GitHub repository, specifically from issues labeled with "faq" and in closed state.
- Framework: Next.js 14 with App Router
- Styling: Tailwind CSS
- Language: JavaScript (ES6+)
- Data Source: GitHub Issues API
- Deployment: Ready for Vercel, Netlify, or any static hosting
- Node.js 18+ installed
- npm or yarn package manager
- Internet connection (for fetching GitHub data)
-
Clone the repository
git clone <your-repo-url> cd faq
-
Install dependencies
npm install # or yarn install -
Start the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
faq/
├── src/
│ └── app/
│ ├── globals.css # Global styles and Tailwind imports
│ ├── layout.js # Root layout component
│ └── page.js # Main FAQ page component
├── eslint.config.mjs # ESLint configuration
├── jsconfig.json # JavaScript configuration
├── next.config.mjs # Next.js configuration
├── package.json # Dependencies and scripts
├── postcss.config.mjs # PostCSS configuration
└── README.md # This file
- Fetch: Application calls GitHub Issues API on page load
- Transform: Converts GitHub issues into FAQ format
- Display: Renders questions in collapsible accordion format
- Search: Filters content based on user input in real-time
- Refresh: Automatically updates every 24 hours
The app fetches data from:
https://api.github.com/repos/chagai95/stayinginbern/issues?labels=faq&state=closed
Issue Format Expected:
- Title: Becomes the FAQ question
- Body: Becomes the FAQ answer
- Labels: Must include "faq"
- State: Must be "closed"
Renders individual FAQ questions with expand/collapse functionality.
- Real-time filtering of questions and answers
- Case-insensitive search
- Search result counter
- Clear search button
const [openItems, setOpenItems] = useState({}); // Track open/closed FAQ items
const [faqData, setFaqData] = useState([]); // Store FAQ data
const [loading, setLoading] = useState(true); // Loading state
const [error, setError] = useState(null); // Error handling
const [searchTerm, setSearchTerm] = useState(''); // Search inputTo use a different GitHub repository, update the API URL in page.js:
const res = await fetch("https://api.github.com/repos/YOUR_USERNAME/YOUR_REPO/issues?labels=faq&state=closed");All styles use Tailwind CSS classes. Key areas to customize:
- Colors: Update the blue theme (
bg-blue-600,text-blue-600) - Spacing: Modify padding and margins (
py-12,px-4) - Typography: Change font sizes (
text-4xl,text-xl)
Edit the contact section in page.js:
<a href="https://wa.me/YOUR_PHONE_NUMBER">
<a href="https://your-website.com">npm run build
npx vercel --prodnpm run build
# Upload the .next/out folder to Netlifynpm run build
npm run exportnpm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
No environment variables required! The app uses public GitHub API endpoints.
- Mobile: Single column layout, touch-friendly buttons
- Tablet: Optimized spacing and typography
- Desktop: Full-width layout with hover effects
- Keyboard navigation support
- Screen reader friendly
- High contrast ratios
- Focus indicators
- Automatic code splitting (Next.js)
- Optimized bundle size
- Fast page loads
- Efficient re-renders
FAQ not loading?
- Check internet connection
- Verify GitHub repository is public
- Ensure issues have "faq" label and are closed
Search not working?
- Clear browser cache
- Check console for JavaScript errors
Styling issues?
- Ensure Tailwind CSS is properly installed
- Check for conflicting CSS
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Community: Join our WhatsApp group
- Website: stayinginbern.ch
- Issues: Create a GitHub issue for bugs or feature requests
- Built for the "Staying in Bern" community project
- Inspired by modern FAQ design patterns
- Thanks to the open-source community for the tools and libraries
Made with ❤️ for the Staying in Bern community