diff --git a/.gitignore b/.gitignore index 4b3d9eb..9ce5739 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,26 @@ node_modules package-lock.json -.env \ No newline at end of file +.env# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/index.js b/index.js deleted file mode 100644 index a02e4f6..0000000 --- a/index.js +++ /dev/null @@ -1,87 +0,0 @@ -const Express = require('express') -const app = Express() -const port = (process.env.PORT || 3030) - -const axios = require('axios') -require('dotenv').config() - -const favicon = require('serve-favicon'); -app.use(favicon(__dirname + '/public/favicon.ico')); - -const hbs = require('hbs') - -hbs.registerPartials(__dirname + '/views/partials') -app.set('view engine', 'hbs') - -app.use(Express.static('public')); - -app.get('/', (req, res) => { - res.render('index') -}) - -app.get('/auth', async (req, res) => { - - async function requestAccessToken() { - try { - const reqData = { - code: req.query.code, - grant_type: "authorization_code", - redirect_uri: "https://telegram-to-notion.herokuapp.com/auth" - } - - const auth = { - Authorization: "Basic " + Buffer.from(`${process.env.NOTION_INTEGRATION_ID}:${process.env.NOTION_INTEGRATION_SECRET}`).toString('base64') - } - - console.log(auth) - - const response = await axios({ - method: "POST", - url: "https://api.notion.com/v1/oauth/token", - data: reqData, - auth: { - username: Buffer.from(process.env.NOTION_INTEGRATION_ID.toString('base64')), - password: Buffer.from(process.env.NOTION_INTEGRATION_SECRET.toString('base64')) - } //THANK YOU https://stackoverflow.com/questions/67534080/notion-api-invalid-client-oauth-integration/68699544#68699544?newreg=949504cf865c4a52b2c0ce7afe936c9b - }) - - console.log(response.status) //400 in positive case - console.log(response.data) - - /** - * access_token: string, - * token_type: string, - * bot_id: string, - * workspace_name: string, - * workspace_icon: string, - * workspace_id: string - */ - - return response - } - catch (error) { - console.log("error") - console.log(error) - - return {status: 400} - } - } - - const response = await requestAccessToken() - - res.render('auth', { - name: "fran", - success: response.status === 200 ? true : false, - data: response.data - }) -}) - -app.get('/privacy-policy', (req, res) => { - res.render('privacy-policy') -}) - -app.get('/terms-of-use', (req, res) => { - res.render('terms-of-use') -}) - -app.listen(port, () => console.log('port', port)) \ No newline at end of file diff --git a/package.json b/package.json index 1ac8c52..120fc85 100644 --- a/package.json +++ b/package.json @@ -1,29 +1,38 @@ { "name": "telegram-to-notion-website", - "version": "1.0.0", - "description": "Website for the Telegram to Notion Bot", - "main": "index.js", - "scripts": { - "dev": "nodemon index.js", - "start": "node index.js" - }, - "keywords": [ - "telegram", - "notion", - "bot", - "website" - ], - "author": "FranP-Code", - "license": "ISC", - "devDependencies": { - "nodemon": "^2.0.15" - }, + "version": "0.1.0", + "private": true, "dependencies": { - "axios": "^0.26.1", - "dotenv": "^16.0.0", - "express": "^4.17.3", - "hbs": "^4.2.0", - "path": "^0.12.7", - "serve-favicon": "^2.5.0" + "@testing-library/jest-dom": "^5.16.4", + "@testing-library/react": "^13.0.1", + "@testing-library/user-event": "^13.5.0", + "react": "^18.0.0", + "react-dom": "^18.0.0", + "react-scripts": "5.0.1", + "web-vitals": "^2.1.4" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] } } diff --git a/public/css/auth.css b/public/css/auth.css deleted file mode 100644 index f5a785c..0000000 --- a/public/css/auth.css +++ /dev/null @@ -1,29 +0,0 @@ -.request-success { - - display: flex; - align-items: center; - - background-color: #ffebcd; - - padding: 3vh 0px 3vh 2vw; - - user-select: all; - -webkit-user-select: all; -} - -.request-success code { - overflow-wrap: anywhere; -} - -.request-success img { - - width: 50px; - - margin-right: 3vw; - - user-select: none; -} - -.request-error { - color: rgb(143, 0, 0) -} \ No newline at end of file diff --git a/public/css/global.css b/public/css/global.css deleted file mode 100644 index c20e0a9..0000000 --- a/public/css/global.css +++ /dev/null @@ -1,21 +0,0 @@ -html, body { - margin: 0; - padding: 0; -} - -body { - margin: 0vh 3vw; - font-family: 'Be Vietnam Pro', sans-serif; -} - -#beta-banner { - background-color: #F38181; - color: #393E46; - - padding: 2vh 0.5vw; - margin: 0px -3vw; -} - -#beta-banner p { - margin: 0; -} \ No newline at end of file diff --git a/public/css/index.css b/public/css/index.css deleted file mode 100644 index 2a346e1..0000000 --- a/public/css/index.css +++ /dev/null @@ -1,26 +0,0 @@ -.main { - display: flex; - flex-direction: column; -} - -.button { - width: fit-content; - - background-color: #4797ff; - color: #fff; - - padding: 2vh 5vw; - - border-radius: 5px; - - text-decoration: none; - font-weight: bold; -} - -ul { - margin-top: 5vh; -} -ul li{ - font-size: 20pt; - font-weight: bold; -} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index b69e332..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/img/auth_copy.svg b/public/img/auth_copy.svg deleted file mode 100644 index 2eb127c..0000000 --- a/public/img/auth_copy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..aa069f2 --- /dev/null +++ b/public/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + React App + + + +
+ + + diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/readme.MD b/readme.MD deleted file mode 100644 index 7d112d8..0000000 --- a/readme.MD +++ /dev/null @@ -1,20 +0,0 @@ -# Telegram to Notion Bot's website - -This is the complementary platform to the [Telegram to Notion Bot](https://t.me/TelegrmToNotionBot). - - - -Right now is on **beta version**, because it haves all the features needed but it needs a little more of styling in the differents pages. - -## Link - -**[Here](https://telegram-to-notion.herokuapp.com) you can visit it** - -## Credits - -- Copy icon from [feather](https://feathericons.com) -- Main font is [Be Vietnam Pro](https://fonts.google.com/specimen/Be+Vietnam+Pro) - -## Additional - -Dont forget to check also the [Telegram to Notion Bot](https://github.com/FranP-code/Telegram-to-Notion-Bot) repository. diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..d7991e6 --- /dev/null +++ b/src/App.js @@ -0,0 +1,8 @@ +function App() { + return ( + <> + + ); +} + +export default App; \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..5d4fdcf --- /dev/null +++ b/src/index.js @@ -0,0 +1,16 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import reportWebVitals from './reportWebVitals'; + +const root = ReactDOM.createRoot(document.getElementById('root')); +root.render( + + + +); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); diff --git a/src/reportWebVitals.js b/src/reportWebVitals.js new file mode 100644 index 0000000..5253d3a --- /dev/null +++ b/src/reportWebVitals.js @@ -0,0 +1,13 @@ +const reportWebVitals = onPerfEntry => { + if (onPerfEntry && onPerfEntry instanceof Function) { + import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + }); + } +}; + +export default reportWebVitals; diff --git a/src/setupTests.js b/src/setupTests.js new file mode 100644 index 0000000..8f2609b --- /dev/null +++ b/src/setupTests.js @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom'; diff --git a/views/auth.hbs b/views/auth.hbs deleted file mode 100644 index bcc32c1..0000000 --- a/views/auth.hbs +++ /dev/null @@ -1,19 +0,0 @@ -{{> global cssFile="auth"}} - - - {{> betaBanner }} -
- {{#if success}} -

Copy the following code on the Telegram chat

-
- copy - {{data.access_token}} -
- {{else}} -
-

There has been an error authorizing the app, please try again

-
- {{/if}} -
- - \ No newline at end of file diff --git a/views/index.hbs b/views/index.hbs deleted file mode 100644 index 398aa23..0000000 --- a/views/index.hbs +++ /dev/null @@ -1,14 +0,0 @@ -{{> global cssFile="index"}} - - - {{> betaBanner }} -
-

Telegram to Notion Bot's website

- Here you can visit it! - -
- \ No newline at end of file diff --git a/views/partials/betaBanner.hbs b/views/partials/betaBanner.hbs deleted file mode 100644 index 54c4b75..0000000 --- a/views/partials/betaBanner.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
-

This website is on beta version. Futures updates will be to make more aesthetic the website for all users. Thanks for the compression

-
\ No newline at end of file diff --git a/views/partials/global.hbs b/views/partials/global.hbs deleted file mode 100644 index 07af0e2..0000000 --- a/views/partials/global.hbs +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - Telegram to Notion Bot - - - \ No newline at end of file diff --git a/views/privacy-policy.hbs b/views/privacy-policy.hbs deleted file mode 100644 index d6e50a2..0000000 --- a/views/privacy-policy.hbs +++ /dev/null @@ -1,138 +0,0 @@ -{{> global }} - - - {{> betaBanner }} -
-

Privacy Policy

-

Last updated: April 11, 2022

-

This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You.

-

We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy. This Privacy Policy has been created with the help of the Privacy Policy Template.

-

Interpretation and Definitions

-

Interpretation

-

The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.

-

Definitions

-

For the purposes of this Privacy Policy:

- -

Collecting and Using Your Personal Data

-

Types of Data Collected

-

Personal Data

-

While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You. Personally identifiable information may include, but is not limited to:

- -

Usage Data

-

Usage Data is collected automatically when using the Service.

-

Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, unique device identifiers and other diagnostic data.

-

When You access the Service by or through a mobile device, We may collect certain information automatically, including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device identifiers and other diagnostic data.

-

We may also collect information that Your browser sends whenever You visit our Service or when You access the Service by or through a mobile device.

-

Use of Your Personal Data

-

The Company may use Personal Data for the following purposes:

- -

We may share Your personal information in the following situations:

- -

Retention of Your Personal Data

-

The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies.

-

The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period of time, except when this data is used to strengthen the security or to improve the functionality of Our Service, or We are legally obligated to retain this data for longer time periods.

-

Transfer of Your Personal Data

-

Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction.

-

Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that transfer.

-

The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of Your data and other personal information.

-

Disclosure of Your Personal Data

-

Business Transactions

-

If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.

-

Law enforcement

-

Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).

-

Other legal requirements

-

The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:

- -

Security of Your Personal Data

-

The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security.

-

Children's Privacy

-

Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We take steps to remove that information from Our servers.

-

If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from a parent, We may require Your parent's consent before We collect and use that information.

-

Links to Other Websites

-

Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit.

-

We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.

-

Changes to this Privacy Policy

-

We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page.

-

We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy.

-

You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.

-

Contact Us

-

If you have any questions about this Privacy Policy, You can contact us:

- -
- \ No newline at end of file diff --git a/views/terms-of-use.hbs b/views/terms-of-use.hbs deleted file mode 100644 index 72c20d8..0000000 --- a/views/terms-of-use.hbs +++ /dev/null @@ -1,24 +0,0 @@ -{{> global cssFile="index"}} - - {{> betaBanner }} -
-

Terms and conditions

-

These terms and conditions (“Agreement”) set forth the general terms and conditions of your use of the “Telegram to Notion Bot” mobile application (“Mobile Application” or “Service”) and any of its related products and services (collectively, “Services”). This Agreement is legally binding between you (“User”, “you” or “your”) and this Mobile Application developer (“Operator”, “we”, “us” or “our”). If you are entering into this agreement on behalf of a business or other legal entity, you represent that you have the authority to bind such entity to this agreement, in which case the terms “User”, “you” or “your” shall refer to such entity. If you do not have such authority, or if you do not agree with the terms of this agreement, you must not accept this agreement and may not access and use the Mobile Application and Services. By accessing and using the Mobile Application and Services, you acknowledge that you have read, understood, and agree to be bound by the terms of this Agreement. You acknowledge that this Agreement is a contract between you and the Operator, even though it is electronic and is not physically signed by you, and it governs your use of the Mobile Application and Services. This terms and conditions policy was created with the help of the terms and conditions generator.

-

Accounts and membership

-

You must be at least 16 years of age to use the Mobile Application and Services. By using the Mobile Application and Services and by agreeing to this Agreement you warrant and represent that you are at least 16 years of age.

-

If you create an account in the Mobile Application, you are responsible for maintaining the security of your account and you are fully responsible for all activities that occur under the account and any other actions taken in connection with it. We may, but have no obligation to, monitor and review new accounts before you may sign in and start using the Services. Providing false contact information of any kind may result in the termination of your account. You must immediately notify us of any unauthorized uses of your account or any other breaches of security. We will not be liable for any acts or omissions by you, including any damages of any kind incurred as a result of such acts or omissions. We may suspend, disable, or delete your account (or any part thereof) if we determine that you have violated any provision of this Agreement or that your conduct or content would tend to damage our reputation and goodwill. If we delete your account for the foregoing reasons, you may not re-register for our Services. We may block your email address and Internet protocol address to prevent further registration.

-

Links to other resources

-

Although the Mobile Application and Services may link to other resources (such as websites, mobile applications, etc.), we are not, directly or indirectly, implying any approval, association, sponsorship, endorsement, or affiliation with any linked resource, unless specifically stated herein. We are not responsible for examining or evaluating, and we do not warrant the offerings of, any businesses or individuals or the content of their resources. We do not assume any responsibility or liability for the actions, products, services, and content of any other third parties. You should carefully review the legal statements and other conditions of use of any resource which you access through a link in the Mobile Application. Your linking to any other off-site resources is at your own risk.

-

Dispute resolution

-

The formation, interpretation, and performance of this Agreement and any disputes arising out of it shall be governed by the substantive and procedural laws of Argentina without regard to its rules on conflicts or choice of law and, to the extent applicable, the laws of Argentina. The exclusive jurisdiction and venue for actions related to the subject matter hereof shall be the courts located in Argentina, and you hereby submit to the personal jurisdiction of such courts. You hereby waive any right to a jury trial in any proceeding arising out of or related to this Agreement. The United Nations Convention on Contracts for the International Sale of Goods does not apply to this Agreement.

-

Changes and amendments

-

We reserve the right to modify this Agreement or its terms related to the Mobile Application and Services at any time at our discretion. When we do, we will revise the updated date at the bottom of this page. We may also provide notice to you in other ways at our discretion, such as through the contact information you have provided.

-

An updated version of this Agreement will be effective immediately upon the posting of the revised Agreement unless otherwise specified. Your continued use of the Mobile Application and Services after the effective date of the revised Agreement (or such other act specified at that time) will constitute your consent to those changes.

-

Acceptance of these terms

-

You acknowledge that you have read this Agreement and agree to all its terms and conditions. By accessing and using the Mobile Application and Services you agree to be bound by this Agreement. If you do not agree to abide by the terms of this Agreement, you are not authorized to access or use the Mobile Application and Services.

-

Contacting us

-

If you have any questions, concerns, or complaints regarding this Agreement, we encourage you to contact us using the details below:

-

franpessano1@gmail.com

-

This document was last updated on April 11, 2022

-
- \ No newline at end of file