This is small practice project, a personal library management application that allows you to create, organize, and share your book collection. Built with SvelteKit and powered by Supabase, it features an AI-powered book scanning capability using OpenAI's GPT-4 Vision to automatically recognize books from shelf photos.
Before you begin, ensure you have the following installed:
git clone https://github.com/KimChanaDev/book-nest-svelte.git
cd book-nest-svelte
npm install
# or
pnpm install
# or
yarn install
# Start Supabase locally
npx supabase start
Create a .env file in the root directory and add your API keys:
# Supabase Configuration
PUBLIC_SUPABASE_URL=your_supabase_project_url
PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
PUBLIC_FRONTEND_URL=your_front_end_url
SUPABASE_SERVICE_ROLE_KEY=your_supabase_role_key
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key
# Set to 'true' for testing without OpenAI API calls, 'false' for production
MOCK_OPENAI=false
Note: Variables with PUBLIC_ prefix are exposed to the browser. Keep sensitive keys private.
npm run dev
The application will be available at http://localhost:5173
If using local Supabase:
npx supabase start
Access Supabase Studio at http://127.0.0.1:54323
HeroSection.svelte - Landing page hero with call-to-actionAuthForm.svelte - Reusable authentication form for login/registerBookCard.svelte - Display individual book informationBookCategory.svelte - Category selector for booksStarRating.svelte - Interactive star rating componentButton.svelte - Reusable button componentHeader.svelte - Navigation headerSideNavigation.svelte - Sidebar navigation for authenticated users/ - Landing page/login - User login page/register - User registration page/private/dashboard - User's book library overview/private/book/[bookId] - Individual book details page/private/scan-shelf - AI-powered book scanner/private/settings - Account settings and profile managementThe book scanner feature uses OpenAI's GPT-4 Vision model to:
book-nest/
āāā src/
ā āāā lib/
ā ā āāā components/ # Reusable Svelte components
ā ā āāā state/ # State management
ā ā āāā types/ # TypeScript type definitions
ā ā āāā utils/ # Utility functions
ā āāā routes/ # SvelteKit routes
ā ā āāā api/ # API endpoints
ā ā āāā auth/ # Authentication routes
ā ā āāā login/ # Login page
ā ā āāā register/ # Registration page
ā ā āāā private/ # Protected routes
ā āāā app.css # Global styles
ā āāā app.html # HTML template
ā āāā hooks.server.ts # Server-side hooks & middleware
āāā static/ # Static assets
āāā supabase/
ā āāā config.toml # Supabase configuration
ā āāā migrations/ # Database migrations
āāā package.json
The easiest way to deploy your Book Nest application is using Vercel:
For other platforms, you can change the adapter in svelte.config.js:
# Install specific adapter
npm install -D @sveltejs/adapter-cloudflare # for Cloudflare Workers and Cloudflare Pages
npm install -D @sveltejs/adapter-node # for Node servers
npm install -D @sveltejs/adapter-static # for static site generation (SSG)
npm install -D @sveltejs/adapter-vercel # for Vercel
npm install -D @sveltejs/adapter-netlify # for Netlify
The project uses custom path aliases configured in svelte.config.js:
$components ā src/lib/components$assets ā src/lib/assets$state ā src/lib/state