import { Router } from 'express'
import { pantryRoutes } from './pantry'
import { userRoutes } from './user'
import { settingsRoutes } from './settings'
import authRoutes from './auth'

const router = Router()

// Mount route modules
router.use('/auth', authRoutes)
router.use('/pantry', pantryRoutes)
router.use('/user', userRoutes)
router.use('/settings', settingsRoutes)

// API info endpoint
router.get('/', (req, res) => {
  res.json({
    message: 'Pantry Sync API',
    version: '1.0.0',
    endpoints: {
      auth: '/api/auth',
      pantry: '/api/pantry',
      user: '/api/user',
      settings: '/api/settings',
      health: '/health'
    }
  })
})

export { router as apiRoutes }
