Skip to content

Latest commit

 

History

History
271 lines (192 loc) · 9.81 KB

README_en.md

File metadata and controls

271 lines (192 loc) · 9.81 KB

English | 日本語

Precautions

  • This app uses information provided by the Japan Meteorological Agency based on its content usage terms. Source:Japan Meteorological Agency homepage(https://www.jma.go.jp/jma/kishou/info/coment.html)
  • Information is edited and processed in accordance with the Japan Meteorological Agency's content usage terms. Source:Japan Meteorological Agency homepage(Same as above)
  • This app uses information provided by P2P earthquake information. Source:P2P地震情報(https://www.p2pquake.net/develop/json_api_v2/#/)
  • We are not responsible for any damage caused by the use of this app. We also do not guarantee the accuracy of the information provided.

App Name: Quake Alert

Site Overview

Site Theme

"Quake Alert" is a real-time warning LINE official account designed to quickly notify users about earthquake information in Japan. When an earthquake occurs in a region registered by the user, they will receive timely information via LINE.

Reason for choosing the theme

background of the matter: Japan is a country where earthquakes occur frequently, so receiving instant information is extremely important. Although there are existing disaster prevention systems, applications with notification and alert functions specific to individual users are still lacking.

Strange things and challenges:

  • It is difficult to respond quickly after an earthquake occurs.
  • There is a lack of personalized earthquake information distribution.
  • I want to easily obtain earthquake information on my smartphone, but push notifications are complicated and difficult to manage.
  • To solve the above issues, we developed a simple and customizable earthquake alert system using LINE.

Target user

  • People who want to obtain earthquake information in real time in Japan.
  • People who live in a specific area and want to know earthquake information for that area as soon as possible.
  • Persons in charge of disaster prevention at home or at work are required to respond quickly in emergencies.

Main usage scenes

  • Immediately after an earthquake occurs, users will receive an immediate notification through LINE, allowing them to respond quickly.
  • Share the earthquake occurrence with your family and colleagues via LINE to prevent secondary disasters.
  • Check information about the area where the earthquake occurred and use it for evacuation and response.

Function list

  • Real-time acquisition of earthquake information (using data provided by the Japan Meteorological Agency via P2P earthquake information).
  • Distribute earthquake information in specific areas by linking with your LINE account.
  • Set alerts for each region (prefecture) desired by the user.

List of technologies used

Frontend Backend Language Framework OS External API Infrastructure IDE Test GitHub Copilot

Infrastructure configuration

alt text

Project setup

Project clone to local

$ git clone https://github.com/24-105/line-quake-quick-alert.git

Install Node.js

## using homebrew
$ brew install node@22

## using volta
$ volta install node@22

Check version

$ node -v
$ npm -v

Install the package

$ npm install

Compile

$ npx tsc

Docker setup

Make directory

$ mkdir -p ./docker/dynamodb
$ mkdir -p ./docker/mysql

Creating and starting multiple containers

$ docker-compose up -d

Check docker container

$ docker-compose ps
$ docker-compose logs dynamodb-local
$ docker-compose logs dynamodb-admin

Create dynamodb table

$ NODE_ENV=local npx ts-node src/migration/dynamodb/channelAccessToken.ts
$ NODE_ENV=local npx ts-node src/migration/dynamodb/quakeHistory.ts

Check if table was created

$ brew install awscli
$ aws dynamodb list-tables --endpoint-url http://localhost:8000

Delete dynamodb table

$ aws dynamodb delete-table --table-name ChannelAccessToken --endpoint-url http://localhost:8000
$ aws dynamodb delete-table --table-name QuakeHistory --endpoint-url http://localhost:8000

Create MySQL database

Log in to MySQL

$ docker exec -it mysql bin/bash
$ mysql -u root -p -h localhost

Create a database

$ CREATE DATABASE quake_alert_bff;

Stopping and removing containers

$ docker-compose down

Compile and run the project

# local mode
$ npm run start:local

# development mode
$ npm run start:dev

# production mode
$ npm run start:prd

# watch mode
$ npm run start:debug

Run tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Recommended commit message

- build: Changes that affect the build system or external dependencies.
- ci: Changes to CI configuration files and scripts.
- docs: Document only changes.
- feat: New features.
- fix: Bug fixes.
- perf: Improved performance.
- refactor: refactoring.
- style: Changes that do not affect the meaning of the code.
- test: Add missing tests or modify existing tests
- chore: others

Powered by NestJS

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

Nest framework TypeScript starter repository.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.