Piattaforma educativa inclusiva per scuole primarie con ricerca di libri, griglia di risultati e supporto all'apprendimento interattivo.

A modern, responsive web application for searching and exploring books by category using the Open Library API.

_.get()git clone https://github.com/simonecamerano/owly.git
cd owly
npm install
cp .env.example .env
Configure environment variables (see Environment Variables)
Start development server
npm start
The application will open at http://localhost:3000
fantasy - Fantasy booksscience fiction - Sci-fi literatureprogramming - Programming and technology bookshistory - Historical worksbiography - Biographical booksowly/
โโโ dist/ # Production build output
โโโ node_modules/ # Dependencies
โโโ src/ # Source files
โ โโโ css/ # CSS folder
โ โ โโโ style.css # Application styles
โ โโโ js/ # JavaScript folder
โ โ โโโ index.js # Entry point
โ โ โโโ fetch.js # API logic and book display
โ โโโ index.html # HTML template
โโโ .env # Environment variables (not in git)
โโโ .env.example # Environment variables template
โโโ .gitignore # Git ignore rules
โโโ package.json # Project dependencies and scripts
โโโ webpack.config.js # Webpack configuration
โโโ README.md # This file
Create a .env file in the root directory with the following variables:
# Open Library API Base URL
API_BASE_URL=https://openlibrary.org
# Request timeout in milliseconds
API_TIMEOUT=5000
# Maximum number of results to fetch
MAX_RESULTS=100
| Variable | Description | Default |
|---|---|---|
API_BASE_URL |
Base URL for Open Library API | https://openlibrary.org |
API_TIMEOUT |
Request timeout in ms | 5000 |
MAX_RESULTS |
Maximum books to display | 100 |
npm start
Starts webpack-dev-server with hot reloading at http://localhost:3000
npm run build
Creates optimized bundle in dist/ folder with:
npm run watch
Automatically rebuilds on file changes
This application uses the Open Library API:
GET https://openlibrary.org/subjects/{subject}.json?limit={n}&offset={n}
Returns a list of books for a specific subject/category.
GET https://openlibrary.org/works/{key}.json
Returns detailed information about a specific book including description.
Subject Search Response:
{
"key": "/subjects/fantasy",
"name": "fantasy",
"work_count": 12345,
"works": [
{
"key": "/works/OL8193508W",
"title": "Alice's Adventures in Wonderland",
"authors": [{"name": "Lewis Carroll"}],
"cover_id": 12345,
"first_publish_year": 1865
}
]
}
Book Details Response:
{
"title": "Alice's Adventures in Wonderland",
"description": "One of the most popular books...",
"first_publish_date": "1865",
"authors": [...]
}
All book cover images are preloaded before displaying cards to prevent layout shifts:
const cardPromises = data.works.map((work) => {
return new Promise((resolve) => {
imgElement.onload = () => resolve(card);
});
});
await Promise.all(cardPromises);
Using _.get() prevents errors when accessing nested properties:
const authorName = _.get(work, 'authors[0].name', 'Unknown author');
const description = _.get(bookDetails, 'description.value') ||
_.get(bookDetails, 'description') ||
'Description not available';
Clicking a book card opens a modal with:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Simone Camerano
Made with โค๏ธ and JavaScript