This project is a custom implementation inspired by the Supabase Nuxt 3 tutorial for learning purposes. It is built using Nuxt.js and TypeScript, integrating Supabase for backend services. The project demonstrates how to set up authentication, manage user accounts, and handle real-time data updates using Supabase within a Nuxt.js application. It also leverages Nuxt UI for the frontend component library, providing a seamless and modern user interface.
- Overview
- Background
- Demo
- Requirements
- Modules Used
- Installation
- Configuration
- Usage
- Project Structure
- Dependencies
- Features
- License
This project started as a small, simple demo a few years ago when I was learning Nuxt. Initially, I followed the Supabase guide to get started with Nuxt 3 and Supabase integration.
The tutorial used basic inline Tailwind CSS for styling, but I wanted to expand the user interface to gain a deeper understanding of UI development. Initially, I chose Daisy UI for its visually appealing design, but it relied heavily on inline styling and lacked comprehensive components.
A year later, I revisited the project and decided to switch to Nuxt UI. By then, Nuxt UI had significantly progressed, offering a more robust and integrated solution for building user interfaces within the Nuxt ecosystem.
Authentication page where users log in. |
Account management page where users can update their profiles. |
Automatic detection and switching of color modes. |
- Node.js v14 or higher
- npm v6 or higher, or yarn v1.22 or higher
- Supabase account
This module allows for easy implementation of color modes (e.g., dark mode, light mode) within the application. It provides a simple way to manage and switch between different color schemes.
This module integrates Supabase, an open-source Firebase alternative, into the Nuxt project. It provides backend services such as authentication, database, and storage, making it easier to build full-stack applications.
Nuxt UI is a component library for Nuxt 3 that includes a set of ready-to-use UI components. It helps in building user interfaces quickly and efficiently, ensuring a consistent design across the application.
You can use either npm
or yarn
to install the dependencies. Follow the instructions below:
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo
-
Install dependencies:
npm install
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo
-
Install dependencies:
yarn install
-
Create a
.env
file at the root of the project and add your Supabase credentials:SUPABASE_URL=your-supabase-url SUPABASE_KEY=your-supabase-key
Alternatively, you can add your Supabase credentials directly in the nuxt.config.ts
file:
export default defineNuxtConfig({
runtimeConfig: {
public: {
supabaseUrl: 'your-supabase-url',
supabaseKey: 'your-supabase-key',
},
},
});
-
Start the development server:
npm run dev
yarn dev
-
Open your browser and navigate to
http://localhost:3000
. -
For building the project for production, use:
npm run build
yarn build
-
To start the production server, use:
npm run start
yarn start
-
To generate a static version of the project, use:
npm run generate
yarn generate
Make sure to check the package.json
file for other useful scripts and commands.
.
├── assets
│ ├── images
│ │ ├── Account.gif
│ │ ├── Auth.gif
│ │ ├── ColorMode.gif
│ ├── main.css
│ └── ...
├── components
│ ├── Auth.tsx
│ ├── Account.tsx
│ ├── Avatar.tsx
│ ├── ColorMode.tsx
│ └── ...
├── composables
│ ├── useNotification.ts
│ └── ...
├── layouts
│ └── default.tsx
├── pages
│ ├── index.tsx
│ └── ...
├── nuxt.config.ts
├── package.json
├── .env
└── ...
- @nuxtjs/tailwindcss: 6.11.0
- @supabase/gotrue-js: ^2.62.2
- yup: 1.4.0
- @nuxt/devtools: latest
- @nuxt/ui: ^2.13.0
- @nuxtjs/color-mode: ^3.4.1
- @nuxtjs/supabase: ^1.2.2
- nuxt: ^3.10.1
- typescript: ^5.4.5
- Authentication: User authentication using Supabase.
- Account Management: Manage user accounts and profiles.
- Real-time Data: Handle real-time data updates.
- UI Components: Modern and responsive UI components provided by Nuxt UI.
This project is licensed under the MIT License. See the LICENSE file for details.