A full-stack web application that allows users to search GitHub repositories, stores results in MongoDB, and provides a dashboard to view search history and statistics.
- GitHub API Integration: Search for repositories using GitHub's public API
- Real-time Search: Instant search results with pagination support
- Data Persistence: Automatically stores all search results in MongoDB
- Modern UI/UX: Clean, responsive design built with React and Tailwind CSS
- Dashboard: View search history, statistics, and stored results
- Error Handling: Comprehensive error handling for API failures
- Rate Limiting: Built-in rate limiting and API error handling
- Responsive Design: Works perfectly on desktop and mobile devices
- Node.js with Express.js
- MongoDB with Mongoose ODM
- Axios for HTTP requests
- Helmet for security headers
- CORS for cross-origin requests
- Rate limiting for API protection
- React 18 with modern hooks
- React Router for navigation
- Tailwind CSS for styling
- Lucide React for icons
- Axios for API communication
- Context API for state management
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd api-driven-mini-app
-
Install dependencies for all packages
npm run install-all
-
Set up environment variables Create a
.envfile in theserverdirectory:PORT=5000 NODE_ENV=development MONGODB_URI=mongodb://localhost:27017/api-mini-app CLIENT_URL=http://localhost:3000
-
Start MongoDB Make sure MongoDB is running on your system or update the
MONGODB_URIto point to your MongoDB instance.
Run both frontend and backend simultaneously:
npm run devThis will start:
- Backend server on
http://localhost:5000 - Frontend React app on
http://localhost:3000
Run only the backend:
npm run server or npm startRun only the frontend:
npm run client or npm start-
Search Page (
/)- Enter keywords to search for GitHub repositories
- Use advanced options for customizing search parameters
- View real-time search results
- Results are automatically stored in the database
-
Dashboard (
/dashboard)- View all stored search results
- Filter results by keyword
- Sort by different criteria
- View application statistics
- Pagination for large result sets
POST /api/search/github- Search GitHub repositoriesGET /api/search/history/:keyword- Get search history for a keyword
GET /api/results- Get all stored results with paginationGET /api/results/:id- Get specific search resultGET /api/results/recent/searches- Get recent searchesGET /api/results/stats/overview- Get application statistics
GET /api/health- Server health status
├── client/ # React frontend
│ ├── public/ # Static files
│ ├── src/ # Source code
│ │ ├── components/ # Reusable components
│ │ ├── contexts/ # React contexts
│ │ ├── pages/ # Page components
│ │ └── App.js # Main app component
│ ├── package.json # Frontend dependencies
│ └── tailwind.config.js # Tailwind configuration
├── server/ # Node.js backend
│ ├── models/ # MongoDB models
│ ├── routes/ # API routes
│ ├── index.js # Server entry point
│ └── package.json # Backend dependencies
├── package.json # Root package.json
└── README.md # This file