Simple starter kit which just works
- Fastify: High-performance backend framework with a plugin-based architecture
- React 18: Latest version of React for building dynamic user interfaces
- TypeScript: Strong typing for both frontend and backend
- Vite: Next-generation frontend tooling for rapid development
- Turbo: Efficient monorepo management and task running
- tRPC: End-to-end typesafe APIs for seamless client-server communication
- Ant Design: Comprehensive UI component library for React
- Zustand: Lightweight state management for React
- Orchid ORM: Lightweight ORM for PostgreSQL
- zod: TypeScript-first schema validation
fastify-react-starter/
├── apps/
│ ├── api/ # Fastify backend
│ └── pwa/ # React frontend
├── packages/ # Shared utilities and configurations
├── turbo.json # Turbo configuration
└── package.json # Root package.json
-
Clone the repository:
git clone https://github.com/teziapp/fastify-react-starter.git cd fastify-react-starter
-
Install dependencies:
pnpm i
-
Set up environment variables:
Create
.env
files at the root and in theapi
directory:Root
.env
:ENVIRONMENT='dev' FRONTEND_URL=http://localhost:5173 VITE_BE_URL=http://localhost:3000
api/.env
:ENVIRONMENT='dev' DB_URL=postgres://postgres:postgres@localhost:5432/boilerplate DB_TEST_URL=postgres://postgres:postgres@localhost:5432/boilerplate FRONTEND_URL=http://localhost:5173 VITE_BE_URL=http://localhost:3000 GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret JWT_SECRET=your_jwt_secret
-
Set up the database:
pnpm run db create pnpm run db migrate up
-
Start the development server:
pnpm run dev
-
Build for production:
pnpm run build
pnpm run dev
: Start development servers for both backend and frontendpnpm run build
: Build both applications for productionpnpm run lint
: Run ESLint across the projectpnpm run db
: Manage database operations (create, migrate, etc.)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.