Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Base Template Dev Environment",
"dockerComposeFile": "../docker-compose.yml",
"service": "dev",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": ["ms-azuretools.vscode-docker", "eamodio.gitlens"]
}
}
}
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.github
docs
.vscode
.idea
*.md
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs.
# editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
Thank you for your contribution!

Please provide a clear description of the change and the problem it solves.
If it fixes an open issue, please link to the issue.
-->

### Description

### Related Issue

### Checklist

- [ ] I have read the [CONTRIBUTING.md](CONTRIBUTING.md) document.
- [ ] My code follows the style guidelines of this project.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] All new and existing tests passed.
5 changes: 5 additions & 0 deletions .github/RELEASE_BODY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## New in ${TAG}

- Add your release notes here.
- What are the new features?
- What bugs were fixed?
3 changes: 3 additions & 0 deletions .github/RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!--
Thank you for contributing to a release!
-->
1 change: 1 addition & 0 deletions .github/RELEASE_TITLE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Release ${TAG}
7 changes: 7 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security Policy

This is a template repository. To create a security policy for your own project based on this template, you should create your own `SECURITY.md` file.

This file should contain information about which versions of your project are supported with security updates and, most importantly, how to report a vulnerability.

For detailed guidance on adding a security policy to your repository, please see the official [GitHub documentation](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository).
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint and Validate

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install Prettier
run: npm install --global prettier

- name: Run Prettier
run: prettier --check .
50 changes: 50 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy GitHub Pages site

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

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
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
51 changes: 51 additions & 0 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate release notes
id: generate_notes
run: |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)
echo "Previous tag: $PREVIOUS_TAG"

CHANGELOG=$(git log $PREVIOUS_TAG..HEAD --pretty=format:'* %s ([%h](https://github.com/${{ github.repository }}/commit/%H))')

USER_BODY=$(sed "s/\${TAG}/${{ github.ref_name }}/g" .github/RELEASE_BODY.md)

CHANGELOG_HEADER="## What's Changed"
DIFF_LINK="**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...${{ github.ref_name }}"

{
echo "FINAL_BODY<<EOF"
echo "$USER_BODY"
echo ""
echo "---"
echo "$CHANGELOG_HEADER"
echo "$CHANGELOG"
echo ""
echo "$DIFF_LINK"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Create Release
uses: softprops/action-gh-release@v1
with:
title: $(sed "s/\${TAG}/${{ github.ref_name }}/g" .github/RELEASE_TITLE.txt)
body: ${{ steps.generate_notes.outputs.FINAL_BODY }}
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Windows
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
*.[lL][oO][gG]
*.swo
*.swp

# IDEs
.idea/
.vscode/
*.suo
*.user
*.sln.docstates
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
50 changes: 50 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# AGENTS.md: A Guide for AI Assistants

Hello, AI assistant! This file is your guide to understanding and working with the `base` repository. Please read it carefully before making any changes.

## Core Philosophy

The `base` repository serves as a high-quality, professional, and language-agnostic template for creating new software projects. Its core principles are:

1. **Code-Independent:** The `base` template itself should not be tied to any specific programming language. The included Docker environment is based on Ubuntu and NGINX to be as generic as possible.
2. **Well-Documented:** Every feature, configuration file, and workflow should have corresponding documentation in the `/docs` directory. The goal is to leave no part of the repository unexplained.
3. **Guidance over Prescription:** For files like `CONTRIBUTING.md` or `LICENSE`, the template provides sensible defaults and guides the end-user on how to customize them, rather than enforcing a single choice.
4. **Automation:** The repository leverages GitHub Actions for CI, deployment, and releases to automate common developer tasks.

## Repository Structure

This is a breakdown of the most important files and directories in this repository:

- **`.github/`**: Contains all GitHub-specific configurations.
- `workflows/`: Houses the GitHub Actions workflows.
- `ci.yml`: Lints configuration files for syntax and style.
- `pages.yml`: Deploys the documentation to GitHub Pages.
- `release-on-tag.yml`: Automates the creation of GitHub Releases from a git tag.
- `ISSUE_TEMPLATE/` & `PULL_REQUEST_TEMPLATE.md`: Templates for contributors.
- `RELEASE_TITLE.txt` & `RELEASE_BODY.md`: User-editable files for customizing release notes.
- `SECURITY.md`: A template for the user's security policy.

- **`docs/`**: Contains all documentation for the project. Each major feature or component has its own corresponding `.md` file in this directory.

- **`docker/`**: Contains the development environment.
- `Dockerfile`: Builds a generic Ubuntu + NGINX environment.
- `nginx.conf` & `html/index.html`: A simple web server that acts as a health check.

- **`.devcontainer/`**: Configuration for GitHub Codespaces, making it easy to spin up the development environment in the cloud.

- **Root Files**:
- `AGENTS.md`: This file!
- `README.md`: The main entry point, which links to the documentation.
- `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `LICENSE`: Standard community files, designed as templates for the end-user.
- `.gitignore`, `.editorconfig`, `.gitattributes`, `.prettierrc`: Configuration files for git and code styling.
- `docker-compose.yml`: Used to build and run the Docker-based development environment.
- `render.yaml`: Infrastructure-as-code for deploying the application to Render.com.
- `_config.yml`: Configuration for the Jekyll build for GitHub Pages.

## Guidelines for Modification

- **Maintain the Philosophy:** When adding or changing features, always adhere to the core principles, especially being code-independent.
- **Update Documentation:** If you change a feature, you **must** update its corresponding documentation in the `docs/` directory. If you add a new feature, you **must** create a new documentation file for it.
- **Verify Your Work:** After creating or modifying a file, use a read-only tool like `read_file` or `ls` to confirm your changes were applied correctly before marking a step as complete.

Thank you for your help in maintaining and improving this repository!
7 changes: 7 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code of Conduct

This is a template repository. To adopt a Code of Conduct for your own project, you should replace the contents of this file with a code of conduct that you are willing to enforce.

A popular and widely used option is the [Contributor Covenant](https://www.contributor-covenant.org/). You can generate a markdown version of the covenant on their website and paste it into this file.

Remember to update the `[INSERT CONTACT METHOD]` section with a private email address where violations can be reported.
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# How to Contribute

This repository is a template. The contribution guide below is a generic placeholder. You should adapt it to the specific needs of your project.

---

## Getting Started

- Ensure you have read the project's `README.md`.
- If you are proposing a new feature, open an issue first to discuss it.

## Making Changes

1. **Fork the repository** on GitHub.
2. **Create a new branch** for your changes.
```bash
git checkout -b feature/your-feature-name
```
3. **Make your changes** and commit them with a clear and descriptive message.
4. **Push your branch** to your fork on GitHub.
```bash
git push origin feature/your-feature-name
```
5. **Open a Pull Request** to the `main` branch of the original repository.

## Pull Request Checklist

- My code follows the style guidelines of this project.
- I have added tests that prove my fix is effective or that my feature works.
- I have updated the documentation accordingly.

---

_For more ideas on what to include in a contributing guide, check out the [Contributor Covenant's guide](https://www.contributor-covenant.org/docs/contributing-guidelines/)._
5 changes: 5 additions & 0 deletions README.base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Base Repository Documentation

This document serves as the main entry point for understanding the structure and philosophy of the `base` repository.

_This is a placeholder file. You should expand this with detailed documentation about your project's architecture, conventions, and key components._
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome to [base](./docs/base.md)
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-primer
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.8"
services:
dev:
build:
context: ./docker
ports:
- "8080:80"
Loading