Skip to content

cs-util/TemplateJs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TemplateJs

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.

Using the Template

  1. Fork and Open in CodeSpaces: Fork this repository and open your fork using GitHub CodeSpaces.
  2. Configure GitHub Pages: Navigate to your repository's Settings -> Pages. In the "Branch" section, select the main branch to be automatically deployed by GitHub.
  3. Access Your WebApp: If your fork is github.com/YourUserName/YourFork, your WebApp will be live at YourUserName.github.io/YourFork.
  4. 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.
  5. 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.

Project Structure

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

Best Practices:

  • Modularity: Keep JavaScript modules in src/components/ or src/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.

Disclaimer

TemplateJs is provided as-is. It is a general-purpose template and does not include domain-specific functionality. Use and modify as needed.

About

A template repo that can be forked to quickly get started with new projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 81.4%
  • JavaScript 18.6%