Skip to content

Latest commit

 

History

History
96 lines (61 loc) · 2.59 KB

README.md

File metadata and controls

96 lines (61 loc) · 2.59 KB

icon

FurAlert!

Introduction

「FurAlert!」是由民眾與動保救助單位協力共創的動物救助系統,當民眾遇到動物受傷或相關事件,可以透過系統立即通報救助單位尋求協助,或藉由系統通知掌握事件消息。系統致力於提供即時的動物救助服務,促進社區動物與民眾的安全。

Notification Page

Install PostgreSQL

This project uses PostgreSQL, preferably 15.5 or up.

Backup Existing Database

First, create a new database with the name furalert.

Then in the root directory, run the following to restore our existing database: Here we assume the username is postgres.

pg_restore -h localhost -p 5432 -U postgres -v -Fc sql/furalert_db_backup.sql --schema=public -d furalert

Dependencies

The backend directory will be where we run everything from.

cd backend

  1. We initialize a python virtual environment and activate it:
virtualenv venv

source venv/bin/activate

pip install -r requirements.txt

Run Application

Database URL Configuration

In ./backend/schema/database.py, we have define our database configurations, such as username, password. Make the changes necessary to the config to access the database we just restored.

Here we assume the username and password are both the default value postgres.

Run Scripts

cd backend

Open 3 terminals and run each of the following scripts in one of the terminals:

# terminal 1
./run-flask.sh

# terminal 2
./run-celery.sh

# terminal 3
./run-redis.sh
  • run-flask.sh: the flask application
  • run-celery.sh: the celery worker that sends out our notifications. Since notification insertion may take up a lot of time, we separate it to a background process to prevent lagging for the event reporter.
  • run-redis.sh: acts as the broker for celery worker

Note that run-redis.sh has some additional dependencies(ex. curl, tar), since it compiles the stable version of redis on our machine. Make sure to install them when encountering any errors.

Test Application

For testing purposes, we have created a number of accounts.

The following accounts all use the password 1234.

User Accounts

Responder Accounts

Admin Accounts