Relivator Installation
Relivator is a Next.js template for building eCommerce platforms. This guide will help you install and configure the project.
Setup
1 Clone the repository:
git clone https://github.com/blefnk/relivator.git
2 Install the dependencies:
bun i
Environment Variables
-
Copy the example environment file to create your local environment configuration:
cp .env.example .env
-
Update the values in
.env
with your own credentials:- Generate a secure random string for
AUTH_SECRET
(at least 32 characters) - Add your GitHub OAuth credentials (
AUTH_GITHUB_ID
andAUTH_GITHUB_SECRET
) - Add your Google OAuth credentials (
AUTH_GOOGLE_ID
andAUTH_GOOGLE_SECRET
) - Set your database connection string
- Generate a secure random string for
OAuth App Setup
GitHub OAuth App
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in the application details:
- Application name: MyNextApp (or your app name)
- Homepage URL: http://localhost:3000
- Authorization callback URL: http://localhost:3000/api/auth/callback/github
- Register the application and copy the Client ID and Client Secret
Google OAuth App
- Go to Google Cloud Console
- Create a new project if needed
- Configure the consent screen
- Create OAuth client ID credentials:
- Application type: Web application
- Name: MyNextApp (or your app name)
- Authorized JavaScript origins: http://localhost:3000
- Authorized redirect URIs: http://localhost:3000/api/auth/callback/google
- Create the client and copy the Client ID and Client Secret
Database Migration
To set up the database tables for Better Auth:
bun db:auth
It will generate the users schema with 'Table' suffix added to variable names and references. Make sure to not edit the src/db/schema/users.ts
file directly, as it will be overwritten by the bun db:auth
command. Edit the src/lib/auth.ts
file instead.
Usage
Before first usage don't forget to run the following command to push the database schema to your database:
bun db:push
After setting up the environment variables and running the database migration, you can start the development server:
bun dev
The application will be available at http://localhost:3000
This is a Next.js project bootstrapped with create-next-app
.