omnivore/packages/api/test/global-setup.ts
Timothy Atapagra 0927294546 🚀 Stable Foundation: PDF Upload, Auth, and Infrastructure Fixes
 Core Stability Achievements:
- Demo user login working (demo@omnivore.app / demo_password)
- PDF upload, viewing, highlighting, and notes fully functional
- Database persistence across container restarts
- Redis connection issues resolved

🔧 Infrastructure Improvements:
- Added PostgreSQL persistent volumes (postgres_data, postgres_replica_data)
- Fixed Redis configuration with proper URLs and missing MQ_REDIS_URL
- Enhanced demo user creation with corrected ON CONFLICT clause
- Improved PDF content handler with better title extraction

🐛 Bug Fixes:
- Fixed demo user authentication by correcting setup.sh ON CONFLICT
- Resolved Redis connection errors in API and content-fetch services
- Enhanced RSS handler Redis client with null-check safety
- Added mail server data to gitignore

📚 Documentation:
- Added development vs production guide
- Added troubleshooting documentation
- Added Cursor AI rules for consistent development

🎯 Next Phase Ready:
Stable foundation established for implementing link upload/saving functionality.
2025-07-09 16:36:49 -04:00

27 lines
865 B
TypeScript

import { env } from '../src/env'
import { redisDataSource } from '../src/redis_data_source'
import { createTestConnection } from './db'
import { startApolloServer, startWorker } from './util'
export const mochaGlobalSetup = async () => {
await createTestConnection()
console.log('db connection created')
if (env.redis.cache.url) {
await redisDataSource.initialize()
console.log('redis connection created')
if (redisDataSource.workerRedisClient) {
startWorker({
host: redisDataSource.workerRedisClient.options.host,
port: redisDataSource.workerRedisClient.options.port,
password: redisDataSource.workerRedisClient.options.password,
db: redisDataSource.workerRedisClient.options.db,
})
console.log('worker started')
}
}
await startApolloServer()
console.log('apollo server started')
}