Skip to content

Commit 2608c08

Browse files
committed
docs add sidebar
1 parent 965d4fd commit 2608c08

8 files changed

Lines changed: 310 additions & 124 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ Temporary Items
5656
.apdisk
5757

5858
bin/act
59-
data
59+
data
60+
docs/.vitepress/cache
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
4+
const contributors = ref<{ id: string, avatar_url: string, login: string, html_url: string }[]>([])
5+
6+
fetch('https://api.github.com/repos/rrd108/nuxt-users/contributors')
7+
.then(res => res.json())
8+
.then((data) => {
9+
contributors.value = data
10+
})
11+
.catch((err) => {
12+
console.error(err)
13+
})
14+
</script>
15+
16+
<template>
17+
<div>
18+
<h2>Contributors</h2>
19+
<ul>
20+
<li v-for="contributor in contributors" :key="contributor.id">
21+
<img :src="contributor.avatar_url" :alt="contributor.login" width="50" height="50">
22+
<a :href="contributor.html_url" target="_blank" rel="noopener noreferrer">
23+
{{ contributor.login }}
24+
</a>
25+
</li>
26+
</ul>
27+
</div>
28+
</template>
29+
30+
<style scoped>
31+
.vp-doc li + li {
32+
margin:0
33+
}
34+
ul {
35+
list-style-type: none;
36+
padding: 0;
37+
display: flex;
38+
flex-wrap: wrap;
39+
gap:1em;
40+
}
41+
42+
li {
43+
display: flex;
44+
flex-direction: column;
45+
align-items: center;
46+
justify-content: center;
47+
}
48+
49+
img {
50+
border-radius: 50%;
51+
}
52+
a {
53+
text-decoration: none;
54+
}
55+
</style>

docs/.vitepress/config.ts

Lines changed: 82 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,97 @@ import { defineConfig } from 'vitepress'
33
export default defineConfig({
44
title: 'Nuxt Users',
55
description: 'A user authentication module for Nuxt 3 with database support for SQLite and MySQL',
6+
head: [
7+
['link', { rel: 'icon', href: '/favicon.ico' }],
8+
['link', { rel: 'stylesheet', href: '/styles.css' }],
9+
/* [
10+
'script',
11+
{
12+
async: '',
13+
src: 'https://www.googletagmanager.com/gtag/js?id=G-4WQ5DGB03H',
14+
},
15+
],
16+
[
17+
'script',
18+
{},
19+
`window.dataLayer = window.dataLayer || [];
20+
function gtag(){dataLayer.push(arguments);}
21+
gtag('js', new Date());
22+
gtag('config', 'G-4WQ5DGB03H');`,
23+
], */
24+
],
625
themeConfig: {
26+
// https://vitepress.dev/reference/default-theme-config
27+
search: {
28+
provider: 'local',
29+
},
30+
logo: '/logo.png',
731
nav: [
832
{ text: 'Home', link: '/' },
9-
{ text: 'Guide', link: '/guide/' },
10-
{ text: 'API', link: '/api/' },
11-
{ text: 'Components', link: '/components/' },
12-
{ text: 'Database', link: '/database/' },
13-
{ text: 'Contributing', link: '/contributing/' }
33+
{ text: 'Get Started', link: '/get-started' },
34+
],
35+
sidebar: [
36+
{
37+
items: [
38+
{ text: 'Get Started', link: '/get-started' },
39+
{
40+
text: 'Guide',
41+
items: [
42+
{ text: 'Installation', link: '/guide/installation' },
43+
{ text: 'Quick Start', link: '/guide/quick-start' },
44+
{ text: 'Configuration', link: '/guide/configuration' },
45+
{ text: 'Authentication', link: '/guide/authentication' },
46+
{ text: 'Password Reset', link: '/guide/password-reset' },
47+
{ text: 'Database Setup', link: '/guide/database-setup' }
48+
]
49+
},
50+
{
51+
text: 'API Reference',
52+
items: [
53+
{ text: 'Login', link: '/api/login' },
54+
{ text: 'Password Reset', link: '/api/password-reset' }
55+
]
56+
},
57+
{
58+
text: 'Components',
59+
items: [
60+
{ text: 'LoginForm', link: '/components/login-form' },
61+
{ text: 'ForgotPasswordForm', link: '/components/forgot-password-form' },
62+
{ text: 'ResetPasswordForm', link: '/components/reset-password-form' }
63+
]
64+
},
65+
{
66+
text: 'Database',
67+
items: [
68+
{ text: 'Schema', link: '/database/schema' },
69+
{ text: 'Migrations', link: '/database/migrations' },
70+
{ text: 'CLI Commands', link: '/database/cli-commands' }
71+
]
72+
},
73+
{
74+
text: 'Contributing',
75+
items: [
76+
{ text: 'Development Setup', link: '/contributing/development-setup' },
77+
{ text: 'Running Tests', link: '/contributing/running-tests' },
78+
{ text: 'Guidelines', link: '/contributing/guidelines' }
79+
]
80+
}
81+
]
82+
}
1483
],
15-
sidebar: {
16-
'/guide/': [
17-
{
18-
text: 'Getting Started',
19-
items: [
20-
{ text: 'Installation', link: '/guide/installation' },
21-
{ text: 'Quick Start', link: '/guide/quick-start' },
22-
{ text: 'Configuration', link: '/guide/configuration' }
23-
]
24-
},
25-
{
26-
text: 'Features',
27-
items: [
28-
{ text: 'Authentication', link: '/guide/authentication' },
29-
{ text: 'Password Reset', link: '/guide/password-reset' },
30-
{ text: 'Database Setup', link: '/guide/database-setup' }
31-
]
32-
}
33-
],
34-
'/api/': [
35-
{
36-
text: 'API Reference',
37-
items: [
38-
{ text: 'Login', link: '/api/login' },
39-
{ text: 'Password Reset', link: '/api/password-reset' }
40-
]
41-
}
42-
],
43-
'/components/': [
44-
{
45-
text: 'Components',
46-
items: [
47-
{ text: 'LoginForm', link: '/components/login-form' },
48-
{ text: 'ForgotPasswordForm', link: '/components/forgot-password-form' },
49-
{ text: 'ResetPasswordForm', link: '/components/reset-password-form' }
50-
]
51-
}
52-
],
53-
'/database/': [
54-
{
55-
text: 'Database',
56-
items: [
57-
{ text: 'Schema', link: '/database/schema' },
58-
{ text: 'Migrations', link: '/database/migrations' },
59-
{ text: 'CLI Commands', link: '/database/cli-commands' }
60-
]
61-
}
62-
],
63-
'/contributing/': [
64-
{
65-
text: 'Contributing',
66-
items: [
67-
{ text: 'Development Setup', link: '/contributing/development-setup' },
68-
{ text: 'Running Tests', link: '/contributing/running-tests' },
69-
{ text: 'Guidelines', link: '/contributing/guidelines' }
70-
]
71-
}
72-
]
73-
},
7484
socialLinks: [
7585
{ icon: 'github', link: 'https://github.com/your-org/nuxt-users' }
7686
],
7787
footer: {
7888
message: 'Released under the MIT License.',
7989
copyright: 'Copyright © 2024-present'
8090
}
81-
}
91+
},
92+
markdown: {
93+
theme: {
94+
light: 'vitesse-light',
95+
dark: 'vitesse-dark',
96+
},
97+
lineNumbers: true,
98+
},
8299
})
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#morphBlur {
2+
display: inline-block;
3+
background-color: #8a25b1;
4+
height: 12em;
5+
aspect-ratio: 1;
6+
position: fixed;
7+
top: 3em;
8+
left: 10%;
9+
z-index: -1;
10+
animation: move 12s ease-in-out infinite alternate;
11+
filter: blur(6em);
12+
}
13+
14+
@keyframes move {
15+
50% {
16+
top: 12em;
17+
left: 60%;
18+
}
19+
20+
100% {
21+
top: 20em;
22+
left: 25%;
23+
}
24+
}
25+
26+
#morphBlur::before,
27+
#morphBlur::after {
28+
content: '';
29+
display: block;
30+
position: absolute;
31+
height: 100%;
32+
width: 100%;
33+
background-color: inherit;
34+
}
35+
36+
#morphBlur::before {
37+
top: -12em;
38+
right: 9em;
39+
animation: moveBefore 5s ease-in-out forwards infinite alternate;
40+
}
41+
42+
@keyframes moveBefore {
43+
35% {
44+
top: 12em;
45+
right: 12em;
46+
}
47+
48+
100% {
49+
top: 3em;
50+
right: 3em;
51+
}
52+
}
53+
54+
#morphBlur::after {
55+
bottom: -4em;
56+
left: 19em;
57+
animation: moveAfter 8s ease-in-out forwards infinite alternate;
58+
}
59+
60+
@keyframes moveAfter {
61+
30% {
62+
bottom: 12em;
63+
left: 0em;
64+
}
65+
66+
100% {
67+
bottom: 0em;
68+
left: 22em;
69+
}
70+
}

