TemplateJs is a minimal single-page web app template designed for quick deployment. It follows an AI-assisted iterative development process:
- User stories and requirements drive feature development.
- Each iteration is a single commit for easy review.
- AI-assisted coding minimizes manual intervention.
- The focus is on defining clear requirements rather than manual coding.
This approach enables rapid prototyping and structured iteration.
- Fork and Open in CodeSpaces: Fork this repository and open your fork using GitHub CodeSpaces.
- Configure GitHub Pages: Navigate to your repository's
Settings
->Pages
. In the "Branch" section, select themain
branch to be automatically deployed by GitHub. - Access Your WebApp: If your fork is
github.com/YourUserName/YourFork
, your WebApp will be live atYourUserName.github.io/YourFork
. - Install Recommended VSCode Extensions (Optional but Recommended):
- "Live Server": Renders the
index.html
page and provides live updates during development. - "GitHub Copilot": Assists with coding tasks within CodeSpaces.
- "Git Graph": Helps visualize and manage Git branches.
- "Live Server": Renders the
- Development Workflow:
- Modify
index.html
for the main page structure. - Add or edit JavaScript modules in the
src/
directory. - Place static assets like images or JSON files in
src/assets/
. - Create new HTML pages in the
pages/
directory if needed. - Regularly commit and push your changes to the
main
branch to update your live application.
- Modify
This template uses a structured approach to organize files and facilitate development:
/
├── babel.config.js # Babel configuration for JavaScript transpilation
├── index.html # Main HTML entry point for the application
├── LICENSE # Project license information
├── package.json # NPM package configuration, scripts, and dependencies
├── README.md # This file: project overview and instructions
├── pages/ # Contains additional static HTML pages
│ ├── about.html
│ └── features.html
└── src/ # Main source code directory
├── index.js # Primary JavaScript entry point, linked from index.html
├── index.test.js # Tests for index.js
├── assets/ # For static assets like JSON data, images, etc.
│ └── defaultData.json
├── components/ # Reusable UI components or JavaScript modules
│ ├── person.js
│ └── person.test.js
└── utils/ # Utility functions and helpers
├── utils.js
└── utils.test.js
- Modularity: Keep JavaScript modules in
src/components/
orsrc/utils/
focused on specific functionalities. - Separation of Concerns:
index.html
defines the structure.- JavaScript in
src/
handles the logic. - Static assets are stored in
src/assets/
. - Additional distinct pages go into the
pages/
directory.
- Testing: Write unit tests for your JavaScript modules (e.g.,
*.test.js
). This template is set up for Jest, but you can adapt it. - Dependencies: Manage front-end dependencies using
package.json
. - Babel:
babel.config.js
is configured for modern JavaScript. You can extend it if needed. - Clarity: Ensure your file and folder names are descriptive.
TemplateJs is provided as-is. It is a general-purpose template and does not include domain-specific functionality. Use and modify as needed.