๐Ÿ“ฆ microsoft / Web-Dev-For-Beginners

๐Ÿ“„ README.md ยท 191 lines
1
2
3
4
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191<!--
CO_OP_TRANSLATOR_METADATA:
{
  "original_hash": "5301875c55bb305e6046bed3a4fd06d2",
  "translation_date": "2025-08-27T21:10:49+00:00",
  "source_file": "quiz-app/README.md",
  "language_code": "he"
}
-->
# ืืคืœื™ืงืฆื™ื™ืช ื—ื™ื“ื•ื ื™ื

ื”ื—ื™ื“ื•ื ื™ื ื”ืœืœื• ื”ื ื—ื™ื“ื•ื ื™ ื˜ืจื•ื ื•ืื—ืจื™ ื”ืจืฆืื” ืขื‘ื•ืจ ืชื•ื›ื ื™ืช ื”ืœื™ืžื•ื“ื™ื ืœืžื“ืขื™ ื”ื ืชื•ื ื™ื ื‘ื›ืชื•ื‘ืช https://aka.ms/webdev-beginners

## ื”ื•ืกืคืช ืกื˜ ื—ื™ื“ื•ื ื™ื ืžืชื•ืจื’ื

ื”ื•ืกืฃ ืชืจื’ื•ื ืœื—ื™ื“ื•ืŸ ืขืœ ื™ื“ื™ ื™ืฆื™ืจืช ืžื‘ื ื™ ื—ื™ื“ื•ืŸ ืชื•ืืžื™ื ื‘ืชื™ืงื™ื•ืช `assets/translations`. ื”ื—ื™ื“ื•ื ื™ื ื”ืžืงื•ืจื™ื™ื ื ืžืฆืื™ื ื‘-`assets/translations/en`. ื”ื—ื™ื“ื•ื ื™ื ืžื—ื•ืœืงื™ื ืœืžืกืคืจ ืงื‘ื•ืฆื•ืช. ื•ื“ื ืฉื”ืžืกืคื•ืจ ืชื•ืื ืืช ื”ื—ืœืง ื”ืžืชืื™ื ืฉืœ ื”ื—ื™ื“ื•ืŸ. ื™ืฉื ื 40 ื—ื™ื“ื•ื ื™ื ื‘ืกืš ื”ื›ืœ ื‘ืชื•ื›ื ื™ืช ื”ืœื™ืžื•ื“ื™ื ื”ื–ื•, ืขื ื”ืžืกืคื•ืจ ืฉืžืชื—ื™ืœ ืž-0.

  
<details>
<summary>ื›ืš ื ืจืื” ืงื•ื‘ืฅ ืชืจื’ื•ื:</summary>

```
[
    {
        "title": "A title",
        "complete": "A complete button title",
        "error": "An error message upon selecting the wrong answer",
        "quizzes": [
            {
                "id": 1,
                "title": "Title",
                "quiz": [
                    {
                        "questionText": "The question asked",
                        "answerOptions": [
                            {
                                "answerText": "Option 1 title",
                                "isCorrect": true
                            },
                            {
                                "answerText": "Option 2 title",
                                "isCorrect": false
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
```
</details>

ืœืื—ืจ ืขืจื™ื›ืช ื”ืชืจื’ื•ืžื™ื, ืขืจื•ืš ืืช ืงื•ื‘ืฅ index.js ื‘ืชื™ืงื™ื™ืช ื”ืชืจื’ื•ื ื›ื“ื™ ืœื™ื™ื‘ื ืืช ื›ืœ ื”ืงื‘ืฆื™ื ื‘ื”ืชืื ืœื”ื ื—ื™ื•ืช ื‘-`en`.

ืขืจื•ืš ืืช ื”ืงื•ื‘ืฅ `index.js` ื‘-`assets/translations` ื›ื“ื™ ืœื™ื™ื‘ื ืืช ื”ืงื‘ืฆื™ื ื”ืžืชื•ืจื’ืžื™ื ื”ื—ื“ืฉื™ื.

ืœื“ื•ื’ืžื”, ืื ืงื•ื‘ืฅ ื”-JSON ืฉืœ ื”ืชืจื’ื•ื ืฉืœืš ื”ื•ื `ex.json`, ื”ืคื•ืš ืืช 'ex' ืœืžืคืชื— ื”ืœื•ืงืœื™ื–ืฆื™ื”, ื•ืื– ื”ื›ื ืก ืื•ืชื• ื›ืคื™ ืฉืžื•ืฆื’ ืœืžื˜ื” ื›ื“ื™ ืœื™ื™ื‘ื ืื•ืชื•:

<details>
<summary>index.js</summary>

```
import ex from "./ex.json";

// if 'ex' is localization key then enter it like so in `messages` to expose it 

const messages = {
  ex: ex[0],
};

export default messages;
```

</details>

## ื”ืจืฅ ืืช ืืคืœื™ืงืฆื™ื™ืช ื”ื—ื™ื“ื•ื ื™ื ื‘ืื•ืคืŸ ืžืงื•ืžื™

### ื“ืจื™ืฉื•ืช ืžื•ืงื“ืžื•ืช

