You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update dependencies, enhance API structure, and improve error handling
- Updated various dependencies in Cargo.toml for better performance and security.
- Refactored API structure to improve modularity and maintainability, including the addition of new endpoints for Spotify real-time data and enhanced error handling.
- Improved README documentation to reflect recent changes and provide clearer usage examples.
- Introduced a consistent error handling mechanism across the application.
- Enhanced the organization of modules for better clarity and separation of concerns.
This is a project to track stats on services I use
82
+
This is a Rust-based API for collecting and tracking personal statistics from various services including Spotify, Duolingo, and GitHub. The API provides endpoints to retrieve real-time data and analytics for dashboard visualization.
83
+
84
+
### Project Structure
85
+
86
+
The API follows a clean modular architecture with each service having its own dedicated module:
87
+
88
+
```
89
+
src/modules/
90
+
├── duolingo/
91
+
│ ├── entity.rs # Data structures for Duolingo API responses
92
+
│ ├── handler.rs # HTTP request handlers and endpoints
93
+
│ ├── manager.rs # Business logic and API interactions
94
+
│ └── mod.rs # Module exports and public API
95
+
├── spotify/
96
+
│ ├── entity.rs # Data structures for Spotify API responses
97
+
│ ├── handler.rs # HTTP request handlers and endpoints
98
+
│ ├── manager.rs # Business logic and API interactions
99
+
│ └── mod.rs # Module exports and public API
100
+
└── github/
101
+
├── entity.rs # Data structures for GitHub API responses
102
+
├── handler.rs # HTTP request handlers and endpoints
103
+
├── manager.rs # Business logic and API interactions
104
+
└── mod.rs # Module exports and public API
105
+
```
106
+
107
+
Each module follows a consistent pattern:
108
+
-**Entity**: Defines data structures and types for API responses
109
+
-**Handler**: Contains HTTP route handlers and request/response logic
110
+
-**Manager**: Implements business logic, API calls, and data management
111
+
-**Mod**: Provides clean module exports and public API surface
112
+
113
+
### Recent Improvements
114
+
115
+
The project has been recently refactored to improve code organization and maintainability:
116
+
117
+
-**Separated Manager Logic**: Manager implementations have been moved from `mod.rs` files into dedicated `manager.rs` files
118
+
-**Cleaner Module Structure**: Each `mod.rs` now only contains module declarations and re-exports, making them much more readable
119
+
-**Better Separation of Concerns**: Business logic is now clearly separated from module organization
120
+
-**Improved Maintainability**: Each manager's implementation is now in its own focused file, making it easier to maintain and extend
81
121
82
122
<palign="right">(<ahref="#readme-top">back to top</a>)</p>
83
123
84
124
### Built With
85
125
86
-
* Actix-Web
87
-
* SQLx
88
-
* Redis
89
-
* Reqwest
126
+
***[Rust](https://www.rust-lang.org/)** - Systems programming language for performance and safety
127
+
***[Actix-Web](https://actix.rs/)** - High-performance web framework for Rust
128
+
***[SQLx](https://github.com/launchbadge/sqlx)** - Async SQL toolkit with compile-time checked queries
129
+
***[Redis](https://redis.io/)** - In-memory data structure store for caching
130
+
***[Reqwest](https://github.com/seanmonstar/reqwest)** - HTTP client library for making API requests
131
+
***[Serde](https://serde.rs/)** - Serialization framework for converting data structures
90
132
91
133
<palign="right">(<ahref="#readme-top">back to top</a>)</p>
92
134
@@ -139,8 +181,34 @@ This is an example of how to list things you need to use the software and how to
139
181
<!-- USAGE EXAMPLES -->
140
182
## Usage
141
183
142
-
This is mainly used to track my personal stats to display on a dashboard and for learning.
184
+
This API is designed to collect and aggregate personal statistics from various services for dashboard visualization and analytics. Each module provides specific functionality:
185
+
186
+
### Available Modules
187
+
188
+
- **Duolingo Module**: Tracks language learning progress, streak data, and user statistics
189
+
- **Spotify Module**: Retrieves currently playing tracks, user playlists, top artists/tracks, and listening analytics
0 commit comments