Skip to content

๐ŸฆœThis repository serves as a boilerplate for my future projects, containing essential configurations, common libraries, and standard files to kickstart development efficiently. It's designed to ensure consistency and best practices across all my projects, providing a solid foundation to build upon.

License

Notifications You must be signed in to change notification settings

Jagoda11/my-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ TypeScript Full-Stack Template

License Open Issues Last Commit Build Status TypeScript Build Status

This project is a template for setting up a full-stack TypeScript application with a Node.js backend ๐ŸŸฉ and your choice of frontend framework: React โš›๏ธ, Angular ๐Ÿ…ฐ๏ธ, or Vue ๐ŸŸข.

This project includes pre-configured setups for:

  • Babel ๐Ÿต
  • TypeScript ๐Ÿ”ต
  • ESLint ๐Ÿ› ๏ธ
  • Prettier ๐Ÿ–‹๏ธ
  • Jest ๐Ÿƒ
  • Husky ๐Ÿถ

๐Ÿš€ Initial Setup

First, install the project dependencies:

npm install

Next, run the setup-eslint script to choose your frontend and backend frameworks:

npm run setup-eslint

This script will prompt you to choose a frontend framework (React โš›๏ธ, Angular ๐Ÿ…ฐ๏ธ, or Vue ๐ŸŸข), css library and a backend framework is always Node. It will then install the necessary dependencies and configure the project for the chosen frameworks.

โš ๏ธ Important: After the initial setup, manually delete the setup-eslint.ts file and its reference in the package.json scripts. Also, don't forget to remove the FRAMEWORKS_GUIDE.md file as it is no longer needed. ๐Ÿ—‘๏ธ

To remove the setup script and its references after the initial setup, you can run the following command in your terminal:

rm ./setup-eslint.ts && sed -i '' '/"setup-eslint":/d' package.json && rm FRAMEWORKS_GUIDE.md && sed -i '' '/Frameworks Guide/d' README.md

โš ๏ธ Important: After running the above command, make sure to update your README.md file to remove any scripts or references that are no longer needed. Also, remember to update the CONTRIBUTING.md file and any other files that contain a GitHub link to this project.

โš ๏ธ Note on Commits

If you're having trouble making a commit, it might be due to the precommit hook, which runs the lint and test scripts before each commit. If these scripts find any errors, the commit will be blocked. Check the output for any lint or test errors and fix them before trying to commit again.

๐Ÿ“œ Scripts

To run these scripts, use npm run <script-name>:

  • start: ๐Ÿš€ Builds the TypeScript code and starts the application.
  • build: ๐Ÿ”จ Compiles the TypeScript code using the TypeScript compiler (tsc).
  • test: ๐Ÿงช Runs tests using Jest and generates a coverage report.
  • format: ๐Ÿ–‹๏ธ Formats the code using Prettier.
  • lint: ๐Ÿงน Lints all JavaScript and TypeScript files in the project using ESLint.
  • lint:root: ๐Ÿงน Lints JavaScript and TypeScript files in the root directory, excluding the frontend and backend directories.
  • lint:frontend: ๐Ÿงน Lints JavaScript and TypeScript files in the frontend directory.
  • lint:backend: ๐Ÿงน Lints JavaScript and TypeScript files in the backend directory.
  • setup-eslint: ๐Ÿ”ง Runs the setup script to choose the frontend and backend frameworks, install the necessary dependencies, and configure the project.
  • precommit: ๐Ÿ”’ Runs the lint and test scripts before each commit to ensure code quality. This is managed by Husky ๐Ÿถ.
  • pretest: ๐Ÿ” Lints the code before running tests.
  • watch: ๐Ÿ‘€ Runs tests in watch mode using Jest.
  • debug: ๐Ÿž Starts the application in debug mode using nodemon.
  • clean: ๐Ÿงฝ Removes the node_modules directory and package-lock.json file.
  • prepare: ๐Ÿพ Sets up Husky for managing git hooks.

๐Ÿค– GitHub Actions Workflows

This template includes several GitHub Actions workflows that automate various tasks:

  • ๐Ÿš€ci.yml: Runs your project's continuous integration (CI) tasks.
  • ๐Ÿ”close-merged-pull-requests.yml: Automatically closes pull requests that have been merged.
  • โณclose-stale-issues-and-prs.yml: Closes stale issues and pull requests.
  • ๐Ÿท๏ธlabel-new-pull-requests.yml: Automatically adds labels to new pull requests. -๐Ÿ™thank-contributors-on-issue-close.yml: Thanks contributors when an issue they commented on is closed.
  • ๐Ÿ‘‹welcome-new-pull-requests.yml: Posts a welcome message on new pull requests.
  • ๐Ÿ‘‹welcome.yml: Posts a welcome message on new issues.
  • โฌ†๏ธnpm-update.yml: runs every day and updates package.json with new versions of dependencies
  • ๐Ÿงนremove-stale-unmerged-branches.yml: Remove stale unmerged branches
  • ๐Ÿงนremove-merged-branches.yml: Remove merged Branches

These workflows use the secrets.GITHUB_TOKEN secret, which GitHub automatically creates for every repository. You can create a personal access token and add it as a secret in your repository. For more information, see Creating and storing encrypted secrets.

๐ŸŒ GitHub Codespaces Support

This project includes a .devcontainer.json file which allows you to work on this project in a Docker container using GitHub Codespaces. This helps to maintain a consistent development environment, making it easier for you to collaborate with others without having to worry about individual setup.

GitHub Codespaces configures your development environment based on your project's needs using this file. When you create a new codespace for this project, the Codespaces environment is automatically configured as per the settings defined in .devcontainer.json.

To use GitHub Codespaces:

  1. Navigate to the main page of the repository.
  2. Click the Code button and then click "Open with Codespaces".
  3. Click "+ New codespace".

Your development environment is now set up and running in a Docker container in the cloud. All commands you run in the Codespaces terminal will be executed inside the container. Any changes you make to the project will be reflected in the container and vice versa.

๐Ÿ“š Frameworks Guide

For more information on how to choose and work with different frontend and backend frameworks in this project, please read the Frameworks Guide.

๐Ÿ’– Support

If you appreciate my work and would like to support me, consider sponsoring me on GitHub Sponsors. Your support is greatly appreciated and helps me continue my contributions to open source and volunteer work.

๐Ÿค Contributing

Contributions are welcome! Please read the Contributing Guide. for details on our code of conduct and the process for submitting pull requests.

๐Ÿ“œ Code of Conduct

Please read our Code of Conduct to keep our community approachable and respectable.

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

ยฉ 2024 Jagoda11

๐Ÿ“– Related Articles

For more insights and detailed guides, check out these related articles:

About

๐ŸฆœThis repository serves as a boilerplate for my future projects, containing essential configurations, common libraries, and standard files to kickstart development efficiently. It's designed to ensure consistency and best practices across all my projects, providing a solid foundation to build upon.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project