docs/.vitepress/theme/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import Contributors from '../components/Contributors.vue'
3+
4+
export default {
5+
...DefaultTheme,
6+
enhanceApp({ app }) {
7+
app.component('Contributors', Contributors)
8+
},
9+
}

docs/get-started.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Nuxt Users
2+
3+
A user authentication module for Nuxt 3 with database support for SQLite and MySQL.
4+
5+
## Features
6+
7+
- 🔐 User authentication with bcrypt password hashing
8+
- 🗄️ Database support (SQLite, MySQL)
9+
- 🛠️ CLI commands for database management
10+
- 🔑 Password Reset Functionality
11+
- 📦 Zero-config setup with sensible defaults
12+
- 🔧 TypeScript support
13+
14+
## Quick Start
15+
16+
```bash
17+
# Install the module
18+
yarn add nuxt-users
19+
20+
# Add to your nuxt.config.ts
21+
export default defineNuxtConfig({
22+
modules: ['nuxt-users'],
23+
nuxtUsers: {
24+
connector: {
25+
name: 'sqlite',
26+
options: {
27+
path: './data/default.sqlite3'
28+
}
29+
}
30+
}
31+
})
32+
33+
# Run migrations
34+
yarn db:migrate
35+
36+
# Create your first user
37+
yarn db:create-user user@example.com "John Doe" password123
38+
```
39+
40+
## What's Included
41+
42+
- **Authentication System**: Secure login with token-based authentication
43+
- **Database Support**: SQLite and MySQL with automatic migrations
44+
- **Password Reset**: Complete email-based password reset flow
45+
- **Vue Components**: Ready-to-use login and password reset forms
46+
- **CLI Tools**: Database management and user creation commands
47+
- **TypeScript**: Full type safety and IntelliSense support
48+
49+
## Get Started
50+
51+
- [Installation Guide](/guide/installation)
52+
- [Quick Start Tutorial](/guide/quick-start)
53+
- [Configuration Options](/guide/configuration)
54+
- [API Reference](/api/)
55+
- [Component Documentation](/components/)
56+
57+
## License
58+
59+
MIT

0 commit comments

Comments
 (0)