René's URL Explorer Experiment
Title: Create Github repo by Sazwanismail · Pull Request #234 · Visual-Studio-Code/.github · GitHub
Open Graph Title: Create Github repo by Sazwanismail · Pull Request #234 · Visual-Studio-Code/.github
X Title: Create Github repo by Sazwanismail · Pull Request #234 · Visual-Studio-Code/.github
Description: 🌟 Projek codepaul: Panduan Lengkap – React + Node.js + Express + GitHub Actions
Anda telah melalui pelbagai perbincangan: daripada pengenalan SLSA, kepada pembangunan aplikasi penuh dengan React, Node.js, Express, dan GitHub Actions, sehingga penciptaan repositori GitHub. Kini tiba masanya untuk menggabungkan semua elemen menjadi satu panduan lengkap yang boleh terus anda gunakan.
Di bawah adalah resipi lengkap untuk membina, menyambung, dan mengautomasikan projek codepaul – sebuah aplikasi full‑stack dengan React di frontend, Node.js/Express di backend, dan CI/CD menggunakan GitHub Actions. Semua kod dan arahan disertakan.
📁 Struktur Projek
codepaul/
├── client/ # React frontend
│ ├── public/
│ │ └── index.html
│ ├── src/
│ │ ├── App.js
│ │ ├── App.css
│ │ ├── index.js
│ │ └── components/
│ │ └── Hello.js
│ ├── package.json
│ └── README.md
├── server/ # Node.js/Express backend
│ ├── routes/
│ │ └── api.js
│ ├── server.js
│ ├── package.json
│ └── .env
├── .github/
│ └── workflows/
│ └── ci-cd.yml
├── .gitignore
├── README.md
└── LICENSE
🧰 Prasyarat
Node.js (v18 atau lebih baru)
npm atau yarn
Git
Akaun GitHub
🛠 Langkah 1: Membina Backend (Node.js + Express)
mkdir codepaul
cd codepaul
mkdir server
cd server
npm init -y
npm install express cors dotenv
npm install --save-dev nodemon
Buat fail server.js:
// server/server.js
const express = require('express');
const cors = require('cors');
require('dotenv').config();
const app = express();
const PORT = process.env.PORT || 5000;
app.use(cors());
app.use(express.json());
app.use('/api', require('./routes/api'));
app.get('/health', (req, res) => {
res.json({ status: 'OK', message: 'Server berjalan' });
});
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
Buat fail routes/api.js:
// server/routes/api.js
const express = require('express');
const router = express.Router();
let items = [
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },
];
router.get('/items', (req, res) => res.json(items));
router.post('/items', (req, res) => {
const newItem = { id: items.length + 1, name: req.body.name };
items.push(newItem);
res.status(201).json(newItem);
});
module.exports = router;
Dalam server/package.json, tambah skrip:
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js"
}
Buat fail .env (pilihan):
PORT=5000
⚛️ Langkah 2: Membina Frontend (React)
Kembali ke direktori utama:
cd ..
npx create-react-app client
cd client
Edit src/App.js:
// client/src/App.js
import React, { useState, useEffect } from 'react';
import './App.css';
function App() {
const [items, setItems] = useState([]);
const [newItem, setNewItem] = useState('');
useEffect(() => {
fetch('/api/items')
.then(res => res.json())
.then(setItems)
.catch(console.error);
}, []);
const addItem = async (e) => {
e.preventDefault();
if (!newItem.trim()) return;
try {
const res = await fetch('/api/items', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: newItem }),
});
const item = await res.json();
setItems([...items, item]);
setNewItem('');
} catch (err) {
console.error(err);
}
};
return (
Senarai Item
{items.map(item => - {item.name}
)}
);
}
export default App;
Dalam client/package.json, tambah baris berikut untuk memudahkan panggilan API semasa pembangunan:
"proxy": "http://localhost:5000"
🧪 Langkah 3: Uji Secara Tempatan
Terminal 1 (backend): cd server && npm run dev
Terminal 2 (frontend): cd client && npm start
Buka http://localhost:3000 – anda sepatutnya dapat melihat dan menambah item.
📦 Langkah 4: Sedia untuk Git dan GitHub
4.1 Buat fail .gitignore di root projek
# dependencies
node_modules/
package-lock.json
yarn.lock
# environment
.env
.env.local
# build
dist/
build/
# logs
*.log
npm-debug.log*
4.2 Initialize Git dan commit
git init
git add .
git commit -m "Initial commit: React + Node.js + Express"
4.3 Cipta repositori di GitHub
Kaedah 1 – melalui laman web:
Log masuk ke GitHub, klik + → New repository
Nama repositori: codepaul (atau apa‑apa nama)
Jangan pilih mana‑mana pilihan inisialisasi
Klik Create repository
Kaedah 2 – menggunakan GitHub CLI:
gh repo create codepaul/codepaul --public --source=. --remote=origin --push
4.4 Sambungkan repositori tempatan ke GitHub
git remote add origin https://github.com/codepaul/codepaul.git
git branch -M main
git push -u origin main
Gantikan URL dengan repositori anda.
🔄 Langkah 5: CI/CD dengan GitHub Actions
Buat direktori .github/workflows dan fail ci-cd.yml:
# .github/workflows/ci-cd.yml
name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install backend dependencies
working-directory: ./server
run: npm ci
- name: Install frontend dependencies
working-directory: ./client
run: npm ci
- name: Build frontend
working-directory: ./client
run: npm run build
- name: Run backend tests (jika ada)
working-directory: ./server
run: npm test || echo "No tests yet"
- name: Run frontend tests
working-directory: ./client
run: npm test -- --watchAll=false || echo "No tests yet"
Commit dan push fail ini:
git add .github/
git commit -m "Add CI/CD workflow"
git push
Sekarang, setiap push ke main akan menjalankan pipeline. Anda boleh melihatnya di tab Actions repositori GitHub.
🚀 Langkah 6: Deployment (Pilihan)
6.1 Deploy backend ke Render atau Railway
Buat akaun dan sambungkan repositori GitHub.
Tetapkan arahan mula: npm start (dalam direktori server).
Tetapkan pemboleh ubah persekitaran jika perlu.
6.2 Deploy frontend ke Vercel atau Netlify
Import repositori GitHub, tetapkan root direktori ke client.
Pastikan pemboleh ubah REACT_APP_API_URL ditetapkan ke URL backend yang telah dideploy.
6.3 (Lanjutan) Integrasi deployment dalam GitHub Actions Anda boleh menambah langkah selepas build untuk deploy automatik menggunakan token rahsia (GitHub Secrets).
📄 Langkah 7: Dokumentasi dan Lesen
7.1 Edit README.md di root projek
# codepaul – Full‑Stack React + Node.js + Express
Aplikasi contoh dengan React frontend, Node.js/Express backend, dan CI/CD menggunakan GitHub Actions.
## Teknologi
- React (create‑react‑app)
- Node.js + Express
- GitHub Actions
## Cara menjalankan
1. Klon repositori
2. Pasang dependencies: `cd server && npm install` dan `cd client && npm install`
3. Jalankan backend: `cd server && npm run dev`
4. Jalankan frontend: `cd client && npm start`
5. Buka http://localhost:3000
## CI/CD
Setiap push ke `main` akan menjalankan pipeline GitHub Actions (lihat tab Actions).
## Lesen
MIT
7.2 Tambah lesen MIT
Buat fail LICENSE dan salin teks dari https://opensource.org/licenses/MIT. Gantikan tahun dan nama.
🎁 Bonus: Integrasi SLSA (Jika Diperlukan)
Daripada perbincangan sebelum ini, anda boleh menambah SLSA Level 3 provenance menggunakan workflow generator-generic-ossf-slsa3-publish.yml. Contohnya, dalam fail workflow yang sama, selepas langkah build, anda boleh panggil reusable workflow tersebut untuk menjana dan menandatangani provenance.
Contoh potongan:
provenance:
needs: build
uses: slsa-framework/slsa-github-generator/.github/workflows/generator-generic-ossf-slsa3-publish.yml@v1.7.0
with:
artifact-path: ./client/build # laluan ke artifak yang ingin dibuktikan
permissions:
id-token: write
contents: read
actions: read
Ini memerlukan konfigurasi tambahan dan hanya relevan jika anda ingin memenuhi piawaian SLSA.
✅ Semua Sedia!
Kini anda mempunyai:
Aplikasi React + Node.js/Express yang berfungsi sepenuhnya.
Repositori GitHub dengan kod sumber.
Pipeline CI/CD automatik.
Dokumentasi dan lesen.
Anda boleh mengklon repositori ini di mana‑mana mesin dan mula membangun dengan segera. Jika ada sebarang soalan atau ingin menambah ciri seperti pangkalan data, autentikasi, atau ujian, beritahu saya – saya sedia membantu!
Selamat membangun, codepaul! 🚀
Open Graph Description: 🌟 Projek codepaul: Panduan Lengkap – React + Node.js + Express + GitHub Actions
Anda telah melalui pelbagai perbincangan: daripada pengenalan SLSA, kepada pembangunan aplikasi penuh dengan React, N...
X Description: 🌟 Projek codepaul: Panduan Lengkap – React + Node.js + Express + GitHub Actions
Anda telah melalui pelbagai perbincangan: daripada pengenalan SLSA, kepada pembangunan aplikasi penuh dengan React, N...
Opengraph URL: https://github.com/Visual-Studio-Code/.github/pull/234
X: @github
direct link
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:991b67de-9049-d322-7fb0-70b592bcd9d1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 92F0:134361:BC7BA2:F97114:6B00F0B2 |
| html-safe-nonce | a21b1c7db5f287e5695163607bbc89169a0789e68334bf1da7f929a3ff74b990 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkYwOjEzNDM2MTpCQzdCQTI6Rjk3MTE0OjZCMDBGMEIyIiwidmlzaXRvcl9pZCI6IjMwNTA2OTg5NTU1NjMyNjYyMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ed6ee66b313134052a3b20c3883471f3c1922b28602d08ca7ff1c51171b0f497 |
| hovercard-subject-tag | pull_request:3403559379 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/Visual-Studio-Code/.github/pull/234/files |
| twitter:image | https://avatars.githubusercontent.com/u/208310745?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/208310745?s=400&v=4 |
| og:image:alt | 🌟 Projek codepaul: Panduan Lengkap – React + Node.js + Express + GitHub Actions
Anda telah melalui pelbagai perbincangan: daripada pengenalan SLSA, kepada pembangunan aplikasi penuh dengan React, N... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Visual-Studio-Code/.github git https://github.com/Visual-Studio-Code/.github.git |
| octolytics-dimension-user_id | 61069792 |
| octolytics-dimension-user_login | Visual-Studio-Code |
| octolytics-dimension-repository_id | 550489658 |
| octolytics-dimension-repository_nwo | Visual-Studio-Code/.github |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 550489658 |
| octolytics-dimension-repository_network_root_nwo | Visual-Studio-Code/.github |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/Visual-Studio-Code/.github/pull/234/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FVisual-Studio-Code%2F.github%2Fpull%2F234%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FVisual-Studio-Code%2F.github%2Fpull%2F234%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=Visual-Studio-Code%2F.github |
| Reload | https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Reload | https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Reload | https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Visual-Studio-Code | https://github.com/Visual-Studio-Code |
| .github | https://github.com/Visual-Studio-Code/.github |
| Code | https://github.com/Visual-Studio-Code/.github |
| Issues119 (119) | https://github.com/Visual-Studio-Code/.github/issues |
| Pull requests103 (103) | https://github.com/Visual-Studio-Code/.github/pulls |
| Actions | https://github.com/Visual-Studio-Code/.github/actions |
| Projects | https://github.com/Visual-Studio-Code/.github/projects |
| Security and quality | https://github.com/Visual-Studio-Code/.github/security |
| Insights | https://github.com/Visual-Studio-Code/.github/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2FVisual-Studio-Code%2F.github%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2FVisual-Studio-Code%2F.github%2Fissues%2Fnew%2Fchoose |
| Muhamad Sazwan Bin Ismail (Sazwanismail) | https://github.com/Sazwanismail |
| Visual-Studio-Code:main | https://github.com/Visual-Studio-Code/.github/tree/main |
| Htpps-console-firebase-google-com:patch-7 | https://github.com/Htpps-console-firebase-google-com/.github/tree/patch-7 |
|
Conversation
0
| https://github.com/Visual-Studio-Code/.github/pull/234 |
|
Commits
1
| https://github.com/Visual-Studio-Code/.github/pull/234/commits |
|
Checks
0
| https://github.com/Visual-Studio-Code/.github/pull/234/checks |
|
Files changed
| https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Please reload this page | https://github.com/Visual-Studio-Code/.github/pull/234/files |
|
Create Github repo
| https://github.com/Visual-Studio-Code/.github/pull/234/files#top |
|
Show all changes
1 commit
| https://github.com/Visual-Studio-Code/.github/pull/234/files |
|
4d9d159
Create Github
Sazwanismail Mar 16, 2026
| https://github.com/Visual-Studio-Code/.github/pull/234/commits/4d9d159a3011677154d69be45f875d2bc8fa4c0e |
|
Clear filters
| https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Please reload this page | https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Please reload this page | https://github.com/Visual-Studio-Code/.github/pull/234/files |
| Github repo | https://github.com/Visual-Studio-Code/.github/pull/234/files#diff-faebbbe6cfd2a247ef378f2dcb8ff5fd5483cce2e80809a34c58c510dbbc371d |
|
View file
| https://github.com/Visual-Studio-Code/.github/blob/4d9d159a3011677154d69be45f875d2bc8fa4c0e/Github%20repo |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/Visual-Studio-Code/.github/pull/234/{{ revealButtonHref }} |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Viewport: width=device-width
URLs of crawlers that visited me.