Skip to content

feat: Create initial version #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Apr 28, 2025
Merged
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
e8abc58
feat: add copilot-made draft of step 1
chriswblake Apr 24, 2025
8587546
feat: add copilot-made draft of step 2
chriswblake Apr 24, 2025
b6ccab0
feat: add copilot-made draft of step 3
chriswblake Apr 24, 2025
dab44f5
feat: add copilot-made draft of step 3
chriswblake Apr 24, 2025
a335dcc
feat: add copilot-made draft of step 4
chriswblake Apr 24, 2025
863db38
feat: add copilot-made draft of final review
chriswblake Apr 24, 2025
e9a1a60
feat: Add start exercise workflow
chriswblake Apr 24, 2025
174d4a9
docs: Add sample application
chriswblake Apr 24, 2025
8ce8ddd
wording tweaks
chriswblake Apr 25, 2025
125e4c4
Make analogy more logical.
chriswblake Apr 25, 2025
8938f45
Verify activity instructions and add images
chriswblake Apr 25, 2025
feb165c
Verify activity instructions and add images
chriswblake Apr 26, 2025
1fd4203
make image sizes the same
chriswblake Apr 26, 2025
bd4071c
Make analogy better
chriswblake Apr 26, 2025
faa4082
Add script to preinstall mongodb
chriswblake Apr 27, 2025
b21574c
Refactor to use mongodb and move routes into separate file
chriswblake Apr 27, 2025
6b3bc24
Swap registration area for button on each activity
chriswblake Apr 27, 2025
06b7c5c
Add login functionality so only teachers can register/unregister stud…
chriswblake Apr 28, 2025
e8a28d1
refactor css to use variables
chriswblake Apr 28, 2025
54350c6
Make content more dense. Fix UI of login button.
chriswblake Apr 28, 2025
b952a49
remove available activities
chriswblake Apr 28, 2025
10eaf03
Modify filters for better support of days and times
chriswblake Apr 28, 2025
ac3964b
fix bug that didn't show activities at beginning
chriswblake Apr 28, 2025
1fd58f8
Change time filter to be same style
chriswblake Apr 28, 2025
35635ff
fix padding around search icon
chriswblake Apr 28, 2025
f7c9e2f
Fix hover effect on unregister button.
chriswblake Apr 28, 2025
1ec6c0e
Add mongodb extension
chriswblake Apr 28, 2025
41be730
chore: reverse order of steps
chriswblake Apr 28, 2025
83cbfed
chore: Validate content in step 2
chriswblake Apr 28, 2025
aedae0b
chore: Validate content in step 3
chriswblake Apr 28, 2025
ad0e37a
chore: Validate content in step 4
chriswblake Apr 28, 2025
a568fa9
chore: Validate content in step 5
chriswblake Apr 28, 2025
b9e744e
remove theory header
chriswblake Apr 28, 2025
5a4f6ce
feat: Clean up workflow 0. Untested.
chriswblake Apr 28, 2025
d8c9f71
feat: Clean up workflow 1. Untested.
chriswblake Apr 28, 2025
2304fb6
feat: Clean up workflow 2. Untested.
chriswblake Apr 28, 2025
6189828
feat: Clean up workflow 3. Untested.
chriswblake Apr 28, 2025
d26a175
feat: Clean up workflow 4. Untested.
chriswblake Apr 28, 2025
ecf621d
feat: Clean up workflow 5. Untested.
chriswblake Apr 28, 2025
6943506
Test run and adjustments for workflow 0.
chriswblake Apr 28, 2025
ba03fa7
Test run and adjustments for workflow 1.
chriswblake Apr 28, 2025
c5a8706
Test run and adjustments for workflow 2.
chriswblake Apr 28, 2025
7e73d4e
Test run and adjustments for workflow 3.
chriswblake Apr 28, 2025
408558e
Test run and adjustments for workflow 4.
chriswblake Apr 28, 2025
83063f9
fix: prevent crash if workflow not found
chriswblake Apr 28, 2025
b8c34d5
refactor: Adjust review to have similar style to current format
chriswblake Apr 28, 2025
77ad87e
typo
chriswblake Apr 28, 2025
68bbe7a
Test run and adjustments for workflow 5.
chriswblake Apr 28, 2025
6057175
Add missing license file
chriswblake Apr 28, 2025
ba1b517
cleanup
chriswblake Apr 28, 2025
5227d9a
adjust image sizes
chriswblake Apr 28, 2025
f55ab0a
cleanup
chriswblake Apr 28, 2025
47b0ab3
cleanup
chriswblake Apr 28, 2025
63414e7
add link
chriswblake Apr 28, 2025
11ba84f
Add link to sample gitignore files
chriswblake Apr 28, 2025
f341503
Wording tweaks
chriswblake Apr 28, 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
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Python 3",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.13",
"forwardPorts": [8000],
"postCreateCommand": "bash ./.devcontainer/postCreate.sh",
"customizations": {
"vscode": {
"extensions": [
"GitHub.copilot",
"ms-python.python",
"ms-python.debugpy",
"mongodb.mongodb-vscode"
]
}
}
}
21 changes: 21 additions & 0 deletions .devcontainer/installMongoDB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Install MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

