my own calibre server
- Node.js (v14+)
- npm or yarn
- A Calibre library
- Clone the repository
git clone https://github.com/bibulle/myCalibreServer.git
cd myCalibreServer- Install dependencies
npm install- Configure environment variables
cp .env.example .envEdit .env and set your configuration:
- SESSION_SECRET (REQUIRED): Strong random string for session encryption
- AUTHENT_JWT_SECRET (REQUIRED): Strong random string for JWT tokens
- PATH_BOOKS: Path to your Calibre library
- PATH_MY_CALIBRE: Path for cache storage
- Google/Facebook OAuth credentials (optional)
You can generate secure secrets with:
openssl rand -base64 32- Start the application (2 terminals)
# Terminal 1: API NestJS
npm run start:api
# Terminal 2: Frontend Angular (avec proxy /api)
npm run start:frontend| Variable | Description | Example |
|---|---|---|
SESSION_SECRET |
Secret for session encryption (REQUIRED) | your-random-secret-32-chars |
AUTHENT_JWT_SECRET |
Secret for JWT token signing (REQUIRED) | your-jwt-secret-32-chars |
PORT |
Server port | 3333 |
PATH_BOOKS |
Path to Calibre library | /path/to/calibre/library |
PATH_MY_CALIBRE |
Cache directory | /path/to/cache |
LOG_LEVEL |
Logging level | LOG, DEBUG, VERBOSE |
| Variable | Description |
|---|---|
AUTHENT_GOOGLE_CLIENT_ID |
Google OAuth Client ID |
AUTHENT_GOOGLE_CLIENT_SECRET |
Google OAuth Client Secret |
AUTHENT_FACEBOOK_APP_ID |
Facebook App ID |
AUTHENT_FACEBOOK_APP_SECRET |
Facebook App Secret |
.env file to version control!
- Use strong, randomly generated secrets for
SESSION_SECRETandAUTHENT_JWT_SECRET - Rotate secrets regularly in production
- Use different secrets for development and production environments
- Store production secrets securely (e.g., using secret management tools)
Run backend unit tests (using Jest):
# Run all tests
npx nx test api
# Run specific test file
npx nx test api --testPathPattern=health
# Run tests in watch mode
npx nx test api --watchFull-stack integration tests that run in a real browser:
# Run E2E tests (headless mode)
npx nx e2e frontend-e2e
# Run E2E tests with Cypress UI (interactive mode)
npx nx e2e frontend-e2e --watch
# Run specific test file
npx nx e2e frontend-e2e --spec="apps/frontend-e2e/src/integration/app.spec.ts"What E2E tests cover:
- ✅ Application loading and rendering
- ✅ Backend API health checks (
/api/health,/api/version) - ✅ Responsive design (mobile, tablet, desktop)
- ✅ Full-stack integration (frontend + backend)
Test artifacts:
- Screenshots:
dist/cypress/apps/frontend-e2e/screenshots/ - Videos:
dist/cypress/apps/frontend-e2e/videos/
# Run all tests
npm run test
# Run tests with coverage
npx nx test api --coverage