Skip to content

nikitalyashenko/earthquakes

Repository files navigation

🌍 Global Catalog of Earthquakes

Welcome to the Global Catalog of Earthquakes app! This application provides features to import and analyze global earthquake data. Let's get started!

Here is working playground: https://earthquakes.lyashenko.pro/graphql

🚀 Installation

Prerequisites

Make sure you have the following installed:

  • Node.js
  • Docker
  • pnpm

Steps

  1. Copy the example environment variables:

    cp ./env.example ./.env
  2. Start the database for local development:

    docker-compose up
  3. Install the required modules:

    pnpm i
  4. Run the server:

    pnpm run start
  5. Run database migrations to set up the schemas:

    pnpm run migration:run

📊 Importing Data

To import earthquake data, use the following mutation with the correct dataset URL:

mutation ImportEarthquakes($fileUrl: String!) {
  importEarthquakes(fileUrl: $fileUrl)
}

Dataset URL: earthquakes1970-2014.csv

🎉 Now you have a fully working development environment!

🗄️ Migrations

For database migrations, use the following commands:

  • Generate a migration file if you've made changes to your entities or related types:

    pnpm run migration:generate
  • Run unprocessed migrations:

    pnpm run migration:run
  • You dont need it)):

    migration:revert

🧹 Code Validation

Ensure your code adheres to the project's standards with these commands:

  • Check code format:

    pnpm run check-format
  • Check types:

    pnpm run check-types
  • Fix all file styles:

    pnpm run format
  • Lint all files:

    pnpm run lint

🔜 Next Steps

I'm having a lot of fun with this project I'd like to improve a lot of things here, but I'm very short on time! Here are a few ideas:

  • Split data into different tables and set up relations & indexes
  • Implement vector search
  • Connect Metabase and display nice charts
  • Improve the importing process to create an import record in the database with ID, file name, and file hash sum, with a relation to each record
  • Rewrite all in Rust xD

Made with ❤️ by Nikita Lyashenko

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published