A modern, type-safe, and full-stack boilerplate for building robust web applications.
Getting Started • Features • Architecture • Development • Contributing
final_with_text.mov
-
🦀 Rust Backend
- Fast, reliable, and memory-safe server implementation
- GraphQL API using async-graphql
- Built-in JWT authentication
- In-memory database for rapid prototyping
-
🌳 Elm Frontend
- Type-safe frontend development
- Automatic GraphQL code generation
- Zero runtime exceptions
- Predictable state management
-
🎨 Modern UI
- Tailwind CSS for utility-first styling
- Responsive design out of the box
- Dark mode support
- Custom components
-
🛠 Developer Experience
- Hot reloading for both frontend and backend
- GraphQL Playground for API exploration
- Type safety across the entire stack
- Comprehensive documentation
Make sure you have the following installed:
- Clone the repository:
git clone <repository-url>
cd rust-graphql-elm-tailwind-boilerplate
- Install dependencies:
# Install dependencies (this will also install Elm frontend dependencies via postinstall)
npm install
- Set up your environment:
cp .env.example .env
# Edit .env with your JWT_SECRET and ADMIN_PASSWORD
- Start the development servers:
npm run dev
Your application will be available at:
- 🌐 Frontend: http://localhost:8000
- 🔧 Backend API: http://localhost:8080
- 📝 GraphQL Playground: http://localhost:8080/playground
.
├── src/
│ ├── main.rs # Rust backend entry point
│ ├── graphql/ # GraphQL schema and resolvers
│ │ ├── schema.rs # GraphQL schema definition
│ │ └── resolvers/ # Query and mutation resolvers
│ ├── db/ # In-memory database implementation
│ └── elm/ # Elm frontend application
│ ├── src/ # Elm source code
│ │ ├── Main.elm # Application entry point
│ │ └── Api/ # Generated GraphQL types
│ └── styles/ # Tailwind CSS styles
├── Cargo.toml # Rust dependencies
└── package.json # Node.js dependencies
npm run dev
- Start development serversnpm run build
- Build for productionnpm run test
- Run testsnpm run generate
- Generate GraphQL types for Elm
The GraphQL Playground is available at http://localhost:8080/playground during development. Use it to:
- Explore the API schema
- Test queries and mutations
- View documentation
- Define your GraphQL types in the Rust backend
- Implement resolvers for your new types
- Generate Elm types using
npm run generate
- Implement the frontend features in Elm
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.