Skip to content

DOKI-SERVICE/DOKI-FE

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Authentication Setup

This project uses Supabase for authentication with Google OAuth support.

1. Supabase Setup

  1. Go to Supabase and create a new project
  2. Get your project URL and anon key from the project settings
  3. Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

2. Google OAuth Setup

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google+ API
  4. Go to "Credentials" and create an OAuth 2.0 Client ID
  5. Add your domain to authorized origins
  6. Add your redirect URI: https://your-project.supabase.co/auth/v1/callback
  7. Copy the Client ID and add it to your .env.local:
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id

3. Supabase Database Setup

Create a profiles table in your Supabase database:

CREATE TABLE profiles (
  id UUID REFERENCES auth.users(id) PRIMARY KEY,
  full_name TEXT,
  phone TEXT,
  birth_date DATE,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

-- Enable Row Level Security
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;

-- Create policy to allow users to view and edit their own profile
CREATE POLICY "Users can view own profile" ON profiles
  FOR SELECT USING (auth.uid() = id);

CREATE POLICY "Users can update own profile" ON profiles
  FOR UPDATE USING (auth.uid() = id);

CREATE POLICY "Users can insert own profile" ON profiles
  FOR INSERT WITH CHECK (auth.uid() = id);

4. Supabase Auth Settings

  1. In your Supabase project, go to Authentication > Settings
  2. Add your site URL to the Site URL field
  3. Add your redirect URLs to the Redirect URLs field:
    • http://localhost:3000/auth/callback (for development)
    • https://yourdomain.com/auth/callback (for production)
  4. In Authentication > Providers, enable Google and add your Google OAuth credentials

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published