Version 1 of tornadoapi.com will provide RESTful access to statistical data for every tornado recorded since 1950. The Storm Prediction Center's Severe Weather Database Files serve as the foundation of the API.
The goal of this project is to make historical tornado data more accessible to severe wx fanatics and meteorology professionals alike. TornadoAPI.com will also serve as the visualization data source for my other project, tornadowarned.com.
Version 2 of the API will provide GraphQL access to the same set of data provided in the REST version.
Copyright © 2023 | Ephraim Smith
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Severe Weather Tornado Data
- Severe Weather Hail Data
- Severe Weather Wind Data
- comprehensive README.md
- REST endpoints
- GraphQL schemas
Install & Run Your Own Instance of the Tornado API
cd <parent-folder-path/>
git clone https://github.com/ephcoding/tornado-api.git
cd tornado-api
npm install
OR
yarn
npm run dev
OR
yarn dev
Project Structure
tornado-api/....................root directory
config/.......................database & deployment configs
constants/....................manage project-wide variables here
controllers/..................endpoint-handling logic
data/.........................source and seed data files
images/.......................graphic assets for README.md
models/.......................database object definitions
routes/.......................request routing
utils/........................util functions for converting .csv files to .json files
.gitignore....................don't expose those .env keys!
package.json..................project dependencies
README.md.....................you are here [X]
yarn.lock.....................dependency lock file
Code Features
config.env
| you'll need to create your ownconfig.env
with the following:
MONGODB_URI=<your MongoDB remote url string>
MONGODB_LOCAL_URI=<your local MongoDB instance url string>
NODE_ENV=development
PORT=<port#>
async-handler.js
| async wrapper for controller functions. Eliminates the need for a try/catch block in every controller function.error-handler.js
| handles various potential Mongoose & server errors.logging-handler.js
| used to log incoming requestsquery-builder.js
| handles incoming requests that include query params and/or filters.
ErrorResponse
| class for streamlining new Error instantiationjson-from-csv.seed.js
| convertssingle_track_tornadoes.csv
intosingle_track_tornadoes.json
for seeding MongoDB
seeder.js
| seeds tornado data into MongoDB usingsingle_track_tornadoes.json
Dependencies
csvtojson
| .csv parser that converts .csv to .jsondotenv
| loads.env
variables intoprocess.env
express
| Node.js web frameworkmongodb
| Node.js driver for MongoDBmongoose
| async MongoDB object modelermorgan
| Node.js HTTP request logging middleware
nodemon
| restarts Node.js apps when file changes are made
Scripts
"start"
| sets NODE_ENV
to "production" and starts server
"dev"
| starts the development server using nodemon
issue submission process coming soon
PR submission process coming soon