A beautiful web application for Croatian children's bedtime stories, built with Next.js, SQLite, and Tailwind CSS.
- 📚 Collection of 42 Croatian bedtime stories for kids ages 5-10
- 🌙 Dark mode theme with navy, slate, and amber accents
- ⭐ 5-star rating system with averaged ratings stored in database
- 📖 List and Gallery view modes
- ✅ Mark stories as read with grayed-out styling
- 🔙 Back to top button for easy navigation
- 📱 Mobile-friendly responsive design
- 🎨 AI-generated illustrations for each story
- Framework: Next.js 16 (App Router)
- Database: SQLite with
better-sqlite3 - Styling: Tailwind CSS 4
- Language: TypeScript
- Image Generation: OpenAI DALL-E 3 (optional)
- Docker and Docker Compose installed
- Pull the latest image or build it:
docker compose pull
# OR build locally
docker compose build- Start the application:
docker compose up -d- The application will be available at http://localhost:8889
docker run -d \
--name fairytale-app \
-p 8889:3000 \
-v $(pwd)/data:/app/data \
ghcr.io/scallywer/fairytale:latestThe SQLite database is stored in the ./data directory, which is mounted as a volume in Docker. The database is pre-populated with all stories, so it will be automatically copied to the volume on first run if it doesn't exist. Make sure to backup this directory regularly.
Docker images are automatically built and pushed to GitHub Container Registry on every commit to master branch:
- Image:
ghcr.io/scallywer/fairytale:latest - Automatically tagged with branch name, SHA, and version tags
The application uses SQLite with two main tables:
- stories: Contains story metadata (title, author, body, country, imageUrl, isApproved, averageRating, ratingCount)
- ratings: Stores individual user ratings (storyId, userId, rating 1-5)
Average ratings are calculated automatically when ratings are submitted and stored in the stories table for quick access.
Available npm scripts (for development/maintenance):
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run generate-images- Generate images for stories (requires OpenAI API key)npm run export-prompts- Export all DALL-E prompts to filenpm run update-image-links- Update image URLs in database from local files
Private project - All rights reserved