Skip to content

icflorescu/mantine-next

Repository files navigation

Mantine Next

The easiest way to initialize a new project with Mantine and Next.js.

Features

This is an opinionated template that includes:

  • Mantine, the best React UI library
  • Next.js, the de-facto metaframework for building React web applications
  • tRPC paired with TanStack Query, exclusively for client-side RPCs
  • Styling with CSS Modules, the recommended way to style Mantine applications; no TailwindCSS
  • TypeScript, of course
  • IronSession for authentication
  • Drizzle for database access (should be easy to replace with Prisma or Kysely)
  • SQLite-file database

Getting Started

  1. Clone the repository (i.e. git clone https://github.com/icflorescu/mantine-next.git)
  2. Install dependencies with pnpm i
  3. Make a copy of .env.example, name it .env and make sure to set a strong password for the session cookie
  4. Generate the database file with pnpm db:init
  5. Seed the database with pnpm db:seed
  6. Start the development server with pnpm dev.

Why this exists

I've been using Mantine and Next.js for a while to build most of my projects for the past few years.
Next.js is a great framework, but, to put it bluntly, it has its fair share of issues and quirks, and deciding upon how to best structure a project can be a bit of a challenge.

Q & A

  1. Why Drizzle
    I've been using Prisma for most of my work, but Drizzle is leaner, faster, and allows you to dynamically build complex queries when needed.

  2. Why SQLite
    Because it's easy to set up, a great choice for prototyping, local development, and - believe it or not - even production (see Turso).
    I'm using PostgreSQL for large projects, though, but I didn't want to add a Dockerfile to this project.

  3. Why not TailwindCSS && ShadcnUI
    To cut short a potentially long debate: Mantine already provides enough properly-styled components.
    If you're here, you're problably looking for a way to quickly build an application that features truly user-frienly input components out-of-the-box.

Support the project

If you find this package useful, please consider ❤️ sponsoring my work.
Your sponsorship will help me dedicate more time to maintaining the project and will encourage me to add new features and fix existing bugs.
If you're a company using Mantine, Mantine DataTable, Mantine ContextMenu or other open-source projects I built, I'd love to hear from you.
If you need help in a commercial project, you can also hire my services (see hiring the author below).
Starring the repo on GitHub is also greatly appreciated.

Hiring the author

If you want to hire my services, don’t hesitate to drop me a line at the email address listed in my GitHub profile. Mentioning Mantine and Next.js or TanStack will result in a faster response.

Acknowledgements

Special thanks to Vitaly Rtishchev and the awesome contributors of Mantine for putting countless hours of work into building and maintaining the best React UI library I've ever used.

License

The MIT License.

About

The easiest way to initialize a new project with Mantine, Next.js and tRPC.

Resources

License

Stars

Watchers

Forks

Contributors