BookTracker#
A modern book tracking application built with Tauri, Nuxt 3, and NestJS.
📁 Project Structure#
This is a pnpm monorepo containing:
apps/frontend- Tauri desktop application with Nuxt 3apps/backend- NestJS REST API with Drizzle ORM
booktracker/
├── apps/
│ ├── frontend/ # Tauri + Nuxt 3 desktop app
│ │ ├── src-tauri/ # Rust backend for Tauri
│ │ ├── pages/ # Nuxt pages
│ │ ├── components/ # Vue components
│ │ └── nuxt.config.ts # Nuxt configuration
│ └── backend/ # NestJS API
│ ├── src/ # Source code
│ ├── drizzle/ # Database migrations
│ └── Dockerfile # Container definition
├── .github/workflows/ # CI/CD pipelines
├── docker-compose.yml # Local development setup
├── pnpm-workspace.yaml # Monorepo configuration
└── package.json # Root scripts
🚀 Quick Start#
Prerequisites#
- Node.js (version specified in
.nvmrc) - pnpm (version specified in
package.json) - Rust (for Tauri)
- PostgreSQL (or use Docker Compose)
Installation#
-
Clone the repository
git clone https://github.com/yourusername/booktracker.git cd booktracker -
Install dependencies
pnpm install -
Set up the database
Using Docker:
docker-compose up -d postgresOr install PostgreSQL locally and create a database named
booktracker. -
Configure backend environment
Copy the example environment file:
cp apps/backend/env.example apps/backend/.envEdit
apps/backend/.envwith your database credentials. -
Run database migrations
For local development:
pnpm db:migrateNote: When using Docker, migrations run automatically on container startup.
Development#
Run everything in parallel:
pnpm dev
Or run individually:
-
Frontend (Tauri):
pnpm dev:frontend -
Backend (NestJS):
pnpm dev:backend -
Database Studio:
pnpm db:studio
🏗️ Building#
Frontend (Desktop App)#
# Build for your current platform
pnpm tauri:build
# Or build just the Nuxt frontend
pnpm build:frontend
Backend (API)#
# Build the NestJS app
pnpm build:backend
# Build Docker image
docker build -t booktracker-backend ./apps/backend
🧪 Testing#
Frontend#
# Run Rust tests
pnpm test:rust
Backend#
# Run unit tests
pnpm test:backend
# Run e2e tests
pnpm test:backend:e2e
🗄️ Database#
This project uses Drizzle ORM for database management.
Common Commands#
# Generate new migration
pnpm db:generate
# Run migrations
pnpm db:migrate
# Open Drizzle Studio
pnpm db:studio
Schema#
The database schema is defined in apps/backend/src/db/schema.ts.
🐳 Docker#
Local Development with Docker Compose#
# Start PostgreSQL + Backend
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Backend Docker Image#
The backend Dockerfile uses Node.js slim image and pnpm monorepo support for efficient builds.
# Build (context is repo root, not apps/backend)
docker build -f apps/backend/Dockerfile -t booktracker-backend .
# Run
docker run -p 3001:3001 \
-e DATABASE_URL="postgresql://user:pass@host:5432/db" \
booktracker-backend
📝 Scripts Reference#
Root-level commands#
| Command | Description |
|---|---|
pnpm dev |
Run frontend and backend in parallel |
pnpm build |
Build all apps |
pnpm typecheck |
Type check all packages |
Frontend commands#
| Command | Description |
|---|---|
pnpm dev:frontend |
Run Nuxt dev server |
pnpm build:frontend |
Build Nuxt for production |
pnpm tauri:dev |
Run Tauri in dev mode |
pnpm tauri:build |
Build Tauri desktop app |
pnpm format:rust |
Format Rust code |
pnpm lint:rust |
Lint Rust code |
pnpm test:rust |
Run Rust tests |
Backend commands#
| Command | Description |
|---|---|
pnpm dev:backend |
Run NestJS in watch mode |
pnpm build:backend |
Build NestJS for production |
pnpm lint:backend |
Lint backend code |
pnpm test:backend |
Run backend tests |
pnpm test:backend:e2e |
Run backend e2e tests |
pnpm db:generate |
Generate DB migration |
pnpm db:migrate |
Run DB migrations |
pnpm db:studio |
Open Drizzle Studio |
🔧 CI/CD#
The project includes several GitHub Actions workflows:
build.yml- Builds frontend and backend on PR/pushlint.yml- Runs linting and type checkingrelease.yml- Creates Tauri releases for all platformsdocker-backend.yml- Builds and pushes backend Docker imageupdater.yml- Generates Tauri updater JSON
🛠️ Tech Stack#
Frontend#
- Tauri - Desktop app framework
- Nuxt 3 - Vue.js framework
- Vue 3 - Progressive JavaScript framework
- TypeScript - Type-safe JavaScript
Backend#
- NestJS - Progressive Node.js framework
- Drizzle ORM - TypeScript ORM
- PostgreSQL - Relational database
- TypeScript - Type-safe JavaScript
Tools#
- pnpm - Fast, disk space efficient package manager
- Docker - Containerization
- GitHub Actions - CI/CD
📄 License#
🤝 Contributing#
Contributions are welcome! Please feel free to submit a Pull Request, open an issue with feature requests or bug report, or provide feedback on anything you feel strongly about.