BookTracker is a Next.js application designed to track books as they travel between readers, specifically tailored for Little Free Libraries (LFL). Think of it as "Where's George" but for little libraries. It allows users to register books, generate unique tracking codes, and view a book's journey through "sightings".
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS, Shadcn/UI
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth (Email/Password, OAuth providers: Google, GitHub, Twitter, Instagram) - Configured for local development
- Mapping: Leaflet/React-Leaflet
- Testing: Jest, React Testing Library
- Deployment: Vercel
- Node.js (LTS version recommended)
- npm or yarn or pnpm
- Supabase account
-
Clone the repository:
git clone https://github.com/your-username/lfl-booktracker.git cd lfl-booktracker -
Install dependencies:
npm install # or yarn install # or pnpm install
-
Environment Setup: cp .env.example .env.local Update
.env.localwith your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your-supabase-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
Based on recent verification,
DB_KEYis also used for code generation API:DB_KEY=your-service-role-key # Keep this secret!
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev
-
Open http://localhost:3000 in your browser.
Run the test suite with:
yarn testSpecific test instructions:
yarn test __tests__/geohash.test.tsfor Geohash logic.yarn test __tests__/openLibrary.test.tsfor Book cover API.yarn test __tests__/book-api.test.tsfor Book API endpoints.
Authentication uses Supabase. To test sign-in flow locally:
- Ensure your
.env.localhas valid Supabase keys. - Sign up a user through the
/loginpage (or Supabase dashboard). - Confirm email (if enabled) or disable email confirmation in Supabase.
- Sign in to access protected routes like
/generate.
- Book Registration: Generate a unique 9-character code for your book.
- Code Generation: Securely generates unique codes using backend logic.
- Book Search: Look up a book's history by its code.
- Sightings: Record where you found a book (Location support pending).
- Cover Search: Find book covers via Google Books API integration.
MIT