Skip to content

Commit f225b38

Browse files
authored
2023 update
1 parent 695cbe1 commit f225b38

File tree

177 files changed

+51197
-66377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+51197
-66377
lines changed

.vscode/settings.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
2-
"window.zoomLevel": 0,
2+
"window.zoomLevel": 1,
33
"files.autoSave": "afterDelay",
44
"git.enableSmartCommit": true,
55
"editor.formatOnSave": true,
66
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
7-
"eslint.alwaysShowStatus": true,
87
"eslint.validate": [
98
"javascript",
9+
"typescript",
10+
"javascriptreact",
11+
"typescriptreact"
1012
],
13+
"eslint.enable": true,
14+
"eslint.packageManager": "yarn",
1115
"editor.codeActionsOnSave": {
1216
"source.fixAll.eslint": true
1317
},
@@ -87,6 +91,6 @@
8791
{
8892
"directory": "./book/1-begin/",
8993
"changeProcessCWD": true
90-
},
91-
],
92-
}
94+
}
95+
]
96+
}

README.md

+60
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,66 @@ The main use cases for this project, besides learning, are:
8383
- To sell online content, such as books.
8484
- To extend it (see our second book, SaaS Boilerplate Book) to start software business.
8585

86+
## Creating a Google OAuth Client
87+
88+
This guide will walk you through the steps to create a Google OAuth client for your application.
89+
90+
#### Prerequisites
91+
92+
Before you begin, make sure you have the following:
93+
94+
- A Google account
95+
- Access to the [Google Cloud Console](https://console.cloud.google.com/)
96+
97+
1. **Sign in to Google Cloud Console:**
98+
99+
- Go to the [Google Cloud Console](https://console.cloud.google.com/).
100+
- Sign in with your Google account or create one if you don't have it.
101+
102+
2. **Create a New Project:**
103+
104+
- Click on the project dropdown in the top navigation bar.
105+
- Click on "New Project."
106+
- Give your project a name and click "Create."
107+
108+
3. **Enable the Google+ API (if required):**
109+
110+
- If you plan to use Google+ Sign-In for authentication, enable the "Google+ API" for your project.
111+
- In the Cloud Console, go to the API & Services > Library.
112+
- Search for "Google+ API" and enable it.
113+
114+
4. **Create OAuth Client ID:**
115+
116+
- In the Cloud Console, navigate to the API & Services > Credentials page.
117+
- Click on "Create Credentials" and then select "OAuth client ID."
118+
- Select the application type, typically "Web application" for a website or web application.
119+
- Fill out the necessary information, such as the name of the OAuth client and authorized redirect URIs (where Google should redirect the user after authentication). You can use `http://localhost` as a redirect URI for development.
120+
- Click "Create" to generate your OAuth client credentials. It will provide you with a client ID and client secret.
121+
122+
123+
## Creating a GitHub Client ID and Client Secret
124+
125+
To create a GitHub Client ID and Client Secret, follow these steps:
126+
127+
1. **Sign in to your GitHub Account:**
128+
If you don't have a GitHub account, [create one](https://github.com/join).
129+
130+
2. **Go to Developer Settings:**
131+
Click on your profile picture in the top right corner of GitHub and select "Settings." In the left sidebar, under "Developer settings," click on "OAuth Apps."
132+
133+
3. **Create a New OAuth App:**
134+
Click on the "Register a new application" button.
135+
136+
4. **Fill in the Application Details:**
137+
You'll be prompted to fill in details about your application:
138+
- **Application Name:** The name of your application.
139+
- **Homepage URL:** The URL to your application's website.
140+
- **Application Description:** A brief description of your application.
141+
- **Authorization callback URL:** This is the URL to which GitHub will redirect users after they authorize your application. For testing purposes, you can use `http://localhost` if you're developing locally.
142+
143+
5. **Generate Your Client ID and Client Secret:**
144+
After you've filled in the details, click the "Register application" button. GitHub will generate a Client ID and Client Secret for your application.
145+
86146

87147
## Run locally
88148

book/1-begin/.eslintrc.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
module.exports = {
2-
parser: 'babel-eslint',
2+
parser: '@babel/eslint-parser',
3+
parserOptions: {
4+
requireConfigFile: false,
5+
babelOptions: {
6+
parserOpts: {
7+
plugins: ['jsx'],
8+
},
9+
},
10+
},
311
extends: ['airbnb', 'plugin:prettier/recommended'],
412
env: {
513
browser: true,
@@ -51,5 +59,12 @@ module.exports = {
5159
extensions: ['.jsx'],
5260
},
5361
],
62+
'react/function-component-definition': [
63+
2,
64+
{
65+
namedComponents: 'arrow-function',
66+
unnamedComponents: 'arrow-function',
67+
},
68+
],
5469
},
5570
};

book/1-begin/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"start": "next start"
99
},
1010
"dependencies": {
11-
"@emotion/cache": "^11.7.1",
12-
"@emotion/react": "^11.9.0",
13-
"@emotion/server": "^11.4.0",
14-
"@emotion/styled": "^11.8.1",
15-
"@mui/icons-material": "^5.8.3",
16-
"@mui/material": "^5.8.3",
17-
"next": "^12.1.6",
18-
"prop-types": "^15.7.2",
19-
"react": "^17.0.2",
20-
"react-dom": "^17.0.2"
11+
"@emotion/cache": "^11.11.0",
12+
"@emotion/react": "^11.11.1",
13+
"@emotion/server": "^11.11.0",
14+
"@emotion/styled": "^11.11.0",
15+
"@mui/icons-material": "^5.14.14",
16+
"@mui/material": "^5.14.14",
17+
"next": "^13.5.6",
18+
"prop-types": "^15.8.1",
19+
"react": "^18.2.0",
20+
"react-dom": "^18.2.0"
2121
},
2222
"devDependencies": {}
2323
}

book/1-begin/test.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[1, 2, 3].map((x) => {
2-
const y = x + 1;
3-
return x * y;
4-
});
2+
const y = x + 1;
3+
return x * y;
4+
});

0 commit comments

Comments
 (0)