DEV Community

Cover image for Remix Drizzle Auth Template
mmvergara
mmvergara

Posted on

1 1 1 1 1

Remix Drizzle Auth Template

Remix Drizzle Auth Template

Just a simple template to get you started, i did all of the boilerplates for the authentication, so you can focus on implementing the app itself, the drizzle i setup for sqlite db by default, but you can easily change it.

Installation

# Clone the repository
npm install
Enter fullscreen mode Exit fullscreen mode

Database Setup

Currently we are using sqlite and using ./local.db as the database file. If you are using sqlite you can skip step 1.

1. Setup and pick your own database

  • Remove sqlite
  npm uninstall libsql
  rm ./local.db
Enter fullscreen mode Exit fullscreen mode
  • Go to ./app/.server/db/drizzle.ts
  • Configure your database using drizzle-docs
  • Go to ./app/.server/db/schema.ts and modify the users table to your corresponding database

2. Push database

npx drizzle-kit push
Enter fullscreen mode Exit fullscreen mode

Run the app

npm run dev
Enter fullscreen mode Exit fullscreen mode

What you need to know

  • All of db operations are done in `./app/.server/db, you can organize them in you liking

  • To protect routes you should always call requireUser function in the loader

  • Routes

    • ./
    • ./singin
    • ./signup
    • ./protected

Authentication logic heavily inspired by AlemTuzlak

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay