Developer Guide
Backend
Install Guide
Install the latest version of Python.
Install PSQL and ensure that you can enter commands. Run
CREATE USER chatlus;CREATE DATABASE app;in the PSQL terminal.
You also need to give the
chatlususer the necessary permissions on databaseapp, namely creating tables, inserting data and managing the schema. As you are granting permissions on a dev environment where only the backend can access the database,GRANT ALL ON DATABASE app TO chatlus;should suffice. More granular permissions should be granted in a production environment.
Clone the Git repo and run cd backend in your preferred code editor.
Run
pip install -r requirements.txtto get the required dependencies installed (likely requires a venv folder to install correctly.)To enable the map feature, you need an API key for Google Map Tile API. Generate this with a Google account.
Create a file named
.envin/backend, and enter GOOGLE_MAPS_API_KEY=[YOUR API KEY] in it.
Some users have reported an issue where the environment key will not read unless the encoding of
.envisUTF-8. Ensure this is the case if it does not work.
Usage Guide
By default, the API can be accessed at http://127.0.0.1:5000/<api_route>.
Clone the Git repo and run
cd backendin your preferred code editor.Run
flask runto start the backend server.
On first-boot, default users will be added to the database for testing purposes. These are viewable in database_inserts.sql as well as the seedIfEmpty() function.
Example: Developers can log-in with user_0 and sample_password_0 for testing purposes.
Components
Database: PSQL server
Database Connector: Python script that connects the PSQL database to the rest of the backend.
Location Manager: Python script that interfaces with the Location API to pull map data and push it to the frontend.
User Manager: Python script that manages distributing and storing updates to users.
Chatroom Manager: Python script that manages distributing and storing updates to chatrooms.
User Validator: Python script that ensures users have permissions to access any particular resources (chatrooms, profiles, etc.)
Frontend
Technologies are currently Dart and Flutter, as well as Android Studio.
Goes in /frontend/
Prerequisites
Flutter (2.1GB)
Android Studio (1.4GB) + SDK (2.4GB) (And more.)
Install Guide
Install Flutter as described here: https://docs.flutter.dev/install/quick
Install Android Studio as described here: https://developer.android.com/studio/install
Set it up for use with Flutter as described here: https://docs.flutter.dev/platform-integration/android/setup
Test Instructions
Pull this repository and open it with your preferred Code Editor
Run
cd frontendin the terminal.Setup your device for use with Flutter:
Run
flutter emulators --launch [Emulator_Name]to launch your Android Emulator, if applicable.
Run
flutter runin the terminal to open your Android Emulator/Device and run the app.
Build Instructions
Pull this repository and open it with your preferred Code Editor
Run
cd frontendin the terminal.Run
flutter buildin the terminal to compile app.
Developer Goals
Scope of the project is to produce an application (and accompanying backend) that covers all possible User and System requirements as listed in Coursework Item 1.
Helpful Tips
The ‘theme’ folder contains the Chatlus app colours, font styles, padding and spacing presets for easy and consistent styling.