This is a full-stack application that allows users to generate, fetch, and clear book APIs dynamically. The backend is built with Node.js and Express.js, while the frontend uses React and Axios to interact with the API.
- Generate API: Creates a list of books with randomly generated titles and author names.
- Fetch Data: Fetches the list of books generated by the API.
- Clear API: Clears the existing list of books from the API.
- Dark Mode: Toggle between light and dark mode.
- Frontend: React, Axios, Tailwind CSS
- Backend: Node.js, Express.js
- Database: JSON File (for simplicity)
- Hosting: Frontend (Vercel), Backend (Render)
-
Clone the repository:
git clone https://github.com/kakotyanimesh/apiG.git
Here's the README in Markdown (.md
) format:
-
Navigate to the project directory:
cd apiG
-
Install dependencies for both frontend and backend:
# Backend dependencies npm install # Frontend dependencies (navigate to the frontend folder) cd frontend npm install
-
Run the backend server:
npm start
The backend will run at
http://localhost:3000
. -
Run the frontend:
cd frontend npm run dev
The frontend will run at
http://localhost:5173
.
GET /books
- Response: List of all generated books.
POST /generateApi
- Response: Creates 30 new books with random titles and authors.
DELETE /delete
- Response: Clears all existing books.
- Generate API: Click on the "Generate API" button to create a new list of books.
- Fetch Data: Click on the "Get Data" button to fetch the list of books.
- Clear API: Click on the "Clear API" button to remove all books from the API.
- Dark Mode: Toggle the sun/moon icon to switch between light and dark themes.
- Frontend: Live Demo
- Backend: API Endpoint
This project is open-source and available under the MIT License.