# Create necessary directories and set permissions
sudo mkdir -p /data/db
sudo chown -R mongodb:mongodb /data/db

# Start MongoDB service
sudo mongod --fork --logpath /var/log/mongodb/mongod.log

echo "MongoDB has been installed and started successfully!"
mongod --version

# Run sample MongoDB commands
echo "Current databases:"
mongosh --eval "db.getMongo().getDBNames()"
5 changes: 5 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Prepare python environment
pip install -r requirements.txt

# Prepare MongoDB Dev DB
./.devcontainer/installMongoDB.sh
116 changes: 116 additions & 0 deletions .github/steps/1-protect-your-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Step 1: Protect your code

It's been a busy month at Mergington High! Your simple website for managing extra-curricular activities has really taken off. What started as a basic sign-up form for a few activities has grown into the go-to place for half the school activities. 📚✨

Principal Martinez was so impressed with your work that they announced at the last staff meeting that ALL clubs should start using the website. While this is exciting, you're a bit nervous - the last thing you want is an accidental change breaking the system right before the big Fall Activities Fair! 😰

When more teachers start helping with the Mergington High activities website, it's important to add some safeguards. Thankfully, GitHub provides several ways to protect your repository:

1. **Repository Rulesets** - These provide safeguards to limit:

- Pushing code directly to important branches
- Deleting or renaming branches
- Force pushing (which can overwrite history)
- (and much more)

1. **`.gitignore`** - This special file tells Git which files it should NOT track, like:

- Temporary files that your code creates while running
- Secret configuration files with sensitive information
- System files that other developers don't need

> [!TIP]
> Think of these settings like the editorial process of a school yearbook. Various student committees will take photos and write articles, then the yearbook president will make adjustments to make sure everything flows together properly. Finally, a teacher/advisor will sign off that all content is appropriate.

## ⌨️ Activity: Add a branch ruleset

Now let's add some protections so that no one accidentally breaks the club registration system:

1. In the top navigation, select the **Settings** tab.

1. In the left navigation, expand the **Rules** area and select **Rulesets**.

1. Click the **New ruleset** dropdown and select **New branch ruleset**.

<img width="250" alt="image" src="https://github.com/user-attachments/assets/1e9fd519-1421-4d6b-b654-a3fe53a8fb75" />

1. Set the **Ruleset Name** as `Protect main` and change the **Enforcement status** to `Active`.

<img width="250" alt="image" src="https://github.com/user-attachments/assets/ce30fd34-39b5-4e22-b348-4af61fd05cd1" />

1. Locate the the **Targets** section. Use the **Add target** dropdown to add 2 entries:

1. Add the **Include default branch** option to ensure protections aren't bypassed by switching the default branch.

