├── .babelrc
├── .github
└── FUNDING.yml
├── .gitignore
├── .vscode
└── settings.json
├── Dockerfile
├── LICENSE
├── NOTICE
├── README.md
├── bin
├── dev
└── www
├── docs
├── design
│ ├── animation
│ │ ├── CIDFont
│ │ │ └── AdobeFnt21.lst
│ │ ├── CMap
│ │ │ └── AdobeFnt21.lst
│ │ ├── Enregistrement automatique Adobe After Effects
│ │ │ └── main enregistrement automatique 1.aep
│ │ ├── Font
│ │ │ └── AdobeFnt21.lst
│ │ ├── Icon.png
│ │ ├── main (converted).aep
│ │ └── main (converted)_AME
│ │ │ ├── Composition 1.gif
│ │ │ └── tmpAEtoAMEProject-Composition 1.aep
│ ├── icon
│ │ ├── Icon.png
│ │ └── icon.xd
│ └── marketing
│ │ ├── OpenGraph.png
│ │ ├── Product Hunt – 1.png
│ │ ├── Product Hunt – 2.png
│ │ ├── Product Hunt – 3.png
│ │ ├── Product Hunt – 4.png
│ │ ├── Product Hunt.png
│ │ └── Screenshots.xd
└── videos
│ ├── Icon.png
│ ├── Screen Recording 2022-01-07 at 23.43.38.mov
│ ├── Screen Recording 2022-01-07 at 23.51.53.mov
│ ├── Show.aep
│ ├── Show_AME
│ ├── PHShow_1.mp4
│ ├── RedditShow_1.mp4
│ ├── tmpAEtoAMEProject-PHShow.aep
│ ├── tmpAEtoAMEProject-PHShow_1.aep
│ ├── tmpAEtoAMEProject-RedditShow.aep
│ └── tmpAEtoAMEProject-RedditShow_1.aep
│ └── White _ www.wowa.me.mp3
├── ecosystem.config.js
├── package-lock.json
├── package.json
└── src
├── app.js
├── config.js
├── controller
├── indexController.js
├── pwaController.js
├── searchController.js
└── versionController.js
├── data
└── websites.js
├── public
├── favicon.png
├── fonts
│ ├── gilroy-extrabold-webfont.woff
│ └── gilroy-extrabold-webfont.woff2
├── icon.png
├── images
│ ├── icon.png
│ ├── illustration.png
│ └── loader.gif
├── javascripts
│ ├── auto-complete.js
│ └── micromodal.min.js
├── robots.txt
└── stylesheets
│ ├── pwa.css
│ └── style.css
├── service
├── appDataService.js
├── localDataService.js
└── searchService.js
└── views
├── error.twig
├── index.twig
├── layout.twig
├── partials
├── google-analytics.twig
└── guide-modal.twig
└── pwa
├── manifest.twig
└── pwa.twig
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | ["transform-runtime", {
4 | "polyfill": false,
5 | "regenerator": true
6 | }]
7 | ]
8 | }
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ["https://www.buymeacoffee.com/surfable"]
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.formatOnSave": false
3 | }
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:14
2 |
3 | ARG PM2_PUBLIC_KEY=${PM2_PUBLIC_KEY}
4 | ARG PM2_SECRET_KEY=${PM2_SECRET_KEY}
5 |
6 | WORKDIR /usr/src/app
7 |
8 | COPY . .
9 |
10 | RUN npm install pm2 -g
11 |
12 | ENV PM2_PUBLIC_KEY $PM2_PUBLIC_KEY
13 | ENV PM2_SECRET_KEY $PM2_SECRET_KEY
14 |
15 | RUN npm install
16 | RUN npm run build
17 |
18 | CMD ["pm2-runtime", "ecosystem.config.js"]
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Surfable
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Install any website as an app for a quick access 🖥️
18 |
19 | Surfable.app is a website to be able to install any website as an application.
20 | It is built with `Express.js` and uses `google-play-scraper` package to search in Google Play Store and to get the metadata.
21 |
22 | ### 👉 [Get started](https://surfable.app)
23 |
24 | ## 🤔 How it works
25 |
26 | - Surfable.app creates a Progressive Web App for each website that redirects to an URL
27 | - It uses Google Play Store as a source of data by using apps' names, icons and developer website
28 | - The search also works using Google Play Store data
29 | - Because it uses the developer website as the URL of the app, some URLs can be wrong, but it can be corrected (see the documentation below)
30 | - Some links may be missing on the search (you can make a pull request to add them)
31 |
32 | ## 📖 How to add or update a website
33 |
34 | If you don't know Javascript, just open an [issue](https://github.com/sandoche/Surfable-app/issues) explaining what link you would like to add / edit.
35 | Otherwise just follow the steps below.
36 |
37 | ### Update a website
38 |
39 | If you realize that a website redirects to the wrong URL you can correct it by following these steps:
40 | 1. Search for the app name on Surfable.app
41 | 2. Copy the `appId` from the URL for example in `https://surfable.app/pwa/com.sandoche.gitnews/` it would be `com.sandoche.gitnews`
42 | 3. Edit the following file [`src/data/websites.js`](/src/data/websites.js)
43 | 4. Check if the `appId` does not already exist, if it does, edit the object and if it does not exsit, add a new object like below to the array:
44 | ```js
45 | {
46 | title: 'Twitter',
47 | appId: 'com.twitter.android',
48 | developerWebsite: 'https://twitter.com/',
49 | icon: 'https://lh3.googleusercontent.com/wIf3HtczQDjHzHuu7vezhqNs0zXAG85F7VmP7nhsTxO3OHegrVXlqIh_DWBYi86FTIGk',
50 | },
51 | ```
52 | 5. Note that omitting one of the fields will take the default value from Google Play. You can for example omit the icon field, and the logo will be retrieved from Google Play.
53 | 6. Then just do a pull request
54 |
55 | ### Add a website that does not exist
56 |
57 | If a website could not be found in Google Play, it needs to be added manually.
58 | 1. Edit the following file [`src/data/websites.js`](/src/data/websites.js)
59 | 2. Check if the URL you would like to add does not exist, if it does edit the object, if it does not exist, add a new object like below to the array:
60 | ```js
61 | {
62 | title: 'Kanbanote',
63 | developerWebsite: 'https://www.kanbanote.com/board',
64 | icon: 'https://www.kanbanote.com/assets/app/images/icon_512x512.png',
65 | appId: 'www.kanbanote.com'
66 | },
67 | ```
68 | 3. Note that the appId can be anything except the ones that are already used on Google Play, so putting the website address is a safe choice, also the icon should have a size of 512x512
69 | 4. Then just do a pull request
70 |
71 |
72 | ## ⚙️ How to use
73 |
74 | ### Clone
75 | ```
76 | git clone git@github.com:sandoche/Surfable-app.git
77 | ```
78 |
79 | ### Run
80 |
81 | #### Install
82 |
83 | ```sh
84 | npm install
85 | ```
86 |
87 | #### Usage
88 |
89 | ```sh
90 | npm run start
91 | ```
92 |
93 | #### Development
94 |
95 | ```sh
96 | npm run dev
97 | ```
98 |
99 | ### Deploy to Heroku
100 | Since this project scraps data from Google Play, the number of queries are limited per server, therefore in case of problem we recommend you to host your own instance of Surfable.
101 | [](https://heroku.com/deploy)
102 |
103 | ### Deploy using Docker
104 | ```sh
105 | docker build . -t surfable
106 | docker run -p 3000:80 surfable
107 | ```
108 |
109 | ## Authors
110 |
111 | 👤 **Sandoche ADITTANE & Farbod SARAF**
112 |
113 | * Twitter: [@farbodsaraf](https://twitter.com/farbodsaraf)
114 | * Github: [@sandoche](https://github.com/sandoche)
115 |
116 | ## 🤝 Contributing
117 |
118 | Contributions, issues and feature requests are welcome!
119 |
120 | ## ⭐️ Show your support
121 |
122 | Give a ⭐️ if this project helped you!
123 |
124 | ## ☕️ Buy me a coffee
125 |
126 | If you like this project, feel free to donate: https://www.buymeacoffee.com/surfable
127 |
128 | ## 📝 License
129 |
130 | Copyright © 2022 [Sandoche ADITTANE](https://www.sandoche.com) & [Farbod SARAF](https://farbodsaraf.com/)
131 | This project is [Apache 2.0](/LICENSE) licensed.
132 |
--------------------------------------------------------------------------------
/bin/dev:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /**
4 | * Module dependencies.
5 | */
6 |
7 | var app = require('../src/app');
8 | var debug = require('debug')('surfable-app:server');
9 | var http = require('http');
10 |
11 | /**
12 | * Get port from environment and store in Express.
13 | */
14 |
15 | var port = normalizePort(process.env.PORT || '3000');
16 | app.set('port', port);
17 |
18 | /**
19 | * Create HTTP server.
20 | */
21 |
22 | var server = http.createServer(app);
23 |
24 | /**
25 | * Listen on provided port, on all network interfaces.
26 | */
27 |
28 | server.listen(port);
29 | server.on('error', onError);
30 | server.on('listening', onListening);
31 |
32 | /**
33 | * Normalize a port into a number, string, or false.
34 | */
35 |
36 | function normalizePort(val) {
37 | var port = parseInt(val, 10);
38 |
39 | if (isNaN(port)) {
40 | // named pipe
41 | return val;
42 | }
43 |
44 | if (port >= 0) {
45 | // port number
46 | return port;
47 | }
48 |
49 | return false;
50 | }
51 |
52 | /**
53 | * Event listener for HTTP server "error" event.
54 | */
55 |
56 | function onError(error) {
57 | if (error.syscall !== 'listen') {
58 | throw error;
59 | }
60 |
61 | var bind = typeof port === 'string'
62 | ? 'Pipe ' + port
63 | : 'Port ' + port;
64 |
65 | // handle specific listen errors with friendly messages
66 | switch (error.code) {
67 | case 'EACCES':
68 | console.error(bind + ' requires elevated privileges');
69 | process.exit(1);
70 | break;
71 | case 'EADDRINUSE':
72 | console.error(bind + ' is already in use');
73 | process.exit(1);
74 | break;
75 | default:
76 | throw error;
77 | }
78 | }
79 |
80 | /**
81 | * Event listener for HTTP server "listening" event.
82 | */
83 |
84 | function onListening() {
85 | var addr = server.address();
86 | var bind = typeof addr === 'string'
87 | ? 'pipe ' + addr
88 | : 'port ' + addr.port;
89 | debug('Listening on ' + bind);
90 | }
91 |
--------------------------------------------------------------------------------
/bin/www:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /**
4 | * Module dependencies.
5 | */
6 |
7 | var app = require('../build/app');
8 | var debug = require('debug')('surfable-app:server');
9 | var http = require('http');
10 |
11 | /**
12 | * Get port from environment and store in Express.
13 | */
14 |
15 | var port = normalizePort(process.env.PORT || '3000');
16 | app.set('port', port);
17 |
18 | /**
19 | * Create HTTP server.
20 | */
21 |
22 | var server = http.createServer(app);
23 |
24 | /**
25 | * Listen on provided port, on all network interfaces.
26 | */
27 |
28 | server.listen(port);
29 | server.on('error', onError);
30 | server.on('listening', onListening);
31 |
32 | /**
33 | * Normalize a port into a number, string, or false.
34 | */
35 |
36 | function normalizePort(val) {
37 | var port = parseInt(val, 10);
38 |
39 | if (isNaN(port)) {
40 | // named pipe
41 | return val;
42 | }
43 |
44 | if (port >= 0) {
45 | // port number
46 | return port;
47 | }
48 |
49 | return false;
50 | }
51 |
52 | /**
53 | * Event listener for HTTP server "error" event.
54 | */
55 |
56 | function onError(error) {
57 | if (error.syscall !== 'listen') {
58 | throw error;
59 | }
60 |
61 | var bind = typeof port === 'string'
62 | ? 'Pipe ' + port
63 | : 'Port ' + port;
64 |
65 | // handle specific listen errors with friendly messages
66 | switch (error.code) {
67 | case 'EACCES':
68 | console.error(bind + ' requires elevated privileges');
69 | process.exit(1);
70 | break;
71 | case 'EADDRINUSE':
72 | console.error(bind + ' is already in use');
73 | process.exit(1);
74 | break;
75 | default:
76 | throw error;
77 | }
78 | }
79 |
80 | /**
81 | * Event listener for HTTP server "listening" event.
82 | */
83 |
84 | function onListening() {
85 | var addr = server.address();
86 | var bind = typeof addr === 'string'
87 | ? 'pipe ' + addr
88 | : 'port ' + addr.port;
89 | debug('Listening on ' + bind);
90 | }
91 |
--------------------------------------------------------------------------------
/docs/design/animation/CIDFont/AdobeFnt21.lst:
--------------------------------------------------------------------------------
1 | %!Adobe-FontList 1.20
2 | %Locale:0x409
3 |
4 |
--------------------------------------------------------------------------------
/docs/design/animation/CMap/AdobeFnt21.lst:
--------------------------------------------------------------------------------
1 | %!Adobe-FontList 1.20
2 | %Locale:0x409
3 |
4 |
--------------------------------------------------------------------------------
/docs/design/animation/Enregistrement automatique Adobe After Effects/main enregistrement automatique 1.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/animation/Enregistrement automatique Adobe After Effects/main enregistrement automatique 1.aep
--------------------------------------------------------------------------------
/docs/design/animation/Font/AdobeFnt21.lst:
--------------------------------------------------------------------------------
1 | %!Adobe-FontList 1.20
2 | %Locale:0x409
3 |
4 |
--------------------------------------------------------------------------------
/docs/design/animation/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/animation/Icon.png
--------------------------------------------------------------------------------
/docs/design/animation/main (converted).aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/animation/main (converted).aep
--------------------------------------------------------------------------------
/docs/design/animation/main (converted)_AME/Composition 1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/animation/main (converted)_AME/Composition 1.gif
--------------------------------------------------------------------------------
/docs/design/animation/main (converted)_AME/tmpAEtoAMEProject-Composition 1.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/animation/main (converted)_AME/tmpAEtoAMEProject-Composition 1.aep
--------------------------------------------------------------------------------
/docs/design/icon/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/icon/Icon.png
--------------------------------------------------------------------------------
/docs/design/icon/icon.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/icon/icon.xd
--------------------------------------------------------------------------------
/docs/design/marketing/OpenGraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/OpenGraph.png
--------------------------------------------------------------------------------
/docs/design/marketing/Product Hunt – 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Product Hunt – 1.png
--------------------------------------------------------------------------------
/docs/design/marketing/Product Hunt – 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Product Hunt – 2.png
--------------------------------------------------------------------------------
/docs/design/marketing/Product Hunt – 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Product Hunt – 3.png
--------------------------------------------------------------------------------
/docs/design/marketing/Product Hunt – 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Product Hunt – 4.png
--------------------------------------------------------------------------------
/docs/design/marketing/Product Hunt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Product Hunt.png
--------------------------------------------------------------------------------
/docs/design/marketing/Screenshots.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/design/marketing/Screenshots.xd
--------------------------------------------------------------------------------
/docs/videos/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Icon.png
--------------------------------------------------------------------------------
/docs/videos/Screen Recording 2022-01-07 at 23.43.38.mov:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Screen Recording 2022-01-07 at 23.43.38.mov
--------------------------------------------------------------------------------
/docs/videos/Screen Recording 2022-01-07 at 23.51.53.mov:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Screen Recording 2022-01-07 at 23.51.53.mov
--------------------------------------------------------------------------------
/docs/videos/Show.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show.aep
--------------------------------------------------------------------------------
/docs/videos/Show_AME/PHShow_1.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/PHShow_1.mp4
--------------------------------------------------------------------------------
/docs/videos/Show_AME/RedditShow_1.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/RedditShow_1.mp4
--------------------------------------------------------------------------------
/docs/videos/Show_AME/tmpAEtoAMEProject-PHShow.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/tmpAEtoAMEProject-PHShow.aep
--------------------------------------------------------------------------------
/docs/videos/Show_AME/tmpAEtoAMEProject-PHShow_1.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/tmpAEtoAMEProject-PHShow_1.aep
--------------------------------------------------------------------------------
/docs/videos/Show_AME/tmpAEtoAMEProject-RedditShow.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/tmpAEtoAMEProject-RedditShow.aep
--------------------------------------------------------------------------------
/docs/videos/Show_AME/tmpAEtoAMEProject-RedditShow_1.aep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/Show_AME/tmpAEtoAMEProject-RedditShow_1.aep
--------------------------------------------------------------------------------
/docs/videos/White _ www.wowa.me.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/docs/videos/White _ www.wowa.me.mp3
--------------------------------------------------------------------------------
/ecosystem.config.js:
--------------------------------------------------------------------------------
1 | module.exports = [
2 | {
3 | script: 'bin/www',
4 | name: 'Surfable.app'
5 | }
6 | ]
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "surfable-app",
3 | "description": "Install any website as an app for instant access 🖥️",
4 | "version": "1.0.8",
5 | "scripts": {
6 | "start": "node ./bin/www",
7 | "dev": "nodemon ./bin/dev -e js,twig --exec babel-node --presets es2015,env",
8 | "transpile": "babel --presets es2015,env -d ./build ./src -s",
9 | "copy-assets": "cp -r ./src/views ./build && cp -r ./src/public ./build",
10 | "clean": "rm -rf build && mkdir build",
11 | "build": "npm run clean && npm run transpile && npm run copy-assets"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/sandoche/Surfable-app.git"
16 | },
17 | "keywords": [
18 | "installable-app",
19 | "installable",
20 | "installable-website",
21 | "install",
22 | "website",
23 | "progressive-web-app",
24 | "pwa-apps",
25 | "pwa",
26 | "surfable-app"
27 | ],
28 | "author": "Sandoche ADITTANE & Farbod SARAF",
29 | "license": "Apache-2.0",
30 | "bugs": {
31 | "url": "https://github.com/sandoche/Surfable-app/issues"
32 | },
33 | "homepage": "https://surfable.app/",
34 | "dependencies": {
35 | "babel-plugin-transform-regenerator": "^6.26.0",
36 | "babel-plugin-transform-runtime": "^6.23.0",
37 | "cookie-parser": "~1.4.4",
38 | "crypto-js": "^4.0.0",
39 | "debug": "~2.6.9",
40 | "express": "~4.16.1",
41 | "fuse.js": "^6.4.1",
42 | "google-play-scraper": "git+https://github.com/facundoolano/google-play-scraper.git",
43 | "http-errors": "~1.6.3",
44 | "morgan": "~1.9.1",
45 | "twig": "~0.10.3"
46 | },
47 | "devDependencies": {
48 | "@babel/cli": "^7.4.4",
49 | "@babel/core": "^7.4.5",
50 | "babel-cli": "^6.26.0",
51 | "babel-preset-env": "^1.7.0",
52 | "babel-preset-es2015": "^6.24.1",
53 | "babelify": "^10.0.0",
54 | "nodemon": "^2.0.15"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/app.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var createError = require('http-errors');
18 | var express = require('express');
19 | var path = require('path');
20 | var cookieParser = require('cookie-parser');
21 | var logger = require('morgan');
22 |
23 | var indexController = require('./controller/indexController');
24 | var searchController = require('./controller/searchController');
25 | var pwaController = require('./controller/pwaController');
26 | var versionController = require('./controller/versionController');
27 |
28 | var app = express();
29 |
30 | // view engine setup
31 | app.set('views', path.join(__dirname, 'views'));
32 | app.set('view engine', 'twig');
33 |
34 | app.use(logger('dev'));
35 | app.use(express.json());
36 | app.use(express.urlencoded({ extended: false }));
37 | app.use(cookieParser());
38 | app.use(express.static(path.join(__dirname, 'public')));
39 |
40 | app.use('/', indexController);
41 | app.use('/pwa', pwaController);
42 | app.use('/api/search', searchController);
43 | app.use('/api/version', versionController);
44 |
45 | // catch 404 and forward to error handler
46 | app.use(function(req, res, next) {
47 | next(createError(404));
48 | });
49 |
50 | // error handler
51 | app.use(function(err, req, res, next) {
52 | // set locals, only providing error in development
53 | res.locals.message = err.message;
54 | res.locals.error = req.app.get('env') === 'development' ? err : {};
55 |
56 | // render the error page
57 | res.status(err.status || 500);
58 | res.render('error');
59 | });
60 |
61 | module.exports = app;
62 |
--------------------------------------------------------------------------------
/src/config.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | const config = {
18 | title: "Surfable.app",
19 | short_description: "Install any website as an app",
20 | description: "Install any website as an app for instant access 🖥️",
21 | long_description:
22 | "Use Surfable.app to install any website as an app for a quick access",
23 | keywords: "instalable websites, installable app, installable webapp, pwa",
24 | share: "Use this app to install any website, for example ",
25 | og_title: " Installable Website",
26 | og_description: "A website to install ",
27 | popular: "Most popular",
28 | google_analytics: "G-BJ2EXMJ6WW",
29 | suggestions: [
30 | {
31 | name: "Facebook",
32 | appId: "com.facebook.katana",
33 | image:
34 | "https://lh3.googleusercontent.com/ccWDU4A7fX1R24v-vvT480ySh26AYp97g1VrIB_FIdjRcuQB2JP2WdY7h_wVVAeSpg",
35 | },
36 | {
37 | name: "Instagram",
38 | appId: "com.instagram.android",
39 | image:
40 | "https://lh3.googleusercontent.com/2sREY-8UpjmaLDCTztldQf6u2RGUtuyf6VT5iyX3z53JS4TdvfQlX-rNChXKgpBYMw",
41 | },
42 | {
43 | name: "Gmail",
44 | appId: "com.google.android.gm",
45 | image:
46 | "https://i.imgur.com/DksVG9d.png",
47 | },
48 | {
49 | name: "YouTube",
50 | appId: "com.google.android.youtube",
51 | image:
52 | "https://lh3.googleusercontent.com/lMoItBgdPPVDJsNOVtP26EKHePkwBg-PkuY9NOrc-fumRtTFP4XhpUNk_22syN4Datc",
53 | },
54 | {
55 | name: "Google Calendar",
56 | appId: "com.google.android.calendar",
57 | image:
58 | "https://upload.wikimedia.org/wikipedia/commons/a/a5/Google_Calendar_icon_%282020%29.svg",
59 | },
60 | {
61 | name: "ChatGPT",
62 | appId: "com.openai.chat",
63 | image:
64 | "https://upload.wikimedia.org/wikipedia/commons/0/04/ChatGPT_logo.svg",
65 | },
66 | {
67 | name: "Reddit",
68 | appId: "com.reddit.frontpage",
69 | image:
70 | "https://seeklogo.com/images/R/reddit-logo-23F13F6A6A-seeklogo.com.png",
71 | },
72 | {
73 | name: "Pinterest",
74 | appId: "com.pinterest",
75 | image:
76 | "https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png",
77 | },
78 | {
79 | name: "LinkedIn",
80 | appId: "com.linkedin.android",
81 | image:
82 | "https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/LinkedIn_logo_initials.png/480px-LinkedIn_logo_initials.png",
83 | },
84 | {
85 | name: "Tiktok",
86 | appId: "com.zhiliaoapp.musically",
87 | image:
88 | "https://play-lh.googleusercontent.com/OS-MhSWOPtlUZLt0_UP5TI4juSf0XhyHxGfJa6pA-UIYkZ1BB6QHTZwaMEzZDPqYsmk",
89 | },
90 | {
91 | name: "DuckDuckGo",
92 | appId: "com.duckduckgo.mobile.android",
93 | image:
94 | "https://play-lh.googleusercontent.com/vvjvZn0l16nn8j1KfCAbHlBn7wm6la_55pfxGOW9Wg0ut6C51wKVb3DWJTqSJc-eCnA",
95 | },
96 | {
97 | name: "ProductHunt",
98 | appId: "com.producthuntmobile",
99 | image:
100 | "https://play-lh.googleusercontent.com/hgo4YzPUCb4nhDMcCQXvPKfZVpDZ08Go7HohrS9OORyWsFgDzLmwljADvIFlcU9QMiM",
101 | },
102 | ],
103 | };
104 |
105 | export default config;
106 |
--------------------------------------------------------------------------------
/src/controller/indexController.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var express = require('express');
18 | var router = express.Router();
19 | import config from '../config.js'
20 |
21 | router.get('/', function(req, res, next) {
22 | const protocol = req.headers['x-forwarded-proto'] ? 'https' : 'http';
23 | const fullUrl = protocol + '://' + req.get('host') + req.originalUrl;
24 | res.render('index', { config, url: fullUrl });
25 | });
26 |
27 | module.exports = router;
28 |
--------------------------------------------------------------------------------
/src/controller/pwaController.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var express = require('express');
18 | var router = express.Router();
19 | import getAppData from '../service/appDataService'
20 | import config from '../config.js'
21 | import md5 from 'crypto-js/md5';
22 |
23 | router.get('/:appId', async function (req, res, next) {
24 | try {
25 | const appInfos = await getAppData(req.params.appId);
26 | if (appInfos === null) {
27 | res.render('error', { error: { status: 404 }})
28 | return;
29 | }
30 |
31 | const protocol = req.headers['x-forwarded-proto'] ? 'https' : 'http';
32 | const fullUrl = protocol + '://' + req.get('host') + req.originalUrl;
33 | res.render('pwa/pwa', { data: appInfos, config, fullUrl });
34 | } catch (e) {
35 | res.status(e.status)
36 | res.render('error', { error: e })
37 | }
38 | });
39 |
40 | router.get('/:appId/manifest\.json', async function (req, res, next) {
41 | try {
42 | const appInfos = await getAppData(req.params.appId);
43 | if (appInfos === null) {
44 | res.render('error', { error: { status: 404 }})
45 | return;
46 | }
47 |
48 | res.set('Content-Type', 'application/json');
49 | res.render('pwa/manifest', { data: appInfos });
50 | } catch (e) {
51 | res.status(e.status)
52 | res.render('error', { error: e })
53 | }
54 | });
55 |
56 | router.get('/:appId/service-worker\.js', async function (req, res, next) {
57 | const appInfos = await getAppData(req.params.appId);
58 | const hash = md5(appInfos.title + appInfos.appId + appInfos.icon + appInfos.developerWebsite)
59 |
60 | try {
61 | res.set('Content-Type', 'application/javascript');
62 | res.send(`/*
63 | Copyright 2016 Google Inc. All Rights Reserved.
64 | Licensed under the Apache License, Version 2.0 (the "License");
65 | you may not use this file except in compliance with the License.
66 | You may obtain a copy of the License at
67 | http://www.apache.org/licenses/LICENSE-2.0
68 | Unless required by applicable law or agreed to in writing, software
69 | distributed under the License is distributed on an "AS IS" BASIS,
70 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71 | See the License for the specific language governing permissions and
72 | limitations under the License.
73 | */
74 |
75 | // Names of the two caches used in this version of the service worker.
76 | // Change to v2, etc. when you update any of the local resources, which will
77 | // in turn trigger the install event again.
78 | const PRECACHE = '${req.params.appId}-precache-${hash}-2';
79 | const RUNTIME = 'runtime';
80 |
81 | // A list of local resources we always want to be cached.
82 | const PRECACHE_URLS = [
83 | '/pwa/${req.params.appId}/',
84 | '/pwa/${req.params.appId}/manifest.json',
85 | '/stylesheets/pwa.css'
86 | ];
87 |
88 | // The install handler takes care of precaching the resources we always need.
89 | self.addEventListener('install', event => {
90 | event.waitUntil(
91 | caches.open(PRECACHE)
92 | .then(cache => cache.addAll(PRECACHE_URLS))
93 | .then(self.skipWaiting())
94 | );
95 | });
96 |
97 | // The activate handler takes care of cleaning up old caches.
98 | self.addEventListener('activate', event => {
99 | const currentCaches = [PRECACHE, RUNTIME];
100 | event.waitUntil(
101 | caches.keys().then(cacheNames => {
102 | return cacheNames.filter(cacheName => !currentCaches.includes(cacheName));
103 | }).then(cachesToDelete => {
104 | return Promise.all(cachesToDelete.map(cacheToDelete => {
105 | return caches.delete(cacheToDelete);
106 | }));
107 | }).then(() => self.clients.claim())
108 | );
109 | });
110 |
111 | // The fetch handler serves responses for same-origin resources from a cache.
112 | // If no response is found, it populates the runtime cache with the response
113 | // from the network before returning it to the page.
114 | self.addEventListener('fetch', event => {
115 | // Skip cross-origin requests, like those for Google Analytics.
116 | if (event.request.url.startsWith(self.location.origin)) {
117 | event.respondWith(
118 | caches.match(event.request).then(cachedResponse => {
119 | if (cachedResponse) {
120 | return cachedResponse;
121 | }
122 |
123 | return caches.open(RUNTIME).then(cache => {
124 | return fetch(event.request).then(response => {
125 | // Put a copy of the response in the runtime cache.
126 | return cache.put(event.request, response.clone()).then(() => {
127 | return response;
128 | });
129 | });
130 | });
131 | })
132 | );
133 | }
134 | });`)
135 | } catch (e) {
136 | res.status(e.status)
137 | res.render('error', { error: e })
138 | }
139 | });
140 |
141 | module.exports = router;
--------------------------------------------------------------------------------
/src/controller/searchController.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var express = require('express');
18 | var router = express.Router();
19 | import getResults from '../service/searchService';
20 |
21 | router.get('/', async function(req, res, next) {
22 | const results = await getResults(req.query.q);
23 | res.json(results);
24 | });
25 |
26 | module.exports = router;
27 |
--------------------------------------------------------------------------------
/src/controller/versionController.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var express = require('express');
18 | var router = express.Router();
19 |
20 | router.get('/', function(req, res, next) {
21 | const pjson = require('../../package.json')
22 | return res.json({ version: pjson.version })
23 | });
24 |
25 | module.exports = router;
--------------------------------------------------------------------------------
/src/data/websites.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | const websites = [
18 | {
19 | title: 'Twitter',
20 | appId: 'com.twitter.android',
21 | icon: 'https://www.vhv.rs/dpng/d/146-1461722_twitter-circle-twitter-logo-png-transparent-png.png',
22 | developerWebsite: 'https://twitter.com/'
23 | },
24 | {
25 | title: 'Asana',
26 | appId: 'com.asana.app',
27 | developerWebsite: 'https://app.asana.com/'
28 | },
29 | {
30 | title: 'Facebook',
31 | appId: 'com.facebook.katana',
32 | icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Facebook_Logo_%282019%29.png/600px-Facebook_Logo_%282019%29.png',
33 | developerWebsite: 'https://facebook.com/'
34 | },
35 | {
36 | title: 'Google Calendar',
37 | appId: 'com.google.android.calendar',
38 | icon: 'https://okappyimages.okappy.com/google-calendar-icon.png',
39 | developerWebsite: 'https://calendar.google.com/calendar/u/0/'
40 | },
41 | {
42 | title: 'YouTube',
43 | appId: 'com.google.android.youtube',
44 | icon: 'https://image.similarpng.com/very-thumbnail/2020/07/Youtube-logo-vector-PNG.png',
45 | developerWebsite: 'https://www.youtube.com/'
46 | },
47 | {
48 | title: 'Gmail',
49 | appId: 'com.google.android.gm',
50 | icon: 'https://i.imgur.com/DksVG9d.png',
51 | developerWebsite: 'https://mail.google.com/mail/u/0/#inbox'
52 | },
53 | {
54 | title: 'Reddit',
55 | appId: 'com.reddit.frontpage',
56 | icon: 'https://seeklogo.com/images/R/reddit-logo-23F13F6A6A-seeklogo.com.png',
57 | developerWebsite: 'http://www.reddit.com/'
58 | },
59 | {
60 | title: 'Hackernews',
61 | appId: 'com.manuelmaly.hn',
62 | icon: 'https://play-lh.googleusercontent.com/3khCgkKPv883-k_FLmFE1N4ErpuaRUjUcQrFEn5a447bJqA6I7o8cv3-wvHWNRWa_jPk',
63 | developerWebsite: 'https://news.ycombinator.com/'
64 | },
65 | {
66 | title: 'Google',
67 | appId: 'com.google.android.googlequicksearchbox',
68 | icon: 'https://play-lh.googleusercontent.com/DKoidc0T3T1KvYC2stChcX9zwmjKj1pgmg3hXzGBDQXM8RG_7JjgiuS0CLOh8DUa7as',
69 | developerWebsite: 'https://www.google.com/'
70 | },
71 | {
72 | title: 'Google Keep',
73 | appId: 'com.google.android.keep',
74 | icon: 'https://cdn-icons-png.flaticon.com/512/2965/2965358.png',
75 | developerWebsite: 'https://keep.google.com/u/0/'
76 | },
77 | {
78 | title: 'SoundCloud',
79 | appId: 'com.soundcloud.android',
80 | icon: 'https://spng.pngfind.com/pngs/s/225-2259616_itunes-und-soundcloud-logo-fr-lsterschwestern-subreddit-soundcloud.png',
81 | developerWebsite: 'https://soundcloud.com/'
82 | },
83 | {
84 | title: 'Kanbanote',
85 | developerWebsite: 'https://www.kanbanote.com/board',
86 | icon: 'https://www.kanbanote.com/assets/app/images/icon_512x512.png',
87 | appId: 'www.kanbanote.com'
88 | },
89 | {
90 | title: "Pinterest",
91 | appId: "com.pinterest",
92 | icon: "https://www.freepnglogos.com/uploads/pinterest-logo-emblem-png-11.png",
93 | developerWebsite: 'https://www.pinterest.com/'
94 | },
95 | {
96 | title: "Instagram",
97 | appId: "com.instagram.android",
98 | icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/800px-Instagram_logo_2016.svg.png",
99 | developerWebsite: 'https://www.instagram.com/'
100 | },
101 | {
102 | title: "DuckDuckGo",
103 | appId: "com.duckduckgo.mobile.android",
104 | developerWebsite: 'https://duckduckgo.com/'
105 | },
106 | {
107 | appId: "com.disney.disneyplus",
108 | developerWebsite: 'https://www.disneyplus.com/'
109 | },
110 | {
111 | appId: "com.whatsapp",
112 | developerWebsite: 'https://web.whatsapp.com/'
113 | },
114 | {
115 | appId: "com.discord",
116 | developerWebsite: 'https://discord.com/channels/@me'
117 | },
118 | {
119 | title: "ChatGPT",
120 | appId: "com.openai.chat",
121 | icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/ChatGPT_logo.svg/512px-ChatGPT_logo.svg.png",
122 | developerWebsite: 'https://chat.openai.com/'
123 | }
124 | ]
125 |
126 | export default websites;
127 |
--------------------------------------------------------------------------------
/src/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/favicon.png
--------------------------------------------------------------------------------
/src/public/fonts/gilroy-extrabold-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/fonts/gilroy-extrabold-webfont.woff
--------------------------------------------------------------------------------
/src/public/fonts/gilroy-extrabold-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/fonts/gilroy-extrabold-webfont.woff2
--------------------------------------------------------------------------------
/src/public/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/icon.png
--------------------------------------------------------------------------------
/src/public/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/images/icon.png
--------------------------------------------------------------------------------
/src/public/images/illustration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/images/illustration.png
--------------------------------------------------------------------------------
/src/public/images/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sandoche/Surfable-app/04ab6e1f8f2e74b0c6668ab34c04022b4ea3f062/src/public/images/loader.gif
--------------------------------------------------------------------------------
/src/public/javascripts/auto-complete.js:
--------------------------------------------------------------------------------
1 | // JavaScript autoComplete v1.0.4
2 | // https://github.com/Pixabay/JavaScript-autoComplete
3 | var autoComplete=function(){function e(e){function t(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function o(e,t,o){e.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o)}function s(e,t,o){e.detachEvent?e.detachEvent("on"+t,o):e.removeEventListener(t,o)}function n(e,s,n,l){o(l||document,s,function(o){for(var s,l=o.target||o.srcElement;l&&!(s=t(l,e));)l=l.parentElement;s&&n.call(l,o)})}if(document.querySelector){var l={selector:0,source:0,minChars:3,delay:150,offsetLeft:0,offsetTop:1,cache:1,menuClass:"",renderItem:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var o=new RegExp("("+t.split(" ").join("|")+")","gi");return''+e.replace(o,"$1 ")+"
"},onSelect:function(){}};for(var c in e)e.hasOwnProperty(c)&&(l[c]=e[c]);for(var a="object"==typeof l.selector?[l.selector]:document.querySelectorAll(l.selector),u=0;u0?i.sc.scrollTop=n+i.sc.suggestionHeight+s-i.sc.maxHeight:0>n&&(i.sc.scrollTop=n+s)}else i.sc.scrollTop=0},o(window,"resize",i.updateSC),document.body.appendChild(i.sc),n("autocomplete-suggestion","mouseleave",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&setTimeout(function(){e.className=e.className.replace("selected","")},20)},i.sc),n("autocomplete-suggestion","mouseover",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&(e.className=e.className.replace("selected","")),this.className+=" selected"},i.sc),n("autocomplete-suggestion","mousedown",function(e){if(t(this,"autocomplete-suggestion")){var o=this.getAttribute("data-val");i.value=o,l.onSelect(e,o,this),i.sc.style.display="none"}},i.sc),i.blurHandler=function(){try{var e=document.querySelector(".autocomplete-suggestions:hover")}catch(t){var e=0}e?i!==document.activeElement&&setTimeout(function(){i.focus()},20):(i.last_val=i.value,i.sc.style.display="none",setTimeout(function(){i.sc.style.display="none"},350))},o(i,"blur",i.blurHandler);var r=function(e){var t=i.value;if(i.cache[t]=e,e.length&&t.length>=l.minChars){for(var o="",s=0;st||t>40)&&13!=t&&27!=t){var o=i.value;if(o.length>=l.minChars){if(o!=i.last_val){if(i.last_val=o,clearTimeout(i.timer),l.cache){if(o in i.cache)return void r(i.cache[o]);for(var s=1;s0&&this.registerTriggers.apply(this,t(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return o(n,[{key:"registerTriggers",value:function(){for(var e=this,o=arguments.length,t=Array(o),i=0;i'),!1},l=function(e){if(e.length<=0)return console.warn("MicroModal v0.3.2: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",' '),!1},c=function(e,o){if(l(e),!o)return!0
18 | for(var t in o)s(t)
19 | return!0}
20 | return{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),i=[].concat(t(document.querySelectorAll("["+o.openTrigger+"]"))),a=r(i,o.openTrigger)
21 | if(!0!==o.debugMode||!1!==c(i,a))for(var s in a){var l=a[s]
22 | o.targetModal=s,o.triggers=[].concat(t(l)),new n(o)}},show:function(e,o){var t=o||{}
23 | t.targetModal=e,!0===t.debugMode&&!1===s(e)||(a=new n(t),a.showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}}}()})
24 |
--------------------------------------------------------------------------------
/src/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
--------------------------------------------------------------------------------
/src/public/stylesheets/pwa.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --color-grey-dark: #142533;
3 | --color-grey-medium: #d8d8d8;
4 | --color-grey-light: #f9f9f9;
5 | --color-blue: #2329d6;
6 | --color-blue-medium: #6490f0;
7 |
8 | --font-family-default: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
9 | Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
10 |
11 | --font-size-xl: 52px;
12 | --font-size-lg: 24px;
13 | --font-size-md: 18px;
14 | --font-size-sm: 14px;
15 | }
16 |
17 | /* Global */
18 |
19 | html {
20 | box-sizing: border-box;
21 | }
22 | *,
23 | *:before,
24 | *:after {
25 | box-sizing: inherit;
26 | }
27 |
28 | html,
29 | body {
30 | margin: 0;
31 | padding: 0;
32 | font-family: var(--font-family-default);
33 | color: var(--color-grey-dark);
34 | background-color: var(--color-grey-light);
35 | }
36 |
37 | h1,
38 | h2,
39 | h3,
40 | h4,
41 | h5,
42 | p {
43 | margin: 0;
44 | }
45 |
46 | a,
47 | a:link,
48 | a:hover,
49 | a:visited,
50 | a:active {
51 | color: var(--color-blue);
52 | }
53 |
54 | .header {
55 | box-shadow: 0 4px 24px rgba(32, 43, 54, 0.12);
56 | padding: 8px 16px;
57 | position: fixed;
58 | background-color: #fff;
59 | width: 100%;
60 | top: 0;
61 | left: 0;
62 | }
63 |
64 | .header__title {
65 | white-space: nowrap;
66 | overflow: hidden;
67 | text-overflow: ellipsis;
68 | }
69 |
70 | .header__container {
71 | display: flex;
72 | flex-direction: row;
73 | justify-content: space-between;
74 | align-items: center;
75 | max-width: 930px;
76 | margin: auto;
77 | }
78 |
79 | .header__icons {
80 | min-width: 150px;
81 | text-align: right;
82 | }
83 |
84 | .header__icon {
85 | margin-left: 8px;
86 | display: inline-block;
87 | cursor: pointer;
88 | }
89 |
90 | .main {
91 | margin-top: 60px;
92 | padding: 16px;
93 | max-width: 960px;
94 | margin-left: auto;
95 | margin-right: auto;
96 | }
97 |
98 | .card {
99 | border-radius: 16px;
100 | background-color: #fff;
101 | padding: 24px;
102 | margin-bottom: 16px;
103 | box-shadow: 0 4px 24px rgba(32, 43, 54, 0.08);
104 | }
105 |
106 | .card__text {
107 | font-size: var(--font-size-md);
108 | }
109 |
110 | .emoji {
111 | font-size: 42px;
112 | margin-bottom: 16px;
113 | margin-right: 16px;
114 | float: left;
115 | }
116 |
117 | .emoji-block {
118 | font-size: 42px;
119 | margin-bottom: 16px;
120 | }
121 |
122 | @media (min-width: 600px) {
123 | .emoji {
124 | font-size: 30px;
125 | margin-top: -8px;
126 | }
127 | }
128 |
129 | .card__icon {
130 | height: 42px;
131 | width: 42px;
132 | margin-top: 8px;
133 | margin-bottom: 16px;
134 | margin-right: 16px;
135 | }
136 |
137 | .card__icon-container {
138 | display: grid;
139 | grid-template-columns: 58px 1fr;
140 | align-items: center;
141 | width: 100%;
142 | }
143 |
144 | .button {
145 | cursor: pointer;
146 | display: inline-block;
147 | font-weight: 400;
148 | text-align: center;
149 | white-space: nowrap;
150 | vertical-align: middle;
151 | -webkit-user-select: none;
152 | -moz-user-select: none;
153 | -ms-user-select: none;
154 | user-select: none;
155 | border: 1px solid transparent;
156 | padding: 0.375rem 0.75rem;
157 | font-size: 1rem;
158 | line-height: 1.5;
159 | border-radius: 0.25rem;
160 | transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
161 | border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
162 | text-decoration: none !important;
163 | width: 100%;
164 | }
165 |
166 | .button--light {
167 | color: var(--color-grey-dark) !important;
168 | background-color: #f8f9fa;
169 | border-color: #f8f9fa;
170 | }
171 |
172 | .button--light:hover {
173 | color: var(--color-grey-dark) !important;
174 | background-color: #e2e6ea;
175 | border-color: #e2e6ea;
176 | }
177 |
178 | .card__text--space {
179 | margin-bottom: 8px;
180 | }
181 |
182 | .footer {
183 | font-size: var(--font-size-sm);
184 | display: flex;
185 | justify-content: space-between;
186 | margin-top: 64px;
187 | margin-bottom: 32px;
188 | }
189 |
190 | @media (max-width: 768px) {
191 | .footer {
192 | flex-direction: column-reverse;
193 | align-items: center;
194 | }
195 | }
196 |
197 | .edit-button {
198 | display: inline-block;
199 | padding: 4px 8px 0 8px;
200 | cursor: pointer;
201 | }
202 |
203 | .motive-form {
204 | display: none;
205 | }
206 |
207 | input {
208 | width: 100%;
209 | border: 1px solid var(--color-grey-medium);
210 | border-radius: 3px;
211 | padding: 12px 20px;
212 | box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.05);
213 | }
214 |
215 | input:focus {
216 | outline: none;
217 | border: 1px solid var(--color-blue-medium);
218 | border-radius: 3px;
219 | }
220 |
221 | /**************************\
222 | Basic Modal Styles
223 | \**************************/
224 |
225 | .modal {
226 | font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
227 | helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif;
228 | }
229 |
230 | .modal__overlay {
231 | position: fixed;
232 | top: 0;
233 | left: 0;
234 | right: 0;
235 | bottom: 0;
236 | background: rgba(0, 0, 0, 0.6);
237 | display: flex;
238 | justify-content: center;
239 | align-items: center;
240 | }
241 |
242 | .modal__container {
243 | background-color: #fff;
244 | padding: 30px;
245 | max-width: 500px;
246 | max-height: 100vh;
247 | border-radius: 4px;
248 | overflow-y: auto;
249 | box-sizing: border-box;
250 | }
251 |
252 | .modal__header {
253 | display: flex;
254 | justify-content: space-between;
255 | align-items: center;
256 | background: rgb(255, 255, 255);
257 | background: linear-gradient(
258 | 180deg,
259 | rgba(255, 255, 255, 1) 0%,
260 | rgba(255, 255, 255, 1) 80%,
261 | rgba(255, 255, 255, 0) 100%
262 | );
263 | position: sticky;
264 | top: -30px;
265 | margin: -30px;
266 | padding: 30px;
267 | }
268 |
269 | .modal__title {
270 | margin-top: 0;
271 | margin-bottom: 0;
272 | font-weight: 600;
273 | font-size: 1.25rem;
274 | line-height: 1.25;
275 | box-sizing: border-box;
276 | }
277 |
278 | .modal__close {
279 | background: transparent;
280 | border: 0;
281 | }
282 |
283 | .modal__header .modal__close:before {
284 | content: "\2715";
285 | }
286 |
287 | .modal__content {
288 | margin-top: 2rem;
289 | margin-bottom: 2rem;
290 | line-height: 1.5;
291 | color: rgba(0, 0, 0, 0.8);
292 | }
293 |
294 | .modal__btn {
295 | font-size: 0.875rem;
296 | padding-left: 1rem;
297 | padding-right: 1rem;
298 | padding-top: 0.5rem;
299 | padding-bottom: 0.5rem;
300 | background-color: #e6e6e6;
301 | color: rgba(0, 0, 0, 0.8);
302 | border-radius: 0.25rem;
303 | border-style: none;
304 | border-width: 0;
305 | cursor: pointer;
306 | -webkit-appearance: button;
307 | text-transform: none;
308 | overflow: visible;
309 | line-height: 1.15;
310 | margin: 0;
311 | will-change: transform;
312 | -moz-osx-font-smoothing: grayscale;
313 | -webkit-backface-visibility: hidden;
314 | backface-visibility: hidden;
315 | -webkit-transform: translateZ(0);
316 | transform: translateZ(0);
317 | transition: -webkit-transform 0.25s ease-out;
318 | transition: transform 0.25s ease-out;
319 | transition: transform 0.25s ease-out, -webkit-transform 0.25s ease-out;
320 | }
321 |
322 | .modal__btn:focus,
323 | .modal__btn:hover {
324 | -webkit-transform: scale(1.05);
325 | transform: scale(1.05);
326 | }
327 |
328 | .modal__btn-primary {
329 | background-color: #00449e;
330 | color: #fff;
331 | }
332 |
333 | /**************************\
334 | Demo Animation Style
335 | \**************************/
336 | @keyframes mmfadeIn {
337 | from {
338 | opacity: 0;
339 | }
340 | to {
341 | opacity: 1;
342 | }
343 | }
344 |
345 | @keyframes mmfadeOut {
346 | from {
347 | opacity: 1;
348 | }
349 | to {
350 | opacity: 0;
351 | }
352 | }
353 |
354 | @keyframes mmslideIn {
355 | from {
356 | transform: translateY(15%);
357 | }
358 | to {
359 | transform: translateY(0);
360 | }
361 | }
362 |
363 | @keyframes mmslideOut {
364 | from {
365 | transform: translateY(0);
366 | }
367 | to {
368 | transform: translateY(-10%);
369 | }
370 | }
371 |
372 | .micromodal-slide {
373 | display: none;
374 | }
375 |
376 | .micromodal-slide.is-open {
377 | display: block;
378 | }
379 |
380 | .micromodal-slide[aria-hidden="false"] .modal__overlay {
381 | animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1);
382 | }
383 |
384 | .micromodal-slide[aria-hidden="false"] .modal__container {
385 | animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
386 | }
387 |
388 | .micromodal-slide[aria-hidden="true"] .modal__overlay {
389 | animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1);
390 | }
391 |
392 | .micromodal-slide[aria-hidden="true"] .modal__container {
393 | animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
394 | }
395 |
396 | .micromodal-slide .modal__container,
397 | .micromodal-slide .modal__overlay {
398 | will-change: transform;
399 | }
400 |
401 | .modal__footer {
402 | text-align: right;
403 | }
404 |
405 | @media (max-width: 720px) {
406 | .modal__container {
407 | border-radius: 0 !important;
408 | }
409 | }
410 |
411 | .container {
412 | width: 100%;
413 | padding: 0 16px;
414 | max-width: 930px;
415 | margin: auto;
416 | }
417 |
418 | .installer {
419 | display: none;
420 | }
421 |
422 | .loading {
423 | width: 100vw;
424 | height: 100vh;
425 | justify-content: center;
426 | align-items: center;
427 | display: flex;
428 | flex-direction: column;
429 | }
430 |
431 | .loader {
432 | border: 3px solid hsla(263, 70%, 53%, 0.4);
433 | border-top-color: hsla(263, 70%, 53%, 1);
434 | border-radius: 50%;
435 | width: 3em;
436 | height: 3em;
437 | animation: spin 1s linear infinite;
438 | }
439 |
440 | .loading-text {
441 | margin-top: 24px;
442 | text-align: center;
443 | }
444 |
445 | @keyframes spin {
446 | to {
447 | transform: rotate(360deg);
448 | }
449 | }
450 |
451 | .footer p {
452 | margin: 12px 0;
453 | }
454 |
455 | a {
456 | text-decoration: none;
457 | }
458 |
459 | a:hover {
460 | text-decoration: underline;
461 | }
462 |
--------------------------------------------------------------------------------
/src/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "gilroy-extrabold";
3 | src: url("../fonts/gilroy-extrabold-webfont.woff2") format("woff2"),
4 | url("../fonts/gilroy-extrabold-webfont.woff") format("woff");
5 | font-weight: normal;
6 | font-style: normal;
7 | }
8 |
9 | :root {
10 | --color-grey-light: #f9f9f9;
11 | --color-grey-medium: #d8d8d8;
12 | --color-grey-dark: #243364;
13 | --color-blue-light: #eff3fe;
14 | --color-blue-medium: #6490f0;
15 | --color-blue: #2329d6;
16 |
17 | --font-family-titles: "gilroy-extrabold", "Roboto", "Helvetica", "Arial",
18 | Sans-serif;
19 | --font-family-default: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
20 | Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
21 |
22 | --font-size-xl: 42px;
23 | --font-size-lg: 24px;
24 | --font-size-md: 18px;
25 | --font-size-sm: 14px;
26 | }
27 |
28 | /* Global */
29 |
30 | html {
31 | box-sizing: border-box;
32 | }
33 | *,
34 | *:before,
35 | *:after {
36 | box-sizing: inherit;
37 | }
38 |
39 | html,
40 | body {
41 | margin: 0;
42 | padding: 0;
43 | }
44 |
45 | body {
46 | color: var(--color-grey-dark);
47 | font-family: var(--font-family-default);
48 | font-size: var(--font-size-md);
49 | }
50 |
51 | input {
52 | width: 100%;
53 | border: 1px solid var(--color-grey-medium);
54 | border-radius: 3px;
55 | padding: 12px 20px;
56 | }
57 |
58 | input:focus {
59 | outline: none;
60 | border: 1px solid var(--color-blue-medium);
61 | border-radius: 3px;
62 | }
63 |
64 | a,
65 | a:link,
66 | a:hover,
67 | a:visited,
68 | a:active {
69 | color: var(--color-blue);
70 | }
71 |
72 | .home__icon {
73 | text-align: center;
74 | margin-top: 32px;
75 | }
76 |
77 | .icon {
78 | width: 96px;
79 | height: auto;
80 | margin: 16px auto;
81 | }
82 |
83 | /* Shared */
84 |
85 | .accent {
86 | color: var(--color-blue-medium);
87 | }
88 |
89 | .container {
90 | width: 100%;
91 | padding: 0 16px;
92 | max-width: 720px;
93 | margin: auto;
94 | }
95 |
96 | /* Auto complete */
97 | .autocomplete-suggestions {
98 | text-align: left;
99 | cursor: default;
100 | border: 1px solid #ccc;
101 | border-top: 0;
102 | background: #fff;
103 | box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.5);
104 | position: absolute;
105 | display: none;
106 | z-index: 9999;
107 | max-height: 254px;
108 | overflow: hidden;
109 | overflow-y: auto;
110 | box-sizing: border-box;
111 | border: 1px solid var(--color-grey-medium);
112 | border-radius: 3px;
113 | }
114 | .autocomplete-suggestion {
115 | position: relative;
116 | padding: 0 0.6em;
117 | line-height: 23px;
118 | white-space: nowrap;
119 | overflow: hidden;
120 | text-overflow: ellipsis;
121 | font-size: 1.02em;
122 | color: #333;
123 | }
124 | .autocomplete-suggestion b {
125 | font-weight: normal;
126 | color: #1f8dd6;
127 | }
128 | .autocomplete-suggestion.selected {
129 | background: #f0f0f0;
130 | }
131 |
132 | /* Home */
133 |
134 | .home__title {
135 | text-align: center;
136 | font-family: var(--font-family-titles);
137 | font-size: var(--font-size-xl);
138 | margin-top: 0;
139 | }
140 |
141 | .home__title-link {
142 | display: flex;
143 | justify-content: space-between;
144 | align-items: center;
145 | }
146 |
147 | @media (max-width: 768px) {
148 | .home__title-link {
149 | flex-direction: column;
150 | margin-bottom: 32px;
151 | }
152 | }
153 |
154 | .home__description {
155 | text-align: center;
156 | font-size: var(--font-size-lg);
157 | }
158 |
159 | .autocomplete-suggestion {
160 | display: flex;
161 | padding: 16px;
162 | flex-direction: row;
163 | align-items: center;
164 | font-size: var(--font-size-sm);
165 | }
166 |
167 | .autocomplete-suggestion__icon {
168 | height: 30px;
169 | width: 30px;
170 | margin-right: 8px;
171 | border-radius: 3px;
172 | object-fit: cover;
173 | }
174 |
175 | .footer {
176 | font-size: var(--font-size-sm);
177 | display: flex;
178 | justify-content: space-between;
179 | margin-top: 64px;
180 | margin-bottom: 32px;
181 | }
182 |
183 | @media (max-width: 768px) {
184 | .footer {
185 | flex-direction: column-reverse;
186 | align-items: center;
187 | }
188 | }
189 |
190 | .loader {
191 | background-image: url("/images/loader.gif");
192 | background-size: 20px 20px;
193 | background-position: calc(100% - 10px) center;
194 | background-repeat: no-repeat;
195 | }
196 |
197 | .button {
198 | cursor: pointer;
199 | display: inline-block;
200 | font-weight: 400;
201 | text-align: center;
202 | white-space: nowrap;
203 | vertical-align: middle;
204 | -webkit-user-select: none;
205 | -moz-user-select: none;
206 | -ms-user-select: none;
207 | user-select: none;
208 | border: 1px solid transparent;
209 | padding: 0.375rem 0.75rem;
210 | font-size: 1rem;
211 | line-height: 1.5;
212 | border-radius: 0.25rem;
213 | transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
214 | border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
215 | text-decoration: none !important;
216 | width: 100%;
217 | }
218 |
219 | .button--light {
220 | color: var(--color-grey-dark) !important;
221 | background-color: #f8f9fa;
222 | border-color: #f8f9fa;
223 | }
224 |
225 | .home__applists {
226 | list-style: none;
227 | display: grid;
228 | grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
229 | grid-gap: 32px;
230 | padding: 0;
231 | }
232 |
233 | .home__app {
234 | transform: scale(1);
235 | transition: ease-in-out 0.3s transform;
236 | }
237 |
238 | .home__app:hover {
239 | transform: scale(1.1);
240 | }
241 |
242 | .app {
243 | color: var(--color-blue);
244 | text-decoration: none !important;
245 | text-align: center;
246 | }
247 |
248 | .app__image {
249 | width: 100%;
250 | height: auto;
251 | border-radius: 8px;
252 | }
253 |
254 | .app__name {
255 | font-weight: bold;
256 | font-size: var(--font-size-sm);
257 | margin-top: 0;
258 | text-decoration: none;
259 | }
260 |
261 | .card {
262 | border-radius: 16px;
263 | background-color: #fff;
264 | padding: 24px;
265 | margin-bottom: 64px;
266 | box-shadow: 0 4px 24px rgba(32, 43, 54, 0.08);
267 | }
268 |
269 | .newsletter-section {
270 | margin-top: 64px;
271 | }
272 |
273 | #mc_embed_signup_scroll {
274 | display: flex;
275 | width: 100%;
276 | }
277 |
278 | #mc_embed_signup input.email {
279 | width: 100% !important;
280 | margin-right: 4px !important;
281 | }
282 |
283 | #mc_embed_signup form {
284 | text-align: center;
285 | padding: 10px 0 10px 0;
286 | }
287 | .mc-field-group {
288 | display: inline-block;
289 | } /* positions input field horizontally */
290 | #mc_embed_signup input.email {
291 | font-family: "Open Sans", "Helvetica Neue", Arial, Helvetica, Verdana,
292 | sans-serif;
293 | font-size: 15px;
294 | border: 1px solid #abb0b2;
295 | -webkit-border-radius: 3px;
296 | -moz-border-radius: 3px;
297 | border-radius: 3px;
298 | color: #343434;
299 | background-color: #fff;
300 | box-sizing: border-box;
301 | height: 32px;
302 | padding: 0px 0.4em;
303 | display: inline-block;
304 | margin: 0;
305 | width: 350px;
306 | vertical-align: top;
307 | }
308 | #mc_embed_signup label {
309 | display: block;
310 | font-size: 16px;
311 | padding-bottom: 10px;
312 | font-weight: bold;
313 | }
314 | #mc_embed_signup .clear {
315 | display: inline-block;
316 | } /* positions button horizontally in line with input */
317 | #mc_embed_signup .button {
318 | font-size: 13px;
319 | border: none;
320 | -webkit-border-radius: 3px;
321 | -moz-border-radius: 3px;
322 | border-radius: 3px;
323 | letter-spacing: 0.03em;
324 | color: #fff;
325 | background-color: #aaa;
326 | box-sizing: border-box;
327 | height: 32px;
328 | line-height: 32px;
329 | padding: 0 18px;
330 | display: inline-block;
331 | margin: 0;
332 | transition: all 0.23s ease-in-out 0s;
333 | }
334 | #mc_embed_signup .button:hover {
335 | background-color: #777;
336 | cursor: pointer;
337 | }
338 | #mc_embed_signup div#mce-responses {
339 | float: left;
340 | top: -1.4em;
341 | padding: 0em 0.5em 0em 0.5em;
342 | overflow: hidden;
343 | width: 90%;
344 | margin: 0 5%;
345 | clear: both;
346 | }
347 | #mc_embed_signup div.response {
348 | margin: 1em 0;
349 | padding: 1em 0.5em 0.5em 0;
350 | font-weight: bold;
351 | float: left;
352 | top: -1.5em;
353 | z-index: 1;
354 | width: 80%;
355 | }
356 | #mc_embed_signup #mce-error-response {
357 | display: none;
358 | }
359 | #mc_embed_signup #mce-success-response {
360 | color: #529214;
361 | display: none;
362 | }
363 | #mc_embed_signup label.error {
364 | display: block;
365 | float: none;
366 | width: auto;
367 | margin-left: 1.05em;
368 | text-align: left;
369 | padding: 0.5em 0;
370 | }
371 | @media (max-width: 768px) {
372 | #mc_embed_signup input.email {
373 | width: 100%;
374 | margin-bottom: 5px;
375 | }
376 | #mc_embed_signup .clear {
377 | display: block;
378 | width: 100%;
379 | }
380 | #mc_embed_signup .button {
381 | width: 100%;
382 | margin: 0;
383 | }
384 | }
385 |
386 | .button {
387 | display: flex;
388 | color: #fff;
389 | background: linear-gradient(65deg, #70b5b5 0, #a3cf7f 100%);
390 | display: inline-flex;
391 | letter-spacing: 0px;
392 | font-weight: 700;
393 | line-height: 16px;
394 | text-transform: uppercase;
395 | text-decoration: none !important;
396 | border: none;
397 | border-radius: 2px;
398 | cursor: pointer;
399 | justify-content: center;
400 | padding: 16px 32px;
401 | text-align: center;
402 | white-space: nowrap;
403 | box-shadow: 0 8px 24px rgba(32, 43, 54, 0.12);
404 | transition: all 0.15s ease;
405 | }
406 |
407 | .button:hover {
408 | color: #fff;
409 | box-shadow: 0 8px 24px rgba(32, 43, 54, 0.25);
410 | }
411 |
412 | a {
413 | text-decoration: none;
414 | }
415 |
416 | a:hover {
417 | text-decoration: underline;
418 | }
419 |
--------------------------------------------------------------------------------
/src/service/appDataService.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | import localDataService from './localDataService'
18 |
19 | const gplay = require('google-play-scraper').memoized();
20 |
21 | const getAppData = async (appId) => {
22 | let googlePlayData;
23 |
24 | try {
25 | googlePlayData = await gplay.app({ appId: appId });
26 | } catch (e) {
27 | googlePlayData = {}
28 | }
29 |
30 | const localData = localDataService.getLocalAppData(appId) || {};
31 | const appData = Object.assign(googlePlayData, localData);
32 |
33 | if (!appData.icon && !appData.title && !appData.developerWebsite) {
34 | return null;
35 | }
36 |
37 | return appData;
38 | }
39 |
40 | export default getAppData;
--------------------------------------------------------------------------------
/src/service/localDataService.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | import websites from '../data/websites'
18 | import Fuse from 'fuse.js'
19 |
20 | const getLocalAppData = (appId) => {
21 | return websites.find(website => website.appId === appId);
22 | }
23 |
24 | const searchLocalAppData = (appName) => {
25 | const websitesIndex = new Fuse(websites, {
26 | keys: ['title', 'appId']
27 | })
28 |
29 | return websitesIndex.search(appName)
30 | }
31 |
32 | export default {
33 | getLocalAppData,
34 | searchLocalAppData
35 | };
--------------------------------------------------------------------------------
/src/service/searchService.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 Sandoche ADITTANE & Farbod SARAF
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | import localDataService from './localDataService'
18 | const gplay = require('google-play-scraper').memoized();
19 |
20 | const getResults = async function (query) {
21 | const googlePlayResults = await gplay.search({
22 | term: query,
23 | num: 3
24 | });
25 | const localWebsitesResults = localDataService.searchLocalAppData(query)
26 |
27 | let results = googlePlayResults
28 |
29 | for (const websiteData of localWebsitesResults) {
30 | const website = websiteData.item
31 | const appId = website.appId
32 |
33 | const existingAppIndex = results.findIndex(result => result.appId === appId);
34 |
35 | if (existingAppIndex >= 0) {
36 | results[existingAppIndex] = Object.assign(results[existingAppIndex], website);
37 | } else {
38 | results.push(website)
39 | }
40 | }
41 |
42 | return results;
43 | }
44 |
45 | export default getResults;
46 |
--------------------------------------------------------------------------------
/src/views/error.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Surfable.app | {{error.status}} {{message}}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
49 |
50 |
51 | 🙈
52 | {{error.status}}
53 | {{message}}
54 | {% if error.status == '404' %}
55 | Sorry, we could not find this page
56 | {% endif %}
57 | Search for another app!
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/views/index.twig:
--------------------------------------------------------------------------------
1 | {% extends 'layout.twig' %}
2 |
3 | {% block body %}
4 |
5 |
6 |
7 |
8 | {{ config.title }}
9 | {{ config.description }}
10 |
11 |
12 |
13 |
17 |
27 |
28 |
29 |
30 | Subscribe to our newsletter
31 | We will send you our most important product updates
32 |
33 |
34 |
44 |
56 |
57 |
58 |
59 |
73 | {% endblock %}
74 |
75 | {% block script %}
76 |
77 |
126 | {% include 'partials/google-analytics.twig' %}
127 |
128 |
129 |
132 | {% endblock %}
133 |
--------------------------------------------------------------------------------
/src/views/layout.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ config.title }} | {{ config.short_description }}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | {% block style %}{% endblock %}
35 |
36 |
37 | {% block body %}{% endblock %}
38 | {% block script %}{% endblock %}
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/views/partials/google-analytics.twig:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/views/partials/guide-modal.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 | Installation guide for iOS
12 |
13 | Open https://surfable.app on Safari. Other browsers, such as Chrome, won’t work for this.
14 | Search and find the app that you’re addicted to.
15 | Once you opened, tap the Share button at the bottom of the page.
16 | In the lowest row, scroll until you see “Add to Home Screen” and tap this.
17 | Choose a name for the app on your home screen and press on “Add” to add the app on your home screen.
18 | Now you can open the installed website
19 |
20 | Installation guide for Android
21 |
22 | Open https://surfable.app on Chrome (or any other Chromium based browser such as Brave).
23 | Click on the "Install" button
24 | Click "Add" on the pop-up
25 | Wait a few seconds until it installs, the app will then appear in your app drawer
26 | Now you can open the installed website
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
41 |
--------------------------------------------------------------------------------
/src/views/pwa/manifest.twig:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{ data.title }}",
3 | "short_name": "{{ data.title }}",
4 | "icons": [
5 | {
6 | "src": "{{ data.icon }}",
7 | "sizes": "512x512",
8 | "type": "image/png"
9 | }
10 | ],
11 | "start_url": "/pwa/{{ data.appId }}/",
12 | "scope": "/pwa/{{ data.appId }}/",
13 | "display": "standalone",
14 | "background_color": "#fff",
15 | "theme_color": "#fff"
16 | }
--------------------------------------------------------------------------------
/src/views/pwa/pwa.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{ data.title }}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
81 |
82 |
83 |
84 |
85 |
Click "install" to install this website as an app
86 |
87 |
Install
88 |
Install
89 |
90 |
91 |
❤️
92 |
93 | This service is free, do not hesitate to donate.
94 |
95 |
Donate
96 |
97 |
98 |
This project is open source, feel free to contribute.
99 |
Fork on Github
100 |
101 |
102 |
116 |
117 |
118 |
119 |
Surfable is a free an open-source project.
120 | Feel free to
121 | buy us a coffee
122 |
123 |
124 |
125 | {% include '../partials/guide-modal.twig' %}
126 |
127 |
156 |
157 |
189 |
190 | {% include '../partials/google-analytics.twig' %}
191 |
192 |
--------------------------------------------------------------------------------