Sizzle is a monorepo template for building fullstack Javascript applications (React frontend and Node backend). If you want to build an app with the technologies listed below while staring with out-of-the-box answers for useful and annoying to setup project capabilities, Sizzle might be for you.
- Typescript
- tRPC
- React
- Tailwind
- Fastify
- DrizzleORM
I've found the following are very useful in mature projects, can become more difficult to set up over time, and are easy to keep putting off. As a result Sizzle has answers for all of the following right out of the gate.
- Database
- Uses Docker to enable both local development and ephemeral deployed environments
- Commands and configuration for starting/stopping, migrations, etc.
- Maintain and grow a set of seed data for testing, development
- Monorepo configuration with Nx
- Apps / libs to enable seamless with (e.g. tRPC, Tailwind, Drizzle)
- Using latest and greatest build tools (Vite / esbuild)
- CI/CD (TODO)
- Custom generators (TODO)
- Clone this repository
- Create local environment variables:
cp ./apps/server/.env.sample ./apps/server/.env.local && cp ./apps/web/.env.sample ./apps/web/.env.local
- Setup database
- Build image / start container:
docker compose up -d
- Run migrations:
yarn db:migrations:run
- Seed data:
yarn db:seed
- Build image / start container:
- Start server
yarn nx serve server
- Start web app
yarn nx serve web
- Copy the repository
- Search and replace "sizzle" in file contents and names with your chosen project name.
- Database cleanup
- If you followed the steps in "Running Locally", then:
yarn db:clear
- Delete existing migrations:
rm -rf ./libs/db/schema/src/lib/migrations/
- Generate new migrations after creating your own entities:
yarn db:migrations:generate
- If you followed the steps in "Running Locally", then:
- Get cooking!
The following are enhancements that may be added alongside current apps in this monorepo, or might turn into totally separate templates.
- Different web frameworks / React alternatives (e.g. Solid, Svelte, Vue, Angular, etc.)
- Mobile app (specifically with React Native)
- Non-javascript backend
- Server / Client API contract via OpenAPI or GraphQL
- Different databases
- Specifically different categories of database - substituting MySQL for PostgreSQL after copying this template should not be too involved, but the setup for things like Redis, MongoDB, etc. is likely different enough to warrant inclusion at some point
- CLI for generating new projects
See also TODOs. Open to further suggestions here, please open an issue!
- Server-side Rendering: Great tools already exist to get started with SSR frameworks. However, there are many use cases that reap real benefits from being a web app, but do not not from SSR. Sizzle targets these use cases.
- Authentication: Similarly, great tools and products already exist for managing authentication in greenfield projects, but in many cases developers will be plugging into an existing authentication system even when starting a new app. For this reason I've chosen to leave authentication out entirely