- ื—ืฉื‘ื•ืŸ GitHub
- [Node.js ื•-Git](https://nodejs.org/)

### ื”ืชืงื ื” ื•ื”ื’ื“ืจื”

1. ืฆื•ืจ ืžืื’ืจ ืžื”ืชื‘ื ื™ืช ื”ื–ื• [ื›ืืŸ](https://github.com/new?template_name=Web-Dev-For-Beginners&template_owner=microsoft) 

1. ืฉื™ื‘ื˜ ืืช ื”ืžืื’ืจ ื”ื—ื“ืฉ ืฉืœืš, ื•ืขื‘ื•ืจ ืœืืคืœื™ืงืฆื™ื™ืช ื”ื—ื™ื“ื•ื ื™ื

   ```bash
   git clone https://github.com/your-github-organization/repo-name
   cd repo-name/quiz-app
   ```

1. ื”ืชืงืŸ ืืช ื—ื‘ื™ืœื•ืช ื”-npm ื•ื”ืชืœื•ื™ื•ืช

   ```bash
   npm install
   ```

### ื‘ื ื™ื™ืช ื”ืืคืœื™ืงืฆื™ื”

1. ื›ื“ื™ ืœื‘ื ื•ืช ืืช ื”ืคืชืจื•ืŸ, ื”ืจืฅ:

   ```bash
   npm run build
   ```

### ื”ืคืขืœืช ื”ืืคืœื™ืงืฆื™ื”

1. ื›ื“ื™ ืœื”ืคืขื™ืœ ืืช ื”ืคืชืจื•ืŸ, ื”ืจืฅ:

    ```bash
    npm run dev
    ```

### [ืื•ืคืฆื™ื•ื ืœื™] ื‘ื“ื™ืงืช ืงื•ื“

1. ื›ื“ื™ ืœื•ื•ื“ื ืฉื”ืงื•ื“ ื ื‘ื“ืง, ื”ืจืฅ:

    ```bash
    npm run lint
    ```

## ืคืจื™ืกืช ืืคืœื™ืงืฆื™ื™ืช ื”ื—ื™ื“ื•ื ื™ื ืœ-Azure 

### ื“ืจื™ืฉื•ืช ืžื•ืงื“ืžื•ืช
- ืžื ื•ื™ Azure. ื”ื™ืจืฉื ืœืžื ื•ื™ ื—ื™ื ืžื™ [ื›ืืŸ](https://aka.ms/azure-free).

    _ื”ืขืจื›ืช ืขืœื•ืช ืœืคืจื™ืกืช ืืคืœื™ืงืฆื™ื™ืช ื”ื—ื™ื“ื•ื ื™ื ื”ื–ื•: ื—ื™ื ื_

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.StaticApp)

ืœืื—ืจ ืฉื ื›ื ืกืช ืœ-Azure ื“ืจืš ื”ืงื™ืฉื•ืจ ืœืžืขืœื”, ื‘ื—ืจ ืžื ื•ื™ ื•ืงื‘ื•ืฆืช ืžืฉืื‘ื™ื ื•ืื–:

- ืคืจื˜ื™ ืืคืœื™ืงืฆื™ื™ืช ื”ืื™ื ื˜ืจื ื˜ ื”ืกื˜ื˜ื™ืช: ืกืคืง ืฉื ื•ื‘ื—ืจ ืชื•ื›ื ื™ืช ืื™ืจื•ื—
- ื›ื ื™ืกื” ืœ-GitHub: ื”ื’ื“ืจ ืืช ืžืงื•ืจ ื”ืคืจื™ืกื” ืฉืœืš ื›-GitHub ื•ืื– ื”ืชื—ื‘ืจ ื•ืžืœื ืืช ื”ืฉื“ื•ืช ื”ื ื“ืจืฉื™ื ื‘ื˜ื•ืคืก:
    - *ืืจื’ื•ืŸ* โ€“ ื‘ื—ืจ ืืช ื”ืืจื’ื•ืŸ ืฉืœืš.
    - *ืžืื’ืจ* โ€“ ื‘ื—ืจ ืืช ืžืื’ืจ ืชื•ื›ื ื™ืช ื”ืœื™ืžื•ื“ื™ื Web Dev for Beginners. 
    - *ืขื ืฃ* - ื‘ื—ืจ ืขื ืฃ (main) 
- ื”ื’ื“ืจื•ืช ื‘ื ื™ื™ื”: Azure Static Web Apps ืžืฉืชืžืฉ ื‘ืืœื’ื•ืจื™ืชื ื–ื™ื”ื•ื™ ื›ื“ื™ ืœื–ื”ื•ืช ืืช ื”ืžืกื’ืจืช ืฉื‘ื” ื ืขืฉื” ืฉื™ืžื•ืฉ ื‘ืืคืœื™ืงืฆื™ื” ืฉืœืš. 
    - *ืžื™ืงื•ื ื”ืืคืœื™ืงืฆื™ื”* - ./quiz-app
    - *ืžื™ืงื•ื ื”-Api* -
    - *ืžื™ืงื•ื ื”ืคืœื˜* - dist
- ืคืจื™ืกื”: ืœื—ืฅ ืขืœ 'Review + Create', ื•ืื– 'Create'

    ืœืื—ืจ ื”ืคืจื™ืกื”, ืงื•ื‘ืฅ ื–ืจื™ืžืช ืขื‘ื•ื“ื” ื™ื™ื•ื•ืฆืจ ื‘ืชื™ืงื™ื™ืช *.github* ืฉืœ ื”ืžืื’ืจ ืฉืœืš. ืงื•ื‘ืฅ ื–ืจื™ืžืช ืขื‘ื•ื“ื” ื–ื” ืžื›ื™ืœ ื”ื•ืจืื•ืช ืขืœ ืื™ืจื•ืขื™ื ืฉื™ืคืขื™ืœื• ืคืจื™ืกื” ืžื—ื“ืฉ ืฉืœ ื”ืืคืœื™ืงืฆื™ื” ืœ-Azure, ืœื“ื•ื’ืžื”, _**push** ืขืœ ืขื ืฃ **main**_ ื•ื›ื•'.

    <details>
    <summary>ื“ื•ื’ืžื” ืœืงื•ื‘ืฅ ื–ืจื™ืžืช ืขื‘ื•ื“ื”</summary>
    ื”ื ื” ื“ื•ื’ืžื” ืœืื™ืš ืงื•ื‘ืฅ ื–ืจื™ืžืช ื”ืขื‘ื•ื“ื” ืฉืœ GitHub Actions ืขืฉื•ื™ ืœื”ื™ืจืื•ืช:
    name: Azure Static Web Apps CI/CD

    ```
    on:
    push:
        branches:
        - main
    pull_request:
        types: [opened, synchronize, reopened, closed]
        branches:
        - main

    jobs:
    build_and_deploy_job:
        runs-on: ubuntu-latest
        name: Build and Deploy Job
        steps:
        - uses: actions/checkout@v2
        - name: Build And Deploy
            id: builddeploy
            uses: Azure/static-web-apps-deploy@v1
            with:
            azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
            repo_token: ${{ secrets.GITHUB_TOKEN }}
            action: "upload"
            app_location: "quiz-app" # App source code path
            api_location: ""API source code path optional
            output_location: "dist" #Built app content directory - optional
    ```

    </details>

- ืœืื—ืจ ื”ืคืจื™ืกื”: ืœืื—ืจ ืฉื”ืคืจื™ืกื” ื”ื•ืฉืœืžื”, ืœื—ืฅ ืขืœ 'Go to Deployment' ื•ืื– 'View app in browser'.

ืœืื—ืจ ืฉ-GitHub Action (ื–ืจื™ืžืช ื”ืขื‘ื•ื“ื”) ืฉืœืš ื‘ื•ืฆืขื” ื‘ื”ืฆืœื—ื”, ืจืขื ืŸ ืืช ื”ื“ืฃ ื”ื—ื™ ื›ื“ื™ ืœืฆืคื•ืช ื‘ืืคืœื™ืงืฆื™ื” ืฉืœืš.

---

**ื›ืชื‘ ื•ื™ืชื•ืจ**:  
ืžืกืžืš ื–ื” ืชื•ืจื’ื ื‘ืืžืฆืขื•ืช ืฉื™ืจื•ืช ืชืจื’ื•ื ืžื‘ื•ืกืก ื‘ื™ื ื” ืžืœืื›ื•ืชื™ืช [Co-op Translator](https://github.com/Azure/co-op-translator). ื‘ืขื•ื“ ืฉืื ื• ืฉื•ืืคื™ื ืœื“ื™ื•ืง, ื™ืฉ ืœื”ื™ื•ืช ืžื•ื“ืขื™ื ืœื›ืš ืฉืชืจื’ื•ืžื™ื ืื•ื˜ื•ืžื˜ื™ื™ื ืขืฉื•ื™ื™ื ืœื”ื›ื™ืœ ืฉื’ื™ืื•ืช ืื• ืื™ ื“ื™ื•ืงื™ื. ื”ืžืกืžืš ื”ืžืงื•ืจื™ ื‘ืฉืคืชื• ื”ืžืงื•ืจื™ืช ืฆืจื™ืš ืœื”ื™ื—ืฉื‘ ื›ืžืงื•ืจ ืกืžื›ื•ืชื™. ืขื‘ื•ืจ ืžื™ื“ืข ืงืจื™ื˜ื™, ืžื•ืžืœืฅ ืœื”ืฉืชืžืฉ ื‘ืชืจื’ื•ื ืžืงืฆื•ืขื™ ืขืœ ื™ื“ื™ ืื“ื. ืื™ื ื ื• ื ื•ืฉืื™ื ื‘ืื—ืจื™ื•ืช ืœืื™ ื”ื‘ื ื•ืช ืื• ืœืคืจืฉื ื•ื™ื•ืช ืฉื’ื•ื™ื•ืช ื”ื ื•ื‘ืขื•ืช ืžืฉื™ืžื•ืฉ ื‘ืชืจื’ื•ื ื–ื”.