https://github.com/jhordyess/fastify-ts-starter
Starter project for using Fastify with TypeScript.
https://github.com/jhordyess/fastify-ts-starter
eslint fastify husky pnpm prettier tsx typescript
Last synced: 3 months ago
JSON representation
Starter project for using Fastify with TypeScript.
- Host: GitHub
- URL: https://github.com/jhordyess/fastify-ts-starter
- Owner: jhordyess
- Created: 2025-04-21T14:39:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-25T01:56:52.000Z (12 months ago)
- Last Synced: 2025-07-02T19:09:03.509Z (12 months ago)
- Topics: eslint, fastify, husky, pnpm, prettier, tsx, typescript
- Language: JavaScript
- Homepage:
- Size: 128 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fastify TypeScript Starter
This is a starter project for building a backend application using Fastify, TypeScript and Webpack.
## Features
- **Fastify**: A fast and low-overhead web framework for Node.js. (v. 5)
- **TypeScript**: Strongly typed JavaScript for better development experience. (v. 5)
- **Webpack**: Module bundler for compiling and optimizing the code. (v. 5)
- **ESLint**: Linting for maintaining code quality. (v. 9)
- **Prettier**: Code formatting for consistent style. (v. 3)
- **Husky**: Git hooks for enforcing pre-push checks. (v. 9)
- **pnpm**: Package manager for managing dependencies. (v. 10)
## Prerequisites
1. Install [Node.js](https://nodejs.org/en/download) (LTS version recommended).
2. Enable Corepack to use a stable version of pnpm:
```sh
corepack enable pnpm
```
## Getting Started
1. Clone the repository:
```sh
git clone https://github.com/jhordyess/fastify-ts-starter.git
```
2. Navigate to the project folder:
```sh
cd fastify-ts-starter
```
3. Install dependencies:
```sh
pnpm i
```
4. Start the development server:
```sh
pnpm dev
```
5. Open your browser or API client and interact with the server running at [http://localhost:8080](http://localhost:8080).
## Project Structure
```md
fastify-ts-starter/
├── .gitignore # List of files and directories to be ignored by version control.
├── .prettierrc.json # Prettier configuration file.
├── eslint.config.js # ESLint configuration file.
├── package.json # Project configuration and dependencies.
├── pnpm-lock.yaml # pnpm lock file for dependency versions.
├── pnpm-workspace.yaml # pnpm workspace configuration file.
├── README.md # Project documentation.
├── tsconfig.json # TypeScript configuration file.
├── .husky/ # Directory for Git hooks managed by Husky.
│ ├── pre-push # Pre-push hook to run linting and TypeScript checks.
├── src/
│ ├── index.ts # Main entry point of the application.
```
## Commands
### Start the development server
```sh
pnpm dev
```
### Build the project for production
```sh
pnpm build
```
### Build the project for production with linting
```sh
pnpm build:lint
```
### Start the production server
```sh
pnpm start
```
### Run TypeScript checks
```sh
pnpm ts-check
```
### Lint the code
```sh
pnpm lint
```
### Validate the project (lint + TypeScript checks)
```sh
pnpm validate
```
### Format the code
```sh
pnpm format
```
## Contributing
Contributions are welcome! If you find any issues or want to enhance the project, feel free to submit a pull request.
---
Happy coding!