<img width="250" alt="image" src="https://github.com/user-attachments/assets/217263cc-d5c2-4ac0-b03c-a72494e5c812" />

1. Use the **include by pattern** option and enter the pattern `main`.

<img width="250" alt="image" src="https://github.com/user-attachments/assets/47a835de-62dc-4f34-96d8-c2562f03af1a" />

<img width="250" alt="image" src="https://github.com/user-attachments/assets/ddc52767-d93e-4c9e-a77a-90c3b5c08fb5" />

1. Locate the **Rules** section. Ensure the following items are checked.
- [x] Restrict deletions
- [x] Require a pull request before merging
- Required approvals: `1`
- [x] Require review from Code Owners (explained in next step)
- [x] Require status checks to pass before merging

## ⌨️ Activity: Create a `.gitignore` file

Let's start by making sure we don't accidentally commit files:

1. If necessary, open another tab and navigate to this repository. We will start on the **Code** tab.

1. Above the list of files, select the **branch dropdown menu**.

1. Create a new branch with the name `prepare-to-collaborate`.

<img width="300" alt="image" src="https://github.com/user-attachments/assets/1c04a3e4-e492-4857-9527-2b43908a1da1"/>

1. Above the list of files, click the **Add file** dropdown and select **Create new file**.

<img width="300" alt="New file button" src="https://github.com/user-attachments/assets/8f3f8da8-1471-485a-9df5-8c03ecba2d8e"/>

1. Enter the file name `.gitignore` and copy following example content into it.

<img width="350" alt="preview of new file" src="https://github.com/user-attachments/assets/580d1a63-a264-4d44-8901-50ad708b8822"/>

```gitignore
# Python backend for club management
__pycache__/
*.py[cod] # Python compiled files
*$py.class
*.so
.Python
env/
.env # Where database passwords are stored
venv/ # Virtual environment for testing
.venv

# Teacher IDE settings
.vscode/ # Ms. Rodriguez uses VS Code
.idea/ # Mr. Chen uses PyCharm

# Local development & testing
instance/
.pytest_cache/
.coverage # Test coverage reports
htmlcov/

# Staff computer files
.DS_Store # For teachers with Macs
Thumbs.db # For teachers with Windows
```

1. In the top right, select the **Commit changes...** button. Notice that it won't let us commit to the `main` branch! Nice!

<img width="400" alt="image" src="https://github.com/user-attachments/assets/4e85948d-75c8-4c13-8ddd-4707bf9b0805" />

1. Enter `prepare-to-collaborate` for the branch name then click the **Propose changes** button.

1. With the file committed, wait a moment for Mona to check your work, provide feedback, and share the next lesson.

