HeadHome-Backend

module
v0.0.0-...-9658b47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2023 License: MIT

README ΒΆ

HeadHome

Your companion, every step of the way


HeadHome Backend

The HeadHome backend is responsible for real-time interactions between the dementia patients, caregivers and volunteers. This ensures that dementia patients can receive timely assistance from caregivers or nearby volunteers and help them to head home safely!

πŸ‘¨πŸ»β€πŸ’» Technology Stack



Go | Gin | Firebase | Google Maps Platform | Google Cloud Platform


Getting Started

This repo contains the backend application for HeadHome. Click here to view the full solution.

Go (Version 1.19+) must be installed to run this application.

βš™οΈ Β Steps to Setup

  1. Clone Repo
$ git clone https://github.com/GSC23-HeadHome/HeadHome-Backend.git
  1. Run the following code in bash to install the required dependencies
$ go get all
  1. Create a .env file and insert your Firebase Admin SDK private key and Maps API api key.
    Note: Place the entire Firebase Admin SDK private key json object on a single line and escape all \, \n and quotation(") characters with \. Lastly, surround the json object with double quotations "".
/*.env file*/
FIREBASE_ADMIN_PRIVATE_KEY=<your inline firebase admin private key>
MAPS_API_KEY=<your maps api key>
  1. Launch the server at 0.0.0.0:8080
$ go run ./cmd

πŸ”‘ Β Files and Directories

β”œβ”€β”€ cmd
β”‚Β Β  └──main.go
β”œβ”€β”€ controllers
β”‚Β Β  β”œβ”€β”€ care_giver_controller.go
β”‚Β Β  β”œβ”€β”€ care_receiver_controller.go
β”‚Β Β  β”œβ”€β”€ map_controller.go
β”‚Β Β  β”œβ”€β”€ sos_controller.go
β”‚Β Β  β”œβ”€β”€ travel_log_controller.go
β”‚Β Β  └── volunteers_controller.go
β”œβ”€β”€ database
β”‚Β Β  β”œβ”€β”€ care_giver_collection.go
β”‚Β Β  β”œβ”€β”€ care_receiver_collection.go
β”‚Β Β  β”œβ”€β”€ database.go
β”‚Β Β  β”œβ”€β”€ sos_log_collection.go
β”‚Β Β  β”œβ”€β”€ travel_log_collection.go
β”‚Β Β  └── volunteers_collection.go
β”œβ”€β”€ fcm
β”‚Β Β  └── fcm.go
β”œβ”€β”€ firebase_app
β”‚Β Β  └── firebase_app.go
β”œβ”€β”€ logic
β”‚Β Β  β”œβ”€β”€ direction.go
β”‚Β Β  └── util.go
β”œβ”€β”€ models
β”‚Β Β  β”œβ”€β”€ care_giver.go
β”‚Β Β  β”œβ”€β”€ care_receiver.go
β”‚Β Β  β”œβ”€β”€ sos_log.go
β”‚Β Β  β”œβ”€β”€ travel_log.go
β”‚Β Β  └── volunteers.go
β”œβ”€β”€ routes
β”‚Β Β  └── routes.go
β”œβ”€β”€ websocket.go
β”‚Β Β  β”œβ”€β”€ client.go
β”‚Β Β  β”œβ”€β”€ msg_pump.go
β”‚Β Β  β”œβ”€β”€ websocket.go
β”‚Β Β  └── ws_hub.go
β”œβ”€β”€ .env (not included in github repo)
β”œβ”€β”€ .gitignore
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
└── README.md

πŸ‘₯ Β Contributors

Chay Hui Xiang

Nanyang Technological University

Chang Dao Zheng

Nanyang Technological University

Marc Chern Di Yong

Nanyang Technological University

Ong Jing Xuan

Nanyang Technological University

Directories ΒΆ

Path Synopsis
Package main is the entry point for the backend server of HeadHome-Backend, a project focused on providing a robust and scalable solution to help alleviate the problem of dementia wandering.
Package main is the entry point for the backend server of HeadHome-Backend, a project focused on providing a robust and scalable solution to help alleviate the problem of dementia wandering.
Package database provides functionality for managing the connection and interactions with the Firestore database.
Package database provides functionality for managing the connection and interactions with the Firestore database.
Package fcm implements push notifications for users by leveraging the Firebase Cloud Messaging (FCM) service.
Package fcm implements push notifications for users by leveraging the Firebase Cloud Messaging (FCM) service.
Package firebase_app manages the connection between this server and Firebase, providing initialization and access to the Firebase app instance.
Package firebase_app manages the connection between this server and Firebase, providing initialization and access to the Firebase app instance.
Package logic provides utility functions that serve the business logic of the application.
Package logic provides utility functions that serve the business logic of the application.
Package models provides data models that represent documents in the Firestore collection.
Package models provides data models that represent documents in the Firestore collection.
Package routes provides the implementation of the API routes for the HeadHome-Backend server.
Package routes provides the implementation of the API routes for the HeadHome-Backend server.
Package websocket establishes a websocket between different user types for real-time communication.
Package websocket establishes a websocket between different user types for real-time communication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL