ditadi / web-boilerplate

Boilerplate with NextJS, RSC, Clerk, Turso, Drizzle and much more things.
https://web-boilerplate-2.vercel.app
52 stars 3 forks source link

Ditadi Boilerplate

Hello, I created this repo to test and try all new stuff in web development.

Web Development is moving forward blazing-fast and new techniques and libraries are borning all day.

Maybe this repo help you if you trying to set up:

I will continue updating this repo with new things, maybe you can suggest :)

Feel free to clone, test, or maybe start as the initial point of your new project.

TODO:

How to run?

1: Generate Auth and DB keys

TursoDB:
1: Download turso-cli (https://turso.tech)


2: Create the Database
turso db create {{database_name}}
turso db show {{database_name}}

Copy the DATABASE_URL generated above to store on .env below.

3: Create the Auth Token
turso db tokens create {{database_name}} -e none
Copy the token generate above to store on .env below.

ClerkJS:
1: Create an account on Clerk (https://clerk.com) and copy the NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY.
2: On Clerk Path, add the same configurations below (Maybe is not necessary)

2: Migration

You should create and run the migrations to create your database tables.

1: Generate the Migration
cd apps/web

npx drizzle-kit generate:sqlite

2: Push to DB
turso db shell {{database_name}} < migrations/{{migration_file}}.sql

3: Create .env

Create .env file on the root and put the keys above.

    {
        NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY={{NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}}
        CLERK_SECRET_KEY={{CLERK_SECRET_KEY}}
        NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
        NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
        NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
        NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
        DATABASE_URL={{DATABASE_URL}}
        DATABASE_AUTH_TOKEN= {{DATABASE_AUTH_TOKEN}}
    }

3: Install and Run the App

On the root
pnpm install
pnpm dev

Check http://localhost:3000