WARAID is a web application designed for emergency assistance, providing alert messages, first-aid chatbot functionalities, file management, news updates, and location-based services. The backend is developed using the Ballerina programming language.
Before running the application, ensure you have the following installed:
- Ballerina (for backend)
- React (for frontend)
- Vite (JavaScript + SWC) (for frontend build)
- npm or yarn (for managing packages)
-
Clone the repository:
git clone https://github.com/VinukaVilhan/iwb236-scriptrippers.git cd WARAID -
Install the frontend dependencies:
npm install
Some backend service needs to have its own Config.toml file which stores the configuration required for the service to run.
-
Navigate to the
alertMsgservice directory:cd Backend/alertMsg -
Create a
Config.tomlfile and add the following configurations for the AWS RDS.host = "<aws-rds-host>" port = "<port>" username = "<username>" password = "<password>" database = "<database_name>"
-
Run the service:
bal run
-
Navigate to the
files-controlservice directory:cd Backend/files-control -
Create a
Config.tomlfile and add the following configurations for OpenAI and AWS S3.openAIToken="<openai_token>" accessKeyId = "<aws-access-key-id>" secretAccessKey = "<aws-secret-access-key>" region = "<aws_bucket_region>" bucketName = "<bucket_name>"
-
Run the service:
bal run
-
Navigate to the
first-aid-chatbotservice directory:cd Backend/first-aid-chatbot -
Create a
Config.tomlfile and add the following configurations for the OpenAI.openaiEndpointUrl = "<endpoint_url>" openaiDeploymentName = "<deployment_name>" openaiApiKey = "<api_key>"
-
Run the service:
bal run
-
Navigate to the
first-aid-chatbotservice directory:cd Backend/first-aid-chatbot -
Run the service:
bal run
-
Navigate to the
location_servicedirectory:cd Backend/location_service -
Create a
Config.tomlfile and add the following configurations for the AWS RDS.host = "<aws-rds-host>" port = "<port>" username = "<username>" password = "<password>" database = "<database_name>"
-
Run the service:
bal run
-
Navigate to the
newsservice directory:cd Backend/news -
Create a
Config.tomlfile and add the following configurations for the newsapi.org API.apiKey = "<API_key>"
-
Run the service:
bal run
The frontend of WARAID is built using Vite, a modern frontend build tool that provides a faster and leaner development experience.
Before running the frontend, ensure that the required Node.js packages are installed.
-
Navigate to the root directory of the project where the
package.jsonfile is located:cd WARAID -
Install the required packages using npm:
npm install
Alternatively, if you are using yarn, you can install the dependencies with:
yarn install
After installing the dependencies, you can start the frontend development server.
-
In the root directory of the project, run the following command:
npm run dev
Or, if using yarn:
yarn dev
-
By default, Vite will start a local development server on port
5173. Open your browser and go to:http://localhost:5173