Update README with current project state: Go templates + HTMX + multiple themes
This commit is contained in:
@@ -1,18 +1,20 @@
|
|||||||
# 📚 Bookmann
|
# 📚 Bookmann
|
||||||
|
|
||||||
A self-hosted ebook management system built with Go, PostgreSQL, and Svelte (integrated into a single service) featuring a beautiful Tokyo Night dark theme.
|
A self-hosted ebook management system built with Go, PostgreSQL, HTMX, and Tailwind CSS (fully integrated into a single service) featuring multiple beautiful dark themes with Tokyo Night as default.
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- **🔒 Multi-User Authentication**: Complete user system with registration/login, JWT-based sessions, and bcrypt password hashing
|
- **🔒 Multi-User Authentication**: Complete user system with registration/login, JWT-based sessions, and bcrypt password hashing
|
||||||
- **✅ Server-Side Validation**: Comprehensive input validation with detailed error messages
|
- **✅ Server-Side Validation**: Comprehensive input validation with detailed error messages
|
||||||
- **🔔 Toast Notifications**: Real-time error feedback with beautiful toast popups
|
- **🌙 Multiple Themes**: 7 popular dark themes (Tokyo Night, Dracula, Nord, Solarized Dark, Monokai, One Dark Pro, Material Dark) with user preferences saved to database
|
||||||
- **🌙 Tokyo Night Theme**: Stunning dark theme with smooth animations and modern UI
|
- **🎨 Theme Persistence**: User theme choices sync between browser and server
|
||||||
- **📖 Reading Progress**: User-specific reading progress tracking
|
- **📖 Reading Progress**: User-specific reading progress tracking
|
||||||
- **🔧 RESTful API**: Clean API endpoints with JWT authentication
|
- **🔧 RESTful API**: Clean API endpoints with JWT authentication
|
||||||
- **🐳 Docker Ready**: Single-container deployment with PostgreSQL
|
- **🐳 Docker Ready**: Single-container deployment with PostgreSQL
|
||||||
- **🧪 API Testing**: Complete Bruno collection for testing all endpoints
|
- **🧪 API Testing**: Complete Bruno collection for testing all endpoints
|
||||||
- **📱 Responsive Design**: Mobile-first responsive interface
|
- **📱 Responsive Design**: Mobile-first responsive interface using Tailwind CSS
|
||||||
|
- **⚡ HTMX Integration**: Dynamic interactions without JavaScript frameworks
|
||||||
|
- **🎯 TypeScript Support**: Client-side scripting with TypeScript compilation
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
@@ -49,26 +51,18 @@ go run github.com/sqlc-dev/sqlc/cmd/sqlc@latest generate
|
|||||||
go run cmd/server/main.go
|
go run cmd/server/main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
### Frontend
|
The application uses Go HTML templates for server-side rendering with HTMX for dynamic interactions. Templates are located in `backend/templates/`.
|
||||||
|
|
||||||
For development, run the frontend separately:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd frontend
|
|
||||||
npm install
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
**✨ Enhanced Features:**
|
**✨ Enhanced Features:**
|
||||||
- **Authentication**: Login/Register forms with Tokyo Night styling at `/login` and `/register`
|
- **Authentication**: Login/Register forms with multiple theme support at `/login` and `/register`
|
||||||
- **JWT Management**: Secure token storage with localStorage and session persistence
|
- **JWT Management**: Secure token storage with localStorage and session persistence
|
||||||
- **Protected Routes**: Automatic redirects with reactive auth state management
|
- **Theme Switching**: 7 popular dark themes with dropdown selector and database persistence
|
||||||
- **Toast Notifications**: Real-time error feedback for all API operations
|
- **HTMX Integration**: Form submissions and dynamic updates without page reloads
|
||||||
- **Input Validation**: Client-side and server-side validation with detailed error messages
|
- **Input Validation**: Server-side validation with detailed error messages
|
||||||
- **Tokyo Night Theme**: Beautiful dark theme with smooth animations and modern UI components
|
- **Multiple Themes**: Beautiful dark themes with smooth transitions
|
||||||
- **Responsive Design**: Mobile-first approach with optimized layouts for all screen sizes
|
- **Responsive Design**: Mobile-first approach with optimized layouts for all screen sizes
|
||||||
|
|
||||||
**Note**: For production, the frontend is built to static files and served by the Go backend.
|
**Note**: The frontend is fully integrated into the Go backend using HTML templates and HTMX.
|
||||||
|
|
||||||
## API Endpoints
|
## API Endpoints
|
||||||
|
|
||||||
@@ -76,6 +70,7 @@ npm run dev
|
|||||||
- `POST /api/auth/register` - Register new user
|
- `POST /api/auth/register` - Register new user
|
||||||
- `POST /api/auth/login` - Login user (email or username)
|
- `POST /api/auth/login` - Login user (email or username)
|
||||||
- `GET /api/auth/profile` - Get user profile (requires JWT)
|
- `GET /api/auth/profile` - Get user profile (requires JWT)
|
||||||
|
- `PUT /api/auth/theme` - Update user theme preference (requires JWT)
|
||||||
|
|
||||||
### Ebooks (Protected)
|
### Ebooks (Protected)
|
||||||
- `GET /api/ebooks` - List ebooks
|
- `GET /api/ebooks` - List ebooks
|
||||||
@@ -108,19 +103,8 @@ Use the included Bruno collection in the `bruno/` directory for testing the API:
|
|||||||
│ │ ├── database/ # Database connection and queries
|
│ │ ├── database/ # Database connection and queries
|
||||||
│ │ └── handlers/ # HTTP handlers (auth + ebooks)
|
│ │ └── handlers/ # HTTP handlers (auth + ebooks)
|
||||||
│ ├── migrations/ # Database migrations
|
│ ├── migrations/ # Database migrations
|
||||||
|
│ ├── templates/ # Go HTML templates with HTMX
|
||||||
│ └── sqlc.yaml # sqlc configuration
|
│ └── sqlc.yaml # sqlc configuration
|
||||||
├── frontend/
|
|
||||||
│ ├── src/
|
|
||||||
│ │ ├── lib/
|
|
||||||
│ │ │ ├── api.ts # API client with auth & toast notifications
|
|
||||||
│ │ │ ├── auth.ts # Auth state management
|
|
||||||
│ │ │ └── toast.ts # Toast notification utilities
|
|
||||||
│ │ └── routes/
|
|
||||||
│ │ ├── login/ # Login page (Tokyo Night theme)
|
|
||||||
│ │ ├── register/ # Registration page (Tokyo Night theme)
|
|
||||||
│ │ └── ... # Other routes (Tokyo Night theme)
|
|
||||||
│ ├── app.css # Global styles with Tokyo Night theme
|
|
||||||
│ └── package.json # Build dependencies with toast library
|
|
||||||
├── bruno/ # Bruno API testing collection
|
├── bruno/ # Bruno API testing collection
|
||||||
├── docker-compose.yml
|
├── docker-compose.yml
|
||||||
└── README.md
|
└── README.md
|
||||||
@@ -129,21 +113,23 @@ Use the included Bruno collection in the `bruno/` directory for testing the API:
|
|||||||
## 🎨 Recent Enhancements
|
## 🎨 Recent Enhancements
|
||||||
|
|
||||||
### Backend Improvements
|
### Backend Improvements
|
||||||
- **Server-Side Validation**: Added comprehensive input validation using `go-playground/validator/v10`
|
- **Server-Side Rendering**: Replaced static frontend with Go HTML templates
|
||||||
- **Enhanced Security**: All API endpoints now validate requests before processing
|
- **Theme System**: Database-backed user theme preferences with 7 popular dark themes
|
||||||
- **Better Error Handling**: Detailed validation error messages for improved debugging
|
- **HTMX Integration**: Dynamic interactions using HTMX for modern UX
|
||||||
|
- **Enhanced Security**: JWT authentication with theme persistence
|
||||||
|
|
||||||
### Frontend Redesign
|
### Frontend Redesign
|
||||||
- **Tokyo Night Theme**: Complete UI overhaul with beautiful dark theme colors
|
- **Multiple Themes**: 7 beautiful dark themes (Tokyo Night default) with CSS variables
|
||||||
- **Toast Notifications**: Real-time error feedback using `@zerodevx/svelte-toast`
|
- **HTMX Forms**: Real-time form submissions and updates without JavaScript frameworks
|
||||||
- **Modern UI Components**: Card-based layouts, smooth animations, and responsive design
|
- **Theme Switcher**: Dropdown selector that saves preferences to database
|
||||||
- **Enhanced UX**: Loading states, form validation, and improved user feedback
|
- **Responsive Design**: Tailwind CSS for mobile-first responsive layouts
|
||||||
|
|
||||||
### Technical Updates
|
### Technical Updates
|
||||||
- **Dependencies**: Added validation and toast libraries
|
- **Go Templates**: Server-side rendering with template inheritance
|
||||||
- **Typography**: Inter font family for improved readability
|
- **Tailwind CSS**: Utility-first CSS framework via CDN
|
||||||
- **Animations**: Custom fade-in and slide-in animations
|
- **TypeScript Support**: Client-side scripting with TypeScript compilation
|
||||||
- **Performance**: Optimized CSS compilation and build process
|
- **Database Schema**: Added theme column to users table
|
||||||
|
- **API Expansion**: New theme update endpoint
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user