Giter Club home page Giter Club logo

ai-chatbot's Introduction

COMP90018-AI-ChatBot

Demo: https://www.youtube.com/watch?v=SkknioJtfuM

Git Commit Message Standard

Commit Type

- [Feat]      |   What's New
- [Add]       |   Create a capability e.g. feature, test, dependency
- [Cut]       |   Remove a capability e.g. feature, test, dependency
- [Fix]       |   bug fixes
- [Perf]      |   Performance optimisation
- [Style]     |   Code formatting
- [Test]      |   Test case additions or updates
- [Ci]        |   Deployment-related file changes
- [Docs]      |   Changes to document classes
- [Chore]     |   Other types
- [Refactor]  |   Code simplification, removal of redundant code, etc

Backend Debug Mode

flask --app Backend run --host=0.0.0.0 flask --app IMServer.src.app run [NEW]: run docker compose up to auto reload the projects

Actural deployment (Production mode)

  1. install docker
  2. build docker image docker compose up --build
  3. using nginx do reverse proxy to handle gunicorn server

API Doc

https://documenter.getpostman.com/view/17696381/2s9YC1XEqp

Useful Document

Important Notes for android development

  1. Zhihao have refactored the project, everyone must pay close attention to the project structure and naming conventions.
  2. Refer to LoginManager and SharedPreferencesHelper to store some global data.
  3. Refer to LoginActivity - Add loading animations to some buttons using this library: https://github.com/leandroBorgesFerreira/LoadingButtonAndroid#installation
  4. You can look at LoginActivity, SignActivity, and MessageActivity -> handleSendMessage, and the classes in the network package to send network requests. We are using a package called retrofit2.
  5. Refer to MessageActivity's onOptionsItemSelected and setupActionBar to use the Actionbar to display the top title and action bar.
  6. Pay attention to maintaining a visually pleasing distance between the view elements.

Trello Link

https://trello.com/w/chatbot723

Project structure (Android)

Directory Structure

AiChatBot
└───main
    └───java
        └───com
            └───unimelb
                └───aichatbot
                    ├───modules
                    │   ├───account
                    │   │   ├───activity
                    │   │   └───service
                    │   ├───chat
                    │   │   ├───activity
                    │   │   ├───adapter
                    │   │   ├───model
                    │   │   │   └───type
                    │   │   └───service
                    │   ├───chatHistory
                    │   │   ├───adapter
                    │   │   ├───fragment
                    │   │   └───placeholder
                    │   ├───contacts
                    │   │   └───fragment
                    │   ├───profile
                    │   │   └───activity
                    │   ├───searchFriend
                    │   │   ├───fragment
                    │   │   └───model
                    │   └───setting
                    │       └───fragment
                    ├───network
                    └───util

Module Descriptions

account

  • activity: Contains activities related to user accounts such as login, registration, etc.
  • service: Holds services responsible for account operations.

chat

  • activity: Contains the main chat interface activities.
  • adapter: Holds adapters used for RecyclerViews in the chat module.
  • model: Contains data models related to chats.
    • type: Defines different types of chat messages.
  • service: Http Services for handling chat functionalities.

chatHistory

  • adapter: Adapter for the chat history list.
  • fragment: Fragments displaying chat history.
  • placeholder: Placeholder elements for loading or empty states.

contacts

  • fragment: Fragments for the contacts screen.

profile

  • activity: Activities for user profile screens.

searchFriend

  • fragment: Fragments for the friend search interface.
  • model: Data models used in friend search functionalities.

setting

  • fragment: Fragments related to application settings.

network

  • Contains classes related to network operations.

util

  • Utility classes used across the project.

Program flowchart (Android)

graph TD

A[Start App] --> B[Initialize Components]
B --> C{User Signed In?}

C -->|Yes| D[Chat History Page]
C -->|No| E[Show Sign-in/Register Page]

D --> D1[Display Chat History & Rooms]
D -->|Bottom Nav| D2[Friends Page]
D -->|Bottom Nav| D3[Search Friend Page]
D -->|Bottom Nav| D4[Settings Page]

 
D1 -->|User Clicks a Chat/Room| G[Enter Chat/Room]
 

D2 --> H{Tap a Friend?}
 
H -->|Short tap| G
 
H -->|Long tap| IA[Show Operations Menu]


IA --> IB{Select Operation}
IB -->|View Profile| IC[View Friend Profile]
IB -->|Delete| ID[Delete Friend]
IC --> ICD[Done]
ID --> ICD
ICD --> D2
D3 --> K[Display Search Bar]
K --> L{Search Friend?}
L -->|Yes| M[Show Search Results]
L -->|No| K

M --> N{Select a Friend in Results?}
N -->|Yes| G
N -->|No| M

D4 --> P[Display Settings]
P --> Q{Select Option?}
Q -->|Profile| R[Go to Profile Page]
Q -->|Logout| S[Log Out]
 

S --> A[Start App]

E --> S1[User Sign-in]
E --> S2[User Register]

S1 --> T[Redirect to Chat History]
S2 --> U[Registration Process]
U --> V[Redirect to Chat History]

T --> D
V --> D

G --> W[Load Messages]
W --> X[Display Messages]
X --> Y{New Message?}
Y -->|Yes| Z[Add to Chat]
Y -->|No| X

Z --> AA[Send Message]
AA --> AB[Update Message List]
AB --> X

R --> AC[Display Profile]
AC --> AD{Update Name/Avatar?}
AD -->|Yes| AE[Save Changes]
AD -->|No| AC
AE --> AF[Update Profile]
AF --> AC
 
D1 -->|Tap Create New Chat Button| FA[Search AI Bot Page]

 
 

FA --> FB[Select an AI Bot]
FB --> FC[Start New Chat with AI Bot]
FC --> G

Loading

ai-chatbot's People

Contributors

liang-zhihao avatar loading8425 avatar yc2232 avatar haoyangzheng11 avatar holly001 avatar zhihao-liang avatar teresaxiaa avatar gan-cmd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.