https://github.com/simonsmith/react-router-fastify
Boilerplate to get started with React Router 7 and Fastify
https://github.com/simonsmith/react-router-fastify
Last synced: 11 months ago
JSON representation
Boilerplate to get started with React Router 7 and Fastify
- Host: GitHub
- URL: https://github.com/simonsmith/react-router-fastify
- Owner: simonsmith
- Created: 2025-01-28T09:55:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-17T20:37:55.000Z (about 1 year ago)
- Last Synced: 2025-03-28T11:42:55.255Z (about 1 year ago)
- Language: TypeScript
- Size: 44.9 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Router ❤️ Fastify
This is a boilerplate to start an application with [React Router 7](https://reactrouter.com/home)
and [Fastify](https://fastify.dev/)
## Get Started
1. Clone the repository
2. Install the packages with your favourite package manager (there is no
lockfile by default, so choose whatever suits you)
3. Run the development server (`bun run dev`)
4. Get ready for production with (`bun run build && bun run start`)
## Structure
```
client
├── common # things shared across all features/pages
│ ├── components
│ │ ├── Container.tsx
│ └── util
│ ├── page-title.ts
├── features # feature directory
│ └── UserList # features can contain whatever needed, components styles etc
│ ├── components
│ │ └── UserList.tsx
│ └── index.ts # a place to easily export things
├── layouts
│ └── Default.tsx
├── pages # components rendered by routes
│ ├── HomePage.tsx
│ └── UserPage.tsx
├── queries # functions, options etc for react-query
│ └── users.ts
├── root.ts
├── routes
│ ├── home.tsx # react-router files, these data load and render from client/pages
│ └── users.tsx
├── routes.ts # configure the routes here
└── styles
└── app.css
server
├── api
├── index.ts # does checks before starting the server
├── start.ts # starts the Fastify server
└── util # common utils
```
## Commands
| Command | Action |
| :--------------- | :--------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts the vite development server |
| `npm run build` | Builds the production site to `./build/` |
| `npm run format` | Formats files with Biome |
| `npm run check` | Runs all linter checks |
| `npm run fix` | Fix formatting and linting via Biome |
| `npm run start` | Start the server with Node |
## Credit
Inspired by the excellent [mcansh/remix-fastify](https://github.com/mcansh/remix-fastify) examples