Skip to content

Commit 4fa1df5

Browse files
authored
Update readme (#11)
* Fix readme * Fix favicon
1 parent b74e11f commit 4fa1df5

15 files changed

+71
-49
lines changed

README.md

+69-36
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,100 @@
11
# KozeGaav Chrome Extension
22

3-
Getting your rides history from [Snapp application][snapppwa].
4-
5-
<img src="assests/Header.png" width="800">
6-
<img src="assests/Info.png" width="800">
7-
8-
Note: you can see count and price of each bar chart on hover:
3+
Getting your rides and food orders history from [Snapp application][snapppwa] and [Snappfood][snappfood].
94

5+
<img src="assests/Summary.png" width="800">
106
<img src="assests/Hours.png" width="800">
7+
<img src="assests/Months.png" width="800">
118

129
# What is Snapp?
1310

14-
You can think of [Iranian version of Uber][snappwiki]. Their public repository is available in [here][snapprepo].
11+
You can think of [Iranian version of Uber][snappwiki]. Their public repository is available [here][snapprepo].
1512

16-
# How the Extension Works?
13+
# What is Snappfood?
1714

18-
1. After installing the extension you need to sign in into your Snapp account.
19-
2. When you open [https://app.snapp.taxi][snapppwa] page a script injects into the HTML `body`.
20-
3. The script read `access-token` from the page and create a new `CustomEvent` with `access-token` and dispatched by `window`.
21-
4. In `contentscript` we listen to the upcoming event message from the injected script. After getting the message, we save `access-token` by using [chrome.storage][chromestorage] API.
22-
5. Every time you click on MySnapp extension's icon we read `access-token` from `chrome.storage` and then set a state in the mounted React component (popup).
23-
6. Now we have `access-token` as a state in our component. When you click on `Let's Go` button, the App is going request to Snapp API with your `access-token`
24-
7. After your data received from Snapp API, we use `chrome.storage` for caching. And for the next time when you click on `Let's Go` button, we show your saved data.
15+
[Snappfood][snappfood] is Iran's leading online food delivery platform, similar to UberEats or DoorDash. It's part of the Snapp! ecosystem, allowing users to order food from thousands of restaurants across Iran.
2516

26-
# Privacy Policy
17+
# Features
2718

28-
**All codes executed on the client-side** and the extension is only for **personal usage**. For analyzing the data we need to get your local `access-token` from the Snapp PWA. After signing in the token will be saved in chrome storage API. You can remove the extension to destroy your `accessToken` completely.
19+
- View your Snapp ride history with detailed statistics
20+
- View your Snappfood order history with detailed statistics
21+
- See your biggest Snappfood order
22+
- View statistics by hour, day, week, month, and year
23+
- View total spending and count for rides/orders
24+
- Beautiful charts and visualizations
25+
- Data caching for faster access
26+
- Automatic update detection for new rides/orders
2927

30-
# Contributing [WIP]
28+
# Installation
3129

32-
Pull requests are welcome. We can discuss what you would like to change.
30+
## Quick Start (Until we publish in Chrome store)
3331

34-
# Installation [WIP]
32+
<img src="assests/Chrome.png" width="800">
3533

36-
Start: (use dist folder to install on Chrome)
34+
1. Unzip the extension, you can download it from GitHub releases or telegram channel
35+
2. Go to Chrome > Extensions > Manage Extensions and enable Developer Mode
36+
3. Click on "Load Unpacked" on Chrome Manage extensions page and choose the unzipped folder
37+
4. Sign in to your Snapp account at [app.snapp.taxi][snapppwa] and your Snappfood account at [snappfood.ir][snappfood]
38+
5. Click on the extension icon in Chrome to view your statistics!
3739

38-
```
39-
cd my-snapp-extension
40+
## Development Setup
41+
42+
Start development server (use dist folder to install on Chrome):
43+
```bash
44+
cd kozegaav
4045
npm ci && cd src/popup && npm ci && cd ../..
4146
npm start
4247
```
4348

44-
Build: (my-snapp-extension.zip)
45-
46-
```
47-
npm run tada
49+
Build extension package:
50+
```bash
51+
npm run tada # Creates kozegaav.zip
4852
```
4953

50-
### Todo
54+
# How the Extension Works?
55+
56+
## For Snapp Rides:
57+
1. After installing the extension you need to sign in to your Snapp account
58+
2. When you open [https://app.snapp.taxi][snapppwa], a script injects into the HTML `body`
59+
3. The script reads `access-token` from the page and creates a new `CustomEvent` with `access-token` and dispatches it via `window`
60+
4. In `contentscript` we listen to the upcoming event message from the injected script. After getting the message, we save `access-token` using [chrome.storage][chromestorage] API
61+
5. Every time you click on the extension's icon, we read `access-token` from `chrome.storage` and set it as a state in the mounted React component (popup)
62+
6. When you click on "Get Snapp Rides", the app requests data from Snapp API with your `access-token`
63+
7. After your data is received, we use `chrome.storage` for caching. Next time you click the button, we first check if there are new rides before fetching all data again
64+
65+
## For Snappfood Orders:
66+
1. Sign in to your Snappfood account at [snappfood.ir][snappfood]
67+
2. When you click "Get Snappfood Orders" in the extension, we use your browser's cookies to authenticate with Snappfood's API
68+
3. The app fetches your order history page by page and processes the data
69+
4. Like with Snapp rides, we cache the data and check for new orders before fetching everything again
70+
5. All data processing happens locally in your browser
71+
72+
# Privacy Policy
5173

52-
- [ ] #feat update new rides manually/automatically (needs to store the last ride id)
53-
- [ ] #feat porting **MySnapp** to Safari Web Extensions [issue [#1][#1]]
54-
- [ ] #feat porting **MySnapp** to Firefox Add-ons (maybe we can use it on Android devices)
74+
**All codes executed on the client-side** and the extension is only for **personal usage**. For analyzing the data:
75+
- For Snapp rides, we need your local `access-token` from the Snapp PWA
76+
- For Snappfood orders, we use your browser's cookies to authenticate with Snappfood
77+
- All authentication data is saved in chrome storage API
78+
- You can remove the extension at any time to destroy all stored data completely
79+
- No data is ever sent to any third-party servers
80+
- All data processing happens locally in your browser
5581

56-
### In Progress
82+
The extension only accesses the minimum required data to show your ride and order statistics. Your privacy and data security are our top priority.
5783

58-
- [ ] add a **scroll to bottom** button to the pages
84+
# Credits & Background
5985

60-
### Done
86+
This extension is a fork and enhancement of [My Snapp](https://github.com/sepehrity/my-snapp-extension), which is no longer maintained. We've built upon the original project by:
87+
- Fixing compatibility with recent Chrome updates
88+
- Adding Snappfood integration
89+
- Adding new statistics and visualizations
90+
- Improving data caching and performance
91+
- Enhancing the user interface
92+
- Implementing automatic update detection
6193

62-
- [x] #bug car charts show duplicate data --- resolved in [!3][!3]
94+
Special thanks to the original My Snapp developers for laying the groundwork for this project.
6395

6496
[snapppwa]: https://app.snapp.taxi
6597
[snappwiki]: https://en.wikipedia.org/wiki/Snapp!
6698
[snapprepo]: https://github.com/snapp-cab
67-
[chromestorage]: https://developer.chrome.com/extensions/storage
99+
[chromestorage]: https://developer.chrome.com/extensions/storage
100+
[snappfood]: https://snappfood.ir

assests/Chrome.png

85.7 KB
Loading

assests/Header.png

-137 KB
Binary file not shown.

assests/Hours.png

117 KB
Loading

assests/Info.png

-1.42 MB
Binary file not shown.

assests/MapboxToken.png

-104 KB
Binary file not shown.

assests/Months.png

181 KB
Loading

assests/Summary.png

131 KB
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"start": "npm-run-all --parallel start:*",
1515
"prebuild": "npm run clean",
1616
"prestart": "npm run clean",
17-
"tada": "bestzip my-snapp-extension.zip dist/*"
17+
"tada": "bestzip kozegaav-extension.zip dist/*"
1818
},
1919
"keywords": [],
2020
"license": "GPL-3.0+",

src/background/background.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const fetchSnappfoodOrders = async (url: string): Promise<any> => {
7878
};
7979

8080
// Listen for messages from content scripts or popup
81-
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
81+
chrome.runtime.onMessage.addListener((message, _, sendResponse) => {
8282
if (message.action === 'fetchSnappfoodOrders') {
8383
fetchSnappfoodOrders(message.url)
8484
.then(data => {

src/popup/public/favicon.ico

22.5 KB
Binary file not shown.

src/popup/public/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<link href="Sahel.css" rel="stylesheet" type="text/css" />
99

1010
<meta name="description" content="Analyze your Snapp rides and snappfood orders" />
11-
<link rel="apple-touch-icon" href="logo192.png" />
1211
<link rel="manifest" href="react-manifest.json" />
1312
<title>KozeGaav</title>
1413
</head>

src/popup/public/logo192.png

-3.05 KB
Binary file not shown.

src/popup/public/logo512.png

-12.1 KB
Binary file not shown.

src/popup/public/react-manifest.json

-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
},
10-
{
11-
"src": "logo192.png",
12-
"type": "image/png",
13-
"sizes": "192x192"
14-
},
15-
{
16-
"src": "logo512.png",
17-
"type": "image/png",
18-
"sizes": "512x512"
199
}
2010
],
2111
"start_url": ".",

0 commit comments

Comments
 (0)