Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giacomorebonato/fastrat
Fullstack starter kit, using Fastify + React = FastRat
https://github.com/giacomorebonato/fastrat
fastify playwright pwa react typescript vite
Last synced: about 1 month ago
JSON representation
Fullstack starter kit, using Fastify + React = FastRat
- Host: GitHub
- URL: https://github.com/giacomorebonato/fastrat
- Owner: giacomorebonato
- License: mit
- Created: 2023-12-12T08:32:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T20:19:22.000Z (about 2 months ago)
- Last Synced: 2024-10-29T22:46:56.586Z (about 2 months ago)
- Topics: fastify, playwright, pwa, react, typescript, vite
- Language: TypeScript
- Homepage: https://www.fastrat.dev
- Size: 5.75 MB
- Stars: 27
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fastify + React = FastRat!
## Quickstart
```bash
gh repo clone giacomorebonato/fastrat-test # clone the repository
pnpm install # install dependencies
pnpm dev # start the project in dev mode
```To enable authentication and a production database, rename `.env.example` to `.env` and fill the fields properly.
In a production environment, you should set those environment variables directly.[Example with Fly.io](https://fly.io/docs/reference/secrets/)
- [Authentication](#authentication)
- [sqlite on LiteFS](#sqlite-on-litefs)
- [SSR and Routing](#ssr-and-routing)
- [tRPC](#trpc)
- [Server side data fetching](#server-side-data-fetching)
- [Testing](#testing)
- [Deploy](#deploy)
- [Credits](#credits)## Based on these libraries
* [Fastify](https://fastify.dev): a fast well maintained web framework
* [Vite](https://vitejs.dev): for frontend tooling and bundling
* [tRPC](https://trpc.io/docs/server/adapters/fastify): for end points with E2E type safety
* [Tanstack Router](https://tanstack.com/router/latest): for filesystem based routes with type safety
* [Vavite](https://github.com/cyco130/vavite): use Vite to compile and bundle both client and server code
* [Fly.io](https://fly.io): for deploymentThanks to Vavite, any change to frontend or backend code will be reflected immediately, without manually restarting the server.
## Authentication
Provide `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` into the `.env` file to allow Google authentication ([instructions](https://www.balbooa.com/help/gridbox-documentation/integrations/other/google-client-id)).
You can check how authentication is achieved in [src/features/auth/google-auth.ts](src/auth/google-auth.ts) by leveraging [fastify-oauth2](https://github.com/fastify/fastify-oauth2).
It should be easy for you to re-use this example to add other authentication providers.## sqlite on LiteFS
Follow the official steps for configuring LiteFS
1. create a volume `fly volumes create litefs --size 10`
3. create a Consul URL `fly consul attach`## SSR and Routing
SSR is achieved by following [Tanstack router examples](https://github.com/TanStack/router/tree/main/examples/react/basic-ssr-streaming-file-based).
The page content is streamed and meta tags in `