Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8fbc957
feat(04): Hello World from Express
FranGuam Aug 3, 2024
a7572f9
feat(04): request & response
FranGuam Aug 7, 2024
064d803
feat(04): user system
FranGuam Aug 7, 2024
f6e5b0d
feat(04): handle files
FranGuam Aug 7, 2024
291ba95
feat(04): email service
FranGuam Aug 7, 2024
b2468c4
chore(04): tutorial
FranGuam Aug 7, 2024
caa1dfb
feat(05): Hello World from React
FranGuam Aug 20, 2024
f221e82
feat(05): JSX elements
FranGuam Aug 20, 2024
652d84e
feat(05): React Components
FranGuam Aug 20, 2024
ea94cd5
feat(05): brick and mortar
FranGuam Aug 20, 2024
ca4c615
feat(05): LoginPage
FranGuam Aug 20, 2024
58e0dd1
feat(05): MainPanel
FranGuam Aug 20, 2024
f8cb54b
feat(05): ChatBox & FileShare
FranGuam Aug 20, 2024
ddfa9bd
feat(05): UX improvements
FranGuam Aug 21, 2024
ec02e98
fix(05): use `HashRouter` to resolve paths
FranGuam Aug 22, 2024
805ee12
chore(05): tutorial
FranGuam Aug 26, 2024
cf00ffc
feat(06): frontend on Github Pages
FranGuam Aug 22, 2024
e2bc962
feat(06): build backend as docker
FranGuam Aug 22, 2024
b67e770
feat(06): above the cloud
FranGuam Aug 22, 2024
f97998b
feat(06): upgrade to https
FranGuam Aug 22, 2024
1c9d3cd
feat(06): desktop application via electron
FranGuam Aug 28, 2024
cdd1da2
chore(06): tutorial
FranGuam Aug 28, 2024
5d8417a
Create test_commit.md
hhzzff Aug 5, 2025
f034481
Create PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
125d4a4
Merge pull request #1 from hhzzff/01-HTML&CSS
hhzzff Aug 5, 2025
47125f6
Create PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
84705e1
Delete PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
b0dc8fd
Create PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
d3b1980
Delete .vscode/PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
6d75503
Create homework.md
hhzzff Aug 5, 2025
a4cd5d2
Merge pull request #2 from hhzzff/01-HTML&CSS
hhzzff Aug 5, 2025
d416094
Update README.md
hhzzff Aug 5, 2025
7906d55
Delete .github/PULL_REQUEST_TEMPLATE.md
hhzzff Aug 5, 2025
06bbb15
Create simple.md
hhzzff Aug 5, 2025
45d534b
Merge pull request #3 from hhzzff/01-HTML&CSS
hhzzff Aug 5, 2025
d4dc5b5
Update README.md
hhzzff Aug 5, 2025
e2561a3
Delete .github/PULL_REQUEST_TEMPLATE/simple.md
hhzzff Aug 5, 2025
00a8b53
Update and rename homework.md to pull_request_template.md
hhzzff Aug 5, 2025
ac2a930
Merge pull request #4 from hhzzff/01-HTML&CSS
hhzzff Aug 5, 2025
a145ad9
Delete frontend/public/test_commit.md
hhzzff Aug 5, 2025
d642e0f
Merge pull request #10 from hhzzff/main
hhzzff Aug 5, 2025
3d55d32
Rename .github/PULL_REQUEST_TEMPLATE/pull_request_template.md to .git…
hhzzff Aug 5, 2025
a26610c
Merge pull request #11 from hhzzff/main
hhzzff Aug 5, 2025
774b881
fix(06): resolve docker image name
FranGuam Aug 6, 2025
9f61602
fix
FranGuam Aug 6, 2025
ee6b0e7
fix
FranGuam Aug 6, 2025
9a24949
ci(Mergify): configuration update
hhzzff Aug 8, 2025
71ca119
Merge pull request #14 from eesast/mergify/hhzzff/config-update
hhzzff Aug 8, 2025
a630808
ci(Mergify): configuration update
hhzzff Aug 8, 2025
853dd83
Merge pull request #15 from eesast/mergify/hhzzff/config-update
hhzzff Aug 8, 2025
3401eaf
Update README.md: add homework tutorial
hhzzff Aug 9, 2025
830a7f3
Update README.md
hhzzff Aug 10, 2025
58061e3
Update README.md
hhzzff Aug 14, 2025
0634a7d
HTML&CSS_赵景言_笃实45
oj-afraid-student Aug 16, 2025
62d5af6
JS&TS_赵景言_笃实45
oj-afraid-student Aug 17, 2025
d2f4f9a
Database_赵景言_笃实45
oj-afraid-student Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### 2025暑培-网站作业提交
#### 基本信息
- **姓名**:
- **班级**:
- **学号**:

#### 提交说明

- [ ] 已阅读并理解本次作业要求
14 changes: 14 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Github 和 Docker Hub 相关网页设置

### 前端(Github Pages)

在你复刻的仓库中,进入设置标签页(https://github.com/[username]/web-workshop/settings),点击左边栏的 Pages,在 Build and deployment 下方的 Source,选择 Github Actions。意思是通过自定义的 action 来部署静态 Github Pages(与之相对的是根据仓库中的 markdown 文件自动部署)

### 后端(Docker)

1. 注册 Dockers Hub 账号([Signup | Docker](https://app.docker.com/signup)),建议使用 Github 注册。如果使用其他方式注册,请将用户名与 Github 保持一致(大小写不敏感)
2. 在 Docker Hub 设置界面的 Personal access tokens(个人访问 Token)([Personal access tokens | Docker](https://app.docker.com/settings/personal-access-tokens)),新增一个 token(至少要有写权限)并复制下来
3. 在 Github 上复刻仓库的设置页,点击左边栏的 Secrets and variables -> Actions,添加一个 Secret(即密钥,加密防护)和两个 Variables(即变量,明文显示)如下:
- [Secret] `DOCKERHUB_TOKEN`,值为之前复制的个人访问 Token
- [Variable] `DOCKERHUB_USERNAME`,值为你的 Docker Hub 账号名
- [Variable] `DOCKER_TAG`,值为你的 Docker 容器标识名,形如`<repo-name>:latest`,其中`repo-name`任意,不需要与仓库同名
72 changes: 72 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: backend

on:
push:
branches: [ main ]

permissions:
packages: write
contents: read
id-token: write

defaults:
run:
working-directory: backend

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: ./backend/yarn.lock

- name: Install dependencies
run: |
yarn install --frozen-lockfile

- name: Check grammar
run: |
yarn typecheck

build:
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Downcase GitHub username
run: echo "USERNAME_LC=${USERNAME@L}" >> $GITHUB_ENV
env:
USERNAME: ${{ github.repository_owner }}

- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: ./backend
push: true
tags: |
ghcr.io/${{ env.USERNAME_LC }}/${{ vars.DOCKER_TAG }}
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKER_TAG }}
83 changes: 83 additions & 0 deletions .github/workflows/electron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: electron

on:
push:
tags:
- v*

permissions:
contents: write

defaults:
run:
working-directory: frontend

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
output-file: |
./frontend/electron/*.AppImage
./frontend/electron/*.deb
./frontend/electron/*.rpm
./frontend/electron/*.tar.gz
- os: windows-latest
output-file: |
./frontend/electron/*.exe
- os: macos-latest
output-file: |
./frontend/electron/*.dmg
./frontend/electron/*.zip

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: ./frontend/yarn.lock

- name: Install dependencies
run: |
yarn install --frozen-lockfile
yarn add electron electron-builder --dev

- name: Build
run: |
yarn build
yarn electron:build

- name: Upload executables for publish
uses: actions/upload-artifact@v4
with:
name: my-artifact-${{ matrix.os }}
path: ${{ matrix.output-file }}

release:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download executables
uses: actions/download-artifact@v4
with:
pattern: my-artifact-*
merge-multiple: true
path: dist

- name: Deploy to GitHub Releases
uses: softprops/action-gh-release@v2
with:
files: ./dist/*
name: Release ${{ github.ref_name }}
generate_release_notes: true
prerelease: true
74 changes: 74 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Simple workflow for deploying static content to GitHub Pages
name: frontend

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
working-directory: frontend

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: ./frontend/yarn.lock

- name: Install dependencies
run: |
yarn install --frozen-lockfile

- name: Check grammar
run: |
yarn typecheck
yarn lint

- name: Build
run: |
yarn build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./frontend/build"

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pull_request_rules:
- name: 🏷️ Label homework
description: Label a homework with 'homework' label by detecting keyword
conditions:
- body~=作业提交
actions:
label:
add:
- homework
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,43 @@ git clone <先前复制的仓库URI>
```bash
git push --all
```

### 作业提交
每一讲的作业提交采用如下流程:
- 本地修改对应分支
- 提交修改到对应分支
- 向本仓库对应分支提交PR
- 关联PR到对应Issue
- 查看作业批改结果
##### 本地修改对应分支
fork本仓库所有分支后,根据[Issue](https://github.com/eesast/web-workshop/issues)对应讲作业要求,在本地切换到对应分支进行修改
```
git checkout "01-HTML&CSS"
```
##### 提交修改到对应分支
完成修改后,将改动提交到本地并推送到云端 Fork 仓库
```
git push origin "01-HTML&CSS"
```
##### 向本仓库对应分支提交PR
打开在 GitHub 上 Fork 的仓库页面后,切换到刚刚推送的 对应分支(如 lesson1)

点击 "Compare & pull request" 按钮,并在 PR 创建页面填写相关信息
##### 关联PR到对应Issue
在PR模板填写界面,需手动关联PR到对应Issue

你可以在PR正文中手动关联对应Issue,方法是添加#ISSUE-NUMBER到正文后。例如,需要链接的Issue对应的id是4,则添加一行#4

你也可以在PR编辑界面点击右上方的'Reference',选择需要链接的PR,最终效果与上述方法相同
<img width="837" height="369" alt="image" src="https://github.com/user-attachments/assets/1b7ac4eb-ae95-426e-b17c-cc0f1ce1e66d" />

[示例PR](https://github.com/eesast/web-workshop/pull/12)

关联完成后,提交PR,则作业提交完毕
##### 查看作业批改结果
作业由讲师批改后,对应 PR 会被打上标签:
- accepted ✅:作业通过,PR 会被关闭。
- require revision 🔄:需要修改,PR 保持 open 状态。


若需修改,按 PR 下方的评论提示进行更改,然后重复 步骤 2 → 步骤 3 提交更新。
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
upload
16 changes: 16 additions & 0 deletions backend/.local.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HASURA_GRAPHQL_ENDPOINT=<address>:<port>/v1/graphql
HASURA_GRAPHQL_ADMIN_SECRET=<secret>

JWT_SECRET=<same as in the hasura environment variable>

EMAIL_HOST=smtp.163.com
EMAIL_PORT=465
EMAIL_SECURE=true
EMAIL_ADDRESS=
EMAIL_PASSWORD=

(以下备注请在生产环境中删除)
注:不同邮箱提供商的配置方法不同,请参考对应的文档或邮箱设置;
- 部分邮箱需要手动开启 SMTP 服务;
- 部分邮箱的密码(包括清华邮箱)填的是设备授权码,而不是账号密码;
- 部分邮箱需要 OAuth2 或其他身份验证,请参考 https://nodemailer.com/smtp/oauth2/
30 changes: 30 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Builder stage
FROM node:20 AS builder
WORKDIR /home/node/app

# Install Dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --no-cache

# Copy source code
COPY . .

# Build
RUN yarn build


# Runner stage
FROM node:20-alpine AS runner
WORKDIR /home/node/app
ENV NODE_ENV=production

# Install Production Dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --no-cache --production

# Copy build files
COPY --from=builder /home/node/app/build ./build

# Expose port and run
EXPOSE 8888
CMD yarn serve
29 changes: 29 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"dependencies": {
"dotenv": "16.4.5",
"express": "4.19.2",
"graphql": "16.9.0",
"graphql-request": "6.1.0",
"jsonwebtoken": "9.0.2",
"morgan": "1.10.0",
"multer": "1.4.5-lts.1",
"nodemailer": "6.9.14"
},
"devDependencies": {
"@types/express": "4.17.21",
"@types/jsonwebtoken": "9.0.6",
"@types/morgan": "1.9.9",
"@types/multer": "1.4.11",
"@types/node": "22.1.0",
"@types/nodemailer": "6.4.15",
"nodemon": "3.1.4",
"ts-node": "10.9.2",
"typescript": "5.5.4"
},
"scripts": {
"start": "nodemon src/index.ts",
"build": "tsc",
"serve": "node build/index.js",
"typecheck": "tsc --noEmit"
}
}
Loading