


Table of Contents
- User Stories
- Project Description
- Key Features
- Tech Stack
- System Architecture
- Database Schema
- Key Algorithm: User Matching
- Unit Testing
- Installation and Setup
- API Documentation
- Contributing
- Exchange diaries with strangers
- Gain fresh perspectives
- Receive emotional support
- Engage in self-reflection
- Experience mental refreshment
Mood Exchange Diary is a platform that allows users to write and exchange diaries in real-time, fostering self-reflection and emotional support through shared experiences.
- User authentication (login/logout)
- Private diary writing
- Public diary wall
- Real-time diary exchange with others
- Future diary writing to oneself
- Matching algorithm based on user interests and writing style
- Python
- FastAPI (with RESTful API)
- MySQL
- MVC-style architecture
- HTML
- CSS (with media queries for RWD)
- JavaScript
- JWT (JSON Web Tokens)
- WebSocket
- AWS RDS (MySQL)
- Amazon S3
- AWS CloudFront
- MySQL Connection Pool
- Redis-Cache
- Docker
- Nginx
- AWS-Load Balancer
- AWS-Auto Scaling
- Client: Users access the system through various devices (mobile, tablet, desktop).
- Domain Resolution: AWS Route 53 for routing user requests.
- Load Balancing: AWS Load Balancer distributes traffic across multiple Amazon EC2 instances.
- Application Layer:
- Nginx as a reverse proxy server on Amazon EC2 instances
- Backend services written in Python with FastAPI, providing RESTful APIs for user authentication, diary management, and mood tracking
- WebSocket support for real-time bidirectional communication
- Containerized with Docker for easy deployment and scaling
- Database: AWS RDS (MySQL) for data storage
- Content Delivery: AWS CloudFront CDN for global content delivery, with static assets stored in Amazon S3

Our application uses a relational database with the following key tables:
- Stores user information including name, email, password, and avatar URL
- Tracks user matching status and last login time
- Contains user diary entries with title, content, date, and privacy setting
- Allows for image attachments via URL
- Records user mood scores, associated weather, and notes
- Linked to users for mood tracking over time
- Stores messages exchanged between users
- Includes text content and optional image URLs
- Tracks likes on messages
- Associates users with the messages they've liked
- Records matched pairs of users
- Includes match date and status information
- Manages match requests between users
- Tracks request status and relevant timestamps
Key Relationships:
- Users are central, connecting to diary entries, mood entries, messages, and matches
- Diary and mood entries are linked to individual users
- Messages can be liked by multiple users
- User matches and match requests establish connections between users
This schema design supports the core functionalities of our mood exchange diary application, including user interactions, diary management, mood tracking, and the matching system.

The matching algorithm pairs users based on various factors:
Data Collection:
- User diary entries, posting frequency, likes, weather preferences, mood scores
- Similarity Calculation (calculate_similarity):
- Keyword similarity in diary content
- Posting frequency alignment
- Like count balancing
- Weather preference matching
- Mood score complementation
- Weighted Factors: Carefully calibrated for comprehensive matching
- Matching Process: daily_matching function applies similarity algorithm for optimal pairing
- Holistic Approach: Considers writing habits, emotional states, and environmental preferences Aims for meaningful diary exchange experiences
This project implements a comprehensive unit testing strategy to ensure code quality and functional correctness. We use Python's pytest framework for testing. Test Coverage Our unit tests cover the following key components:
Initialization and methods of the User class The calculate_similarity function Diary entry-related functionalities Matching algorithm
Key Test Cases Here's an overview of some crucial test cases:
- test_user_init(): Validates the correct initialization of User objects.
- test_calculate_posting_frequency(): Checks the logic for calculating posting frequency.
- test_get_all_keywords(): Ensures correct keyword extraction from diary entries.
- test_calculate_similarity(): Tests the user similarity calculation functionality.
- test_calculate_similarity_with_target_keyword(): Verifies the impact of target keywords on similarity calculation.
By maintaining and expanding our test suite, we are committed to ensuring the stability and reliability of the project.
Visit https://vancenomad.life/ to use the application.
Our application provides a set of RESTful APIs for attraction search, booking management, and payment processing. To explore the available API routes, you can access our API documentation in the following way: Visit our API documentation page at: https://vancenomad.life/docs
We welcome contributions of all forms! Please see our CONTRIBUTING.md file for more information on how to get started.
###License This project is licensed under the MIT License. See the LICENSE file for details.