> [!TIP]
> GitHub and the community have built up a repository with [sample `.gitignore` files](https://github.com/github/gitignore) for many situations. Make sure to check it out!
132 changes: 132 additions & 0 deletions .github/steps/2-prepare-to-collaborate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Step 2: Prepare to collaborate

Your simple school website has become quite popular! After showing it at the last staff meeting, Ms. Rodriguez from the Art Club and Mr. Chen from the Chess Club came up to you super excited. They have tons of ideas for new features!

- Ms. Rodriguez wants to add a photo gallery
- Mr. Chen dreams of adding a tournament bracket system for the chess/sports activities! 🎨♟️

While you're thrilled about their enthusiasm, you realize you need to set up some guidelines before letting them start changing code. The last thing you want is conflicting changes breaking the registration system right before spring break!

Opening your project to other teachers at Mergington High means thinking about how everyone will work together without breaking each other's code. To help with collaboration, GitHub provides two special files:

1. `CONTRIBUTING.md` - A "How to Help" guide. Some example content:

- How to prepare a developer setup of the extra-curricular activities website.
- The process for suggesting changes.
- The project's coding style preference, to keep things consistent.
- How to ask for help when stuck.

2. `CODEOWNERS` - Assign specific people or teams responsible for a portion of the project.

- When someone creates a pull request, GitHub will automatically ask the right person to review it.

3. **Collaborators** - Give other people access to the project.

- Provide other people permissions to change project files while still protecting repository settings.
- Personal repositories have simple permissions. Organization repositories allow flexible permissions such as read, write, maintain, and admin.

## ⌨️ Activity: Create a welcoming contribution guide

The IT Club meeting is tomorrow, and you need to prepare for Ms. Rodriguez and Mr. Chen to join the project. Let's start a document to help them contribute effectively.

1. Ensure you you are on the `prepare-to-collaborate` branch at the root directory.

1. In the top directory, create a new file called `CONTRIBUTING.md`.

1. Add a welcoming message.

```md
# Contributing to the Mergington High Extra-Curricular Activities Website

Thank you for your interest in helping improve our school's website! Whether you want to add your club's activities, fix a bug, or suggest new features, this guide will help you get started. 🎉
```

1. Add instructions to help them quickly start developing.

```md
## Development Setup

1. Clone the repository to your computer.
2. Install Python requirements: `pip install -r requirements.txt`.
3. Run the development server: `python src/app.py`.
4. Visit http://localhost:8000 in your browser to see the website.

## Making Changes

1. Create a new branch for your changes.
- Use descriptive names like `art-gallery-feature` or `fix-chess-signup`
2. Make your changes and test them locally with sample student data.
- Use the MongoDB extension to preview the included sample date.
3. Push your branch and create a pull request.
4. Wait for review and address any feedback.

## Code Style

- Follow PEP 8 for Python code (backend).
- Use clear, descriptive variable names (student_name, start_time, etc.)
- Add comments to describe blocks of logic.
```

1. Add a section for getting help.

```md
## Need help or have ideas?

- Check the open issues first.
- If your problem is there, add a comment or up-vote.
- If not there, create a new issue. Be as descriptive as possible.
- Ask in our weekly IT Club office hours (Thursdays at lunch in Room 203).
- For other general problems, email the tech team at techclub@mergingtonhigh.example.edu
```

1. In the top right, use the **Commit changes...** button to save your changes.

## ⌨️ Activity: Assign code ownership

With others joining the fun, you want to stay involved on anything affecting architecture and core functionality. Let's assign you to the related files.

1. Ensure you you are on the `prepare-to-collaborate` branch at the root directory.

1. Above the list of files, click the **Add file** dropdown and select **Create new file**.

<img width="300" alt="New file button" src="https://github.com/user-attachments/assets/8f3f8da8-1471-485a-9df5-8c03ecba2d8e"/>

1. Set the file name as `CODEOWNERS`, without an file extension.

1. Add the following content:

```codeowners
# Core functionality - changes here should be rare!
/src/app.py @{{ login }}
/src/backend/database.py @{{ login }}
/src/backend/routers/auth.py @{{ login }}

# The frontend will need refactored soon to be more object oriented.
/src/static/ @{{ login }}
```

1. In the top right, use the **Commit changes...** button to save your changes.

1. With the files committed, wait a moment for Mona to check your work, provide feedback, and share the next lesson.

## ⌨️ Activity: (Optional) Add your first collaborator

Ready to let your colleague start working on that photo gallery feature? Let's do it!

> [!IMPORTANT]
> This step is optional because it requires another person with a GitHub account to participate.

1. In the top navigation, select the **Settings** tab.

1. In the left navigation, select **Collaborators**.

1. Find the **Manage access** area and click the **Add people** button.

<img width="350" alt="" src="https://github.com/user-attachments/assets/b1675ad5-57b1-441e-ab7a-22d26dccf6ce" />

1. Enter a friend/colleague's GitHub username or email then press the **Add to repository** button.

<img width="350" alt="" src="https://github.com/user-attachments/assets/caf1a193-c9db-4962-b01e-66666ef54369" />

> [!IMPORTANT]
> Personal repositories only have one collaboration role type. A "collaborator" receives **write** permissions but NOT **admin** permissions.
Loading
Loading