Skip to content

Commit 63b47e0

Browse files
Move project to repository root for GitHub Pages deployment
0 parents  commit 63b47e0

32 files changed

Lines changed: 9915 additions & 0 deletions

.github/workflows/deploy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v4
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: ./dist
42+
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## How to Contribute
2+
3+
We welcome contributions to JS Learning Lab! Here are several ways you can help:
4+
5+
### 🎯 Adding Questions
6+
7+
The easiest way to contribute is by adding new JavaScript questions:
8+
9+
1. **Use the Admin Interface**
10+
- Open `admin.html` in your browser
11+
- Fill out the question form with all details
12+
- Generate the JSON and copy it
13+
- Add to `src/data/questionsDatabase.json`
14+
15+
2. **Question Guidelines**
16+
- Focus on real-world JavaScript scenarios
17+
- Include clear, detailed explanations
18+
- Provide helpful hints for learning
19+
- Test your questions thoroughly
20+
- Use proper grammar and formatting
21+
22+
### 🛠️ Code Contributions
23+
24+
1. **Fork the Repository**
25+
```bash
26+
git clone https://github.com/SyntaxSidekick/js-learning-lab.git
27+
cd js-learning-lab
28+
```
29+
30+
2. **Create a Feature Branch**
31+
```bash
32+
git checkout -b feature/your-feature-name
33+
```
34+
35+
3. **Make Your Changes**
36+
- Follow the existing code style
37+
- Add tests if applicable
38+
- Update documentation as needed
39+
40+
4. **Test Your Changes**
41+
```bash
42+
npm install
43+
npm run dev
44+
```
45+
46+
5. **Commit and Push**
47+
```bash
48+
git add .
49+
git commit -m "Add: your feature description"
50+
git push origin feature/your-feature-name
51+
```
52+
53+
6. **Create a Pull Request**
54+
- Describe your changes clearly
55+
- Include screenshots if applicable
56+
- Reference any related issues
57+
58+
### 📋 Development Standards
59+
60+
- **Code Style**: Follow existing patterns and use ESLint
61+
- **Commits**: Use clear, descriptive commit messages
62+
- **Documentation**: Update README.md and comments as needed
63+
- **Testing**: Test all functionality before submitting
64+
65+
### 🐛 Reporting Issues
66+
67+
- Use GitHub Issues to report bugs
68+
- Include steps to reproduce
69+
- Provide browser and system information
70+
- Include screenshots if helpful
71+
72+
### 💡 Feature Requests
73+
74+
- Open a GitHub Discussion for feature ideas
75+
- Explain the use case and benefits
76+
- Consider implementing it yourself!
77+
78+
Thank you for contributing to JS Learning Lab! 🚀

DEPLOYMENT.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Deployment Guide for JS Challenge Lab
2+
3+
## Quick Deployment Options
4+
5+
### 1. Vercel (Recommended)
6+
```bash
7+
# Install Vercel CLI
8+
npm install -g vercel
9+
10+
# Deploy
11+
vercel
12+
13+
# Follow the prompts to connect your project
14+
```
15+
16+
### 2. Netlify
17+
```bash
18+
# Build the project
19+
npm run build
20+
21+
# Drag and drop the 'dist' folder to Netlify's deploy interface
22+
# Or use Netlify CLI:
23+
npm install -g netlify-cli
24+
netlify deploy --prod --dir=dist
25+
```
26+
27+
### 3. GitHub Pages
28+
```bash
29+
# Install gh-pages
30+
npm install --save-dev gh-pages
31+
32+
# Add to package.json scripts:
33+
"deploy": "gh-pages -d dist"
34+
35+
# Build and deploy
36+
npm run build
37+
npm run deploy
38+
```
39+
40+
### 4. Traditional Hosting
41+
```bash
42+
# Build the project
43+
npm run build
44+
45+
# Upload the contents of the 'dist' folder to your web server
46+
```
47+
48+
## Environment Variables
49+
No environment variables are required for basic deployment.
50+
51+
## Performance Optimization
52+
53+
### Bundle Analysis
54+
```bash
55+
# Install bundle analyzer
56+
npm install --save-dev vite-bundle-analyzer
57+
58+
# Add to package.json scripts:
59+
"analyze": "vite-bundle-analyzer"
60+
61+
# Run analysis
62+
npm run analyze
63+
```
64+
65+
### Production Optimizations
66+
- Monaco Editor is loaded asynchronously
67+
- Tailwind CSS is purged of unused styles
68+
- Assets are automatically minified by Vite
69+
70+
## Domain Configuration
71+
Update the `base` in `vite.config.js` if deploying to a subdirectory:
72+
73+
```javascript
74+
export default defineConfig({
75+
base: '/your-subdirectory/',
76+
plugins: [react()],
77+
})
78+
```

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 JS Learning Lab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)