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
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
- Go to
./app/.server/db/drizzle.ts
- Configure your database using drizzle-docs
- Go to
./app/.server/db/schema.ts
and modify theusers
table to your corresponding database
2. Push database
npx drizzle-kit push
Run the app
npm run dev
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
Top comments (0)