FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
realcoder
realcoderCrimeMap
Public
Like
CrimeMap
Home
Code
4
backend
3
frontend
3
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 miliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://realcoder--cfe500563f9011f0905d76b3cceeab13.web.val.run
README.md

Crime Reporting App

A web application that allows users to report crimes in their local area using an interactive map.

Features

  • Interactive map interface for selecting crime location
  • Crime type categorization
  • Anonymous reporting option
  • Real-time crime report viewing
  • Location-based crime filtering

Project Structure

├── backend/
│   ├── database/
│   │   ├── migrations.ts    # Database schema setup
│   │   └── queries.ts       # Database query functions
│   ├── routes/
│   │   ├── reports.ts       # Crime report API endpoints
│   │   └── static.ts        # Static file serving
│   └── index.ts             # Main Hono server
├── frontend/
│   ├── components/
│   │   ├── App.tsx          # Main React component
│   │   ├── CrimeMap.tsx     # Interactive map component
│   │   └── ReportForm.tsx   # Crime reporting form
│   ├── index.html           # Main HTML template
│   ├── index.tsx            # Frontend entry point
│   └── style.css            # Custom styles
├── shared/
│   └── types.ts             # Shared TypeScript types
└── README.md

Technology Stack

  • Backend: Hono (TypeScript API framework)
  • Database: SQLite
  • Frontend: React with TypeScript
  • Map: Leaflet.js
  • Styling: TailwindCSS

API Endpoints

  • GET /api/reports - Get all crime reports (with optional location filtering)
  • POST /api/reports - Submit a new crime report
  • GET /api/reports/stats - Get crime statistics by type and area

Database Schema

Reports Table

  • id - Primary key
  • crime_type - Type of crime reported
  • description - Detailed description
  • latitude - Location latitude
  • longitude - Location longitude
  • address - Human-readable address
  • reporter_name - Reporter name (optional for anonymous reports)
  • reporter_contact - Contact information (optional)
  • is_anonymous - Boolean flag for anonymous reports
  • status - Report status (pending, reviewed, resolved)
  • created_at - Timestamp of report creation

Usage

  1. Open the application in your browser
  2. Click on the map to select the crime location
  3. Fill out the crime report form
  4. Submit the report
  5. View existing reports on the map

Development

The app automatically serves static files and provides a REST API for crime reports. The database is initialized on first run.

HTTP
  • index.ts
    realcoder--cf…13.web.val.run
Code
backendfrontendsharedREADME.md
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.