Pilot city api/model

Roads API (/api/roads)

  • Create Road (POST): Admins only

  • Read Roads (GET): Public

  • Update Road (PUT): Admins or owners

  • Delete Road (DELETE): Admins or owners

Reviews API (/api/review)

  • Create Review (POST): Authenticated users (logged in)

  • Read Reviews (GET): Public

  • Update Review (PUT): Review owners or Admins

  • Delete Review (DELETE): Review owners or Admins


Models

Road

Field Type Description
id Integer Primary key
road_name String Name of the road
place_id Integer ID from Google Maps (to verify)

Review

Field Type Description
id Integer Primary key
road_id ForeignKey Linked to Road
uid ForeignKey Linked to User
description String Review content
rating Integer Numeric rating
date_posted DateTime Auto-generated on creation

Authorization & Roles

  • @token_required used on all write/update/delete routes.

  • Admins have full access to all routes.

  • Regular users can modify their own reviews.

Deployment Tools

  • AWS EC2: A virtual server used to host the application.
  • Docker: Containerizes the Flask app to ensure consistent behavior across environments.
  • Nginx: Acts as a reverse proxy to route incoming HTTP requests to the Flask app.