This directory contains the server-side code for the Osun State Flood Alert System.
index.ts - Main entry point for the HTTP APIcron.ts - Scheduled job to check for floods and send alertsdatabase/ - Database schema and queriesroutes/ - API route handlersservices/ - Business logic servicesPOST /api/auth/signup - Create a new user accountPOST /api/auth/login - Log in to an existing accountGET /api/auth/me - Get current user informationGET /api/locations - Get all locations for the current userPOST /api/locations - Add a new locationGET /api/locations/:id - Get a specific locationDELETE /api/locations/:id - Delete a locationPOST /api/check-floods - Check for potential floods for a user's locationsThe cron.ts file contains a scheduled job that runs daily to:
JWT_SECRET - Secret key for JWT token generation (optional, has default)