Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 79 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
ed255c9
Setting up GitHub Classroom Feedback
github-classroom[bot] Dec 4, 2023
b513ab8
Create initial structure
Hyteve Dec 17, 2023
56a4383
Index Page Core Functions
Hyteve Dec 17, 2023
7608d4b
Formatting
Hyteve Dec 17, 2023
fe175c6
polishing index details and colors
Hyteve Dec 17, 2023
4395e16
Merge pull request #2 from software-students-fall2023/Beautify
Hyteve Dec 17, 2023
711d820
Enlarge Logour
Hyteve Dec 17, 2023
46b97b8
Edit Title
Hyteve Dec 17, 2023
4d68bfa
Finished Login and frontend
Hyteve Dec 17, 2023
83cc635
Merge pull request #3 from software-students-fall2023/login
Hyteve Dec 17, 2023
3ceb872
Edit h2
Hyteve Dec 17, 2023
5b52c37
Update login-static.html
Hyteve Dec 17, 2023
c45fde9
Added camera off placeholder
Hyteve Dec 17, 2023
4b2eb70
Adjusted Hover Colors
Hyteve Dec 17, 2023
e0b98ac
Login works, the image and data fetch works, now left is to show the …
EthanSha111 Dec 17, 2023
8b834d7
Merge pull request #4 from software-students-fall2023/Ethanupdate
merrylearninggithub Dec 17, 2023
88619e4
add features: Show photo and message, delete, sign out
EthanSha111 Dec 18, 2023
1cf2a9d
Merge pull request #5 from software-students-fall2023/Ethanupdate
Hyteve Dec 18, 2023
78726bc
Delete app.py
Hyteve Dec 18, 2023
5cb7286
Fixed Cropping&Login
Hyteve Dec 18, 2023
2321292
s
EthanSha111 Dec 18, 2023
33a1454
Merge remote-tracking branch 'origin/main' into Ethanupdate
EthanSha111 Dec 18, 2023
34a3a6f
Fix bugs, add ML for sketchy boy
EthanSha111 Dec 18, 2023
e9c6319
Cartoon transfer
EthanSha111 Dec 18, 2023
9edf38a
Added UI for ML and adjusted login page
Hyteve Dec 18, 2023
ed29ffd
Merge branch 'Ethanupdate' of https://github.com/software-students-fa…
Hyteve Dec 18, 2023
93e9b08
Resolve conflicts
Hyteve Dec 18, 2023
dae7215
Merge pull request #6 from software-students-fall2023/Ethanupdate
Hyteve Dec 18, 2023
254b878
Added requirements, moved temp code.
luoashley Dec 19, 2023
a554d7b
Added requirements, some pytest case(not all)
luoashley Dec 19, 2023
af7d923
Added some pytest case(not all)
luoashley Dec 19, 2023
fc7794f
add dockerfile
luoashley Dec 19, 2023
fe33184
Add tests
luoashley Dec 19, 2023
79f2c22
Add CI
luoashley Dec 19, 2023
6c3e295
Add CI
luoashley Dec 19, 2023
dc90a1f
Add CI
luoashley Dec 19, 2023
69dd654
Add CI
luoashley Dec 19, 2023
66f82ad
Add CI
luoashley Dec 19, 2023
d6d5a93
Add CI
luoashley Dec 19, 2023
497d0f1
Add CI
luoashley Dec 19, 2023
9c44ba4
remove unused code
luoashley Dec 19, 2023
51ad3d1
Docker-compose.yaml
EthanSha111 Dec 19, 2023
65252c9
Merge remote-tracking branch 'origin/main' into Ethanupdate
EthanSha111 Dec 19, 2023
0640c37
robust info update
EthanSha111 Dec 19, 2023
45171d9
Merge pull request #7 from software-students-fall2023/Ethanupdate
luoashley Dec 19, 2023
252909e
Update README.md
EthanSha111 Dec 19, 2023
9895704
Merge pull request #8 from software-students-fall2023/EthanSha111-pat…
EthanSha111 Dec 19, 2023
f7727ed
suppress deprecated buffer
luoashley Dec 19, 2023
2e50986
Merge remote-tracking branch 'origin/main'
luoashley Dec 19, 2023
72b7103
suppress deprecated buffer
luoashley Dec 19, 2023
a013a5f
Added CD to dockerhub
Hyteve Dec 19, 2023
66e7f77
Merge pull request #9 from software-students-fall2023/Add-CD
Hyteve Dec 19, 2023
0c04a75
Add another test
luoashley Dec 19, 2023
a252f94
Merge remote-tracking branch 'origin/main'
luoashley Dec 19, 2023
4ee30ed
Add another test
luoashley Dec 19, 2023
ad174fb
Add more tests. Code coverage over 90%.
luoashley Dec 19, 2023
c85d5c9
Update webappCI-CD.yaml
EthanSha111 Dec 19, 2023
3eb263b
Update requirement.txt
EthanSha111 Dec 19, 2023
007d5f7
Test CD on Server
Hyteve Dec 19, 2023
677fb7f
Merge pull request #10 from software-students-fall2023/Add-CD
Hyteve Dec 19, 2023
46b5e71
Edit ssh key
Hyteve Dec 19, 2023
7ae3709
Update README.md
Hyteve Dec 19, 2023
37db0d3
Update webappCI-CD.yaml
Hyteve Dec 19, 2023
c41e241
Update webappCI-CD.yaml
Hyteve Dec 19, 2023
200506c
Update README.md
Hyteve Dec 19, 2023
f11b45e
Update README.md
Hyteve Dec 19, 2023
63f9738
Add git pull
Hyteve Dec 19, 2023
4e4a8fd
Try venv
Hyteve Dec 19, 2023
9738569
fixed port, update readme
Hyteve Dec 19, 2023
c531fdb
Update README.md
Hyteve Dec 19, 2023
4af174e
Update README.md
Hyteve Dec 19, 2023
5484aab
Update README.md
Hyteve Dec 19, 2023
23aca71
Update README.md
Hyteve Dec 19, 2023
5fd590f
Update README.md
Hyteve Dec 19, 2023
7180e10
How run
merrylearninggithub Dec 20, 2023
8bc5314
Update README.md
merrylearninggithub Dec 20, 2023
81d995d
Update README.md
merrylearninggithub Dec 20, 2023
4266356
Update README.md
Hyteve Dec 21, 2023
550d2be
Update README.md
merrylearninggithub Dec 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/webappCI-CD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Python CI/CD with Docker in Webapp Directory

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build Docker Image in Webapp Directory
run: |
cd webapp
docker build -t webapp .

