• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
excel

excel

FloodApp

A flood app that notify subscriber ahead of flooding
Public
Like
FloodApp
Home
Code
4
backend
6
frontend
2
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
backend
/
README.md
Code
/
backend
/
README.md
Search
5/19/2025
Viewing readonly version of main branch: v14
View latest version
README.md

Backend

This directory contains the server-side code for the Osun State Flood Alert System.

Structure

  • index.ts - Main entry point for the HTTP API
  • cron.ts - Scheduled job to check for floods and send alerts
  • database/ - Database schema and queries
  • routes/ - API route handlers
  • services/ - Business logic services

API Endpoints

Authentication

  • POST /api/auth/signup - Create a new user account
  • POST /api/auth/login - Log in to an existing account
  • GET /api/auth/me - Get current user information

Locations

  • GET /api/locations - Get all locations for the current user
  • POST /api/locations - Add a new location
  • GET /api/locations/:id - Get a specific location
  • DELETE /api/locations/:id - Delete a location

Flood Checking

  • POST /api/check-floods - Check for potential floods for a user's locations

Cron Job

The cron.ts file contains a scheduled job that runs daily to:

  1. Check for pending flood alerts
  2. Send email notifications to users
  3. Mark alerts as sent

Environment Variables

  • JWT_SECRET - Secret key for JWT token generation (optional, has default)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.