Never leave a bookstore empty-handed again!
Have you ever been at a book sale, library, or friend's house looking at shelves of books but didn't recognize any titles or authors? ShelfScanner solves the problem of figuring out what to read by using AI to help you discover what you'll enjoy.
πΈ Scan Shelves β Take a photo of an entire bookshelf
π€ AI Analysis β Get book recommendations based on your reading preferences
π Rich Details β View AI-generated summaries, ratings, and match reasoning
π Build Lists β Save interesting books to your reading list
π Easy Purchase β Direct links to buy books on Amazon if you're not at a store
- Shelf Scanning: Photograph entire bookshelves to identify multiple books at once
- AI Recommendations: Personalized suggestions based on your Goodreads data and preferences
- Match Reasoning: Understand exactly why each book is recommended for you
- Enhanced Metadata: Rich book information with AI-generated summaries and ratings
- Mobile-First Design: Optimized for smartphones and tablets
- Device-Based Sessions: No account required - preferences stored per device
- Responsive Design: Works well on all screen sizes
- Intelligent Caching: Multi-layer caching reduces API costs and improves speed
- Rate Limiting: Built-in protection against API abuse
- Error Handling: Graceful fallbacks when services are unavailable
- Database Monitoring: PostgreSQL connection and performance tracking
Frontend: React + TypeScript, TailwindCSS, Shadcn/ui, Wouter routing
Backend: Express.js + TypeScript, PostgreSQL, Drizzle ORM
AI Services: OpenAI GPT-4o for recommendations and descriptions
Infrastructure: Vite build tool, Winston logging, Device-based auth
Deployment: Vercel (Frontend & API), PostgreSQL database
- Node.js 18+ and npm
- PostgreSQL database (local or cloud)
- OpenAI API key
-
Clone and Install Dependencies
git clone <your-repo-url> cd ShelfScanner npm install
-
Set Up Environment Variables Create a
.envfile in the root directory:# See Environment Configuration section below for all variables -
Database Setup
# Push the database schema npm run db:push:dev # Optional: Set up initial schemas/data npm run db:setup
-
Start Development Server
npm run dev
The application will be available at
http://localhost:5000
-
Deploy to Vercel
# Install Vercel CLI npm i -g vercel # Deploy vercel
-
Configure Environment Variables In your Vercel dashboard, add all required environment variables (see Environment Configuration below)
Create a .env file with these required variables:
# Database (Required)
DATABASE_URL=postgresql://user:password@host:port/database
# OpenAI API (Required for AI features)
OPENAI_API_KEY=sk-your_openai_key_here
# Optional: Google Vision API (minimal implementation)
GOOGLE_VISION_API_KEY=your_google_vision_keyOpenAI API (Required - for book summaries and recommendations):
- Visit OpenAI Platform
- Create an account and add billing
- Generate an API key in the API Keys section
Google Vision API (Optional - limited implementation):
- Go to Google Cloud Console
- Enable the Vision API
- Create credentials and get your API key
ShelfScanner/
βββ client/src/ # React frontend
β βββ components/ # Reusable UI components
β β βββ ui/ # Shadcn/ui base components
β β βββ book-scanner/ # Book scanning interface
β β βββ layout/ # Navigation and layout
β βββ pages/ # Application routes/pages
β βββ hooks/ # Custom React hooks
β βββ contexts/ # React contexts (Theme, Device)
β βββ lib/ # Utilities and API clients
βββ server/ # Express.js backend
β βββ routes.ts # Main API routes
β βββ books.ts # Book data services
β βββ openai-*.ts # AI integration services
β βββ book-cache-service.ts # Caching layer
β βββ storage.ts # Database operations
β βββ middleware/ # Express middleware
βββ shared/ # Shared TypeScript types
β βββ schema.ts # Database schema definitions
βββ api/ # Vercel API routes
βββ public/ # Static assets
βββ tests/ # Test files
βββ scripts/ # Utility scripts
- Users photograph bookshelves using their device camera
- Image is processed to extract text from book spines
- Custom parsing algorithms identify book titles and authors
- Book metadata fetched from external APIs
- Basic book metadata fetched from Google Books API
- OpenAI generates rich summaries and enhanced ratings
- All data cached in PostgreSQL for performance
- Users can import reading history from Goodreads CSV export
- Users can manually input reading preferences
- AI analyzes user's reading patterns and preferences
- Generates personalized match scores with detailed reasoning
- Database Layer: Stores enhanced book data permanently
- Rate Limiting: Prevents expensive API overuse
- Device Identification: Preferences linked to device cookies
- Lazy Loading: Images and data load as needed
- Request Batching: Efficient API usage
- Progressive Enhancement: App works even if AI services are down
- Caching Strategy: Multi-level caching reduces costs
- Device-Based Storage: Reading preferences stored per device, no accounts required
- API Key Protection: All sensitive keys in environment variables
- Input Validation: Zod schemas validate all user inputs
- Rate Limiting: Prevents API abuse and reduces costs
# Development
npm run dev # Start development server
npm run check # TypeScript type checking
# Database
npm run db:push # Push schema to database
npm run db:push:dev # Push schema (development)
npm run db:push:prod # Push schema (production)
npm run db:studio # Open Drizzle Studio
npm run db:generate # Generate migrations
npm run db:setup # Initial database setup
# Testing
npm run test # Run all tests
npm run test:client # Client-side tests (Vitest)
npm run test:server # Server-side tests (Jest)
npm run test:e2e # End-to-end tests (Playwright)
npm run test:ui # Test UI
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run security:check # Security audit
# Production
npm run build # Build for production
npm start # Start production serverBasic admin functionality is available at /admin for monitoring:
- API usage statistics
- Basic system information
- Debug information
All Rights Reserved - This project is proprietary software owned by the author.
- β Viewing: You may view the source code for educational purposes
- β Learning: You may study the implementation and techniques used
- β Commercial Use: Commercial use is strictly prohibited
- β Distribution: You may not distribute, modify, or create derivative works
- β Deployment: You may not deploy this application for public or commercial use
For any licensing inquiries or permission requests, please contact shelfscannerapp@gmail.com
- Issues: Create a GitHub issue for bugs or feature requests
- Email: shelfscannerapp@gmail.com
Built with β€οΈ for book lovers who want to discover their next great read!