- name: Run Pytest
run: |
cd webapp
docker run --rm webapp pytest

- name: Run Pytest with Coverage Check
run: |
cd webapp
docker run --rm webapp pytest --cov=./ --cov-report=term --cov-fail-under=80

- name: Run Pytest with Coverage Check
run: |
cd webapp
docker run --rm webapp pytest --cov=./ --cov-report=term --cov-fail-under=80

deployment-on-dockerHub:
needs: build-and-test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Deploy on Docker Hub
uses: docker/build-push-action@v3
with:
context: ./webapp
file: ./webapp/Dockerfile
push: true
tags: hyteve/snap-and-chat:latest

deployment-on-droplet:
needs: deployment-on-dockerHub
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Deploy to Droplet
env:
DROPLET_PASSWORD: ${{ secrets.DROPLET_PASSWORD }}
run: |
sshpass -p $DROPLET_PASSWORD ssh -o StrictHostKeyChecking=no [email protected] "cd 5-final-project-project5dominators && git pull origin main && docker-compose down && docker-compose up --build -d"









8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/5-final-project-project5dominators.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 115 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,116 @@
# Final Project
![CI, CD to Docker Hub, CD to Digital Ocean](https://github.com/software-students-fall2023/5-final-project-project5dominators/actions/workflows/webappCI-CD.yaml/badge.svg)

An exercise to put to practice software development teamwork, subsystem communication, containers, deployment, and CI/CD pipelines. See [instructions](./instructions.md) for details.

## Project Overview

This project involves the development of a unique chat application named "Snap&Chat". The core functionality of this application centers around the integration of real-time messaging with an innovative feature: users are required to send a selfie along with their text messages. This is achieved through a live camera feed, ensuring an interactive and authentic chatting experience. With thoughtful design shoices in UI/UX, as well as a modern and polished styling design, we aim to bring our users a relaxing and fun chatting experience.

The full scope of this app is to function like most chatting apps where users can add friends, DM and create group chats. Due to time limitaion, we decided to implement the core functionality that makes this app stands out the most. Thus, we created a public chatroom, where users can join and drop messages along with their selfies in the chat.

## Key Functionalities:

Live Camera Integration: Users can access their camera directly from the chat interface. This feature is essential for capturing selfies that are sent along with messages, promoting a more genuine and engaging communication experience.

Real-Time Messaging: The application supports real-time text messaging, allowing users to communicate instantly.

Image Processing Capabilities: (Accessed by ticking the "filter" check box)
Sketch Effect: Users have the option to convert their selfies into a sketch format before sending. This is done using image processing techniques such as edge detection and Gaussian blurring.
Cartoon Effect: Another creative feature is the ability to transform selfies into cartoon-style images. This is achieved through a combination of smoothing and edge detection techniques.

Message Deletion: Users can delete their messages from the chat, which then also removes them from the database.

Persistent Chat History: The chat history is stored in a MongoDB database, allowing users to view past conversations when they log in again.

Function to delele any message in the chatroom. (Prevents spamming, mostly by the Pytest bot)

Function to send message/take selfie both by clicking button and pressing Enter.

Function to detect if client's camera is on and prevent user from sending messages if their camera is not on.

Function to join/leave the chatroom.

Function to pick any username and appear next to chat bubbles



## Links

[link to the image on DockerHub ](https://hub.docker.com/repository/docker/hyteve/snap-and-chat/general)


## Deployed WebApp Link

Link to server IP (Useless): http://165.227.106.8:5000/

Because accessing by IP is limited to HTTP, and most browsers only allow camera access on HTTPS websites, our app's core functionality of using camera is gone when using IP address. But it does fulfill the project requirement :)

Link to domain (Inactive): https://snap-and-chat.com

We actually purchased this domain in order to use HTTPS. While setting up redirection routes, we realized that a website needs a SSL certificate to work in HTTPS. We have again purchased a certification for the website, but it is still pending and probably won't be approved in a few days :(


As a result, please use the instructions in the following section to access our app.

## How to setup enviroment
### Ensure you have the required software installed:
- [Python](https://www.python.org/downloads/windows/)
- [Docker](https://docs.docker.com/engine/install/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [MongoDB](https://www.mongodb.com/docs/manual/installation/)
*For MongoDB, If you use MongoDB Cluster, ignore it.* Follow here [MongoDB cluster](https://www.mongodb.com/docs/guides/atlas/cluster/)
```
python --version
docker --version
docker-compose --version
mongo --version # Check MongoDB installation
```

## How to confiure
```
- git clone https://github.com/software-students-fall2023/5-final-project-project5dominators
- cd 5-final-project-project5dominators
```


## How to run
### Bash (Mac & Linux) / Command Prompt (Windows)

```
docker-compose up --build
visit the website on `http://localhost:5000` (Please make sure Carplay is turned off if you are using MacOS, as it will occupy port 5000)
```

## TESTING

Run tests using pytest:
```
pytest
```


## Usage
### Live Camera Integration

Access the camera directly from the chat interface.
Tick the "filter" checkbox for additional image processing options.

### Image Processing Capabilities

Sketch Effect: Convert selfies into a sketch format. (Currently Active)
Cartoon Effect: Transform selfies into cartoon-style images.

### Additional Functionalities

Message Deletion: Delete messages from the chat.
Persistent Chat History: Stored in the MongoDB database.
Prevent Spamming: Functionality to delete any message in the chatroom.
Send Message/Selfie: Click the button or press Enter.
Camera Status Detection: Prevent sending messages if the camera is not on.
Join/Leave Chatroom: Toggle your presence in the chat.
Choose Username: Pick any username to appear next to chat bubbles.

## Team Members
- [Ethan Sha](https://github.com/EthanSha111)
- [Ashley Luo](https://github.com/luoashley)
- [Steve Hai](https://github.com/Hyteve)
- [Merry Cui](https://github.com/merrylearninggithub)
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'

services:
app:
build: ./webapp
ports:
- "5000:5000"
environment:
- MONGO_URI=mongodb+srv://ys4323:[email protected]
- SECRET_KEY=ys4323
networks:
- app-network

networks:
app-network:
driver: bridge
Loading
Loading