Skip to content

GDSC-Wetox/WetoxRESTful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wetox

"Your detox mate, Wetox"
GDSC-Hongik Project

An iOS service that allows you to understand and share your screen time categories and usage with friends, enabling digital detox together.

🥅 Goals

Among the UN's Sustainable Development Goals, "Ensure healthy lives and promote well-being for all at all ages":

  • Share screen time to encourage healthy smartphone usage through positive competition and feedback.
  • Motivate and stimulate healthy smartphone usage with a badge (or medal) reward system.
  • Protect mental health threatened by smartphone addiction.

📱 Screenshots

💡 Features

  • Screen Time Sharing
    • Share Daily/Weekly screen time for yourself and friends
  • Traffic Light Feature
    • Available Time = 24 hours - Screen Time
    • A lot of available time is green, surpassing half is orange, and below a quarter is red. -The less screen time, the more time spent off the smartphone, providing intuitive and positive feedback on available time
  • Detailed Statistics
    • Track total usage time and time spent in each category
    • Understand the distribution across categories
  • Badges
    • Personalized rewards through AI
    • Analyze apps or categories with significant usage changes to provide personalized rewards

⌨️ How to run

  1. Clone the WetoxRESTful repository to the appropriate location and enter the directory.
    # if you are using HTTPS to clone
    git clone https://github.com/GDSC-Wetox/WetoxRESTful.git
    
    # or...
    
    # if you are using SSH to clone
    git clone git@github.com:GDSC-Wetox/WetoxRESTful.git
    
    cd WetoxRESTful
    
  2. Make sure you are at the branch named release
    git switch release
    
  3. Build projects using gradle.
    ./gradlew clean build
    
  4. The request to the API server is forwarded to 8080 ports, and the request for AI-generated images is forwarded to 5000 ports. The following is an example of a NGINX setup.
    server {
        listen 80;
        server_name api.wetox.dev;
     
        location / {
            proxy_pass http://localhost:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
     
        location /ai {
            proxy_pass http://localhost:5000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
    
  5. Check the environment variables, database settings, and security settings.]
    export GOOGLE_PROJECT_ID=<Google project ID here>
    export GOOGLE_APPLICATION_CREDENTIALS=<Google Application crendential file path here>
    export FIREBASE_CREDENTIALS=<Firebase credential file path here>
    export MY_SQL_DEMO=<MySQL URL here>
    export MY_SQL_DEMO_USER=<MySQL username here>
    export MY_SQL_DEMO_PASSWD=<MySQL password here>
    
  6. Run the built project with the following command.
    nohup java -jar <WetoxRESTful application you built> &
    
  7. It also runs a Python server with the following code. Make sure the AI-generated image has the correct path.
    import os
    import random
    
    from flask import Flask, send_file
    from PIL import Image
    from io import BytesIO
    
    app = Flask(__name__)
    
    @app.route('/ai/image/profile')
    def get_image():
        directory_path = <<Path where AI-generated images are stored>>
        all_files = os.listdir(directory_path)
        png_files = [file for file in all_files if file.lower().endswith('.png')]
        selected_file = random.choice(png_files)
        file_path = os.path.join(directory_path, selected_file)
        image = Image.open(file_path)
        image_io = BytesIO()
        image.save(image_io, format='PNG')
        image_io.seek(0)
        return send_file(image_io, mimetype='image/png')
    
    if __name__ == '__main__':
        app.run(debug=True)
    

🏗️ Architecture

image Users can update their screen time through the Wetox application (screen to update screen time), or check their friends' screen time. The Wetox application communicates with the Wetox REST API server, which is distributed as Compute engine. This allows you to store data entered from users or query friends' data. Your data is stored in the MySQL database and is read or changed according to the needs of the service. Profile using the image generated as an image generation model for Tensor flow, and the generated images are stored in Cloud storage. If an event occurs, such as a friend request, a push notification request is sent to Firebase FCM, and a notification is displayed on the Wetox application user's smartphone. (A screen to receive a friend request notification)

✨ Skills & Tech Stack

Category Item
Environment IntelliJ IDEA
Framework Spring Boot, Spring Security
Library JJWT, Firebase SDK, Google Cloud SDK
Version Control Git, GitHub
Communication Notion, Discord

🫂 Developers

손지석 허혜인
Jiseok Son Hyein Heo

- Authorization, Authentication
- Screentime feature
- Badge feature

- Friendship feature
- Badge feature

Special Thanks to

Designer 김보영

- Logo design
- MainView, ScreenInputView design

Releases

No releases published

Packages

No packages published

Languages