Skip to content

Commit 54f6da3

Browse files
committed
feat: add initial authjs starter
1 parent 8103f58 commit 54f6da3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1114
-2165
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: nodejs CI
2+
3+
on:
4+
push:
5+
branches: [main, authjs]
6+
pull_request:
7+
branches: [main, authjs]
8+
9+
env:
10+
NODE_VER: 22.5
11+
12+
jobs:
13+
test-module:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: pnpm/action-setup@v4
20+
name: Install pnpm
21+
with:
22+
run_install: false
23+
24+
- name: Use Node.js ${{ env.NODE_VER }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ env.NODE_VER }}
28+
cache: 'pnpm'
29+
30+
- name: Install deps
31+
run: pnpm i
32+
33+
# Check linting and typing
34+
- run: pnpm lint
35+
- run: pnpm typecheck
36+
37+
# Check building
38+
- run: pnpm build

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
12
shamefully-hoist=true
23
strict-peer-dependencies=false
3-
link-workspace-packages=true

README.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
1-
# NuxtAuth Starters
1+
# local-app
22

3-
This repository contains a collection of `@sidebase/nuxt-auth` starters that cover several use cases for NuxtAuth. You can use one of these templates as a starting point for your application, or to create a reproduction of an issue that you are currently encountering.
3+
This is a [sidebase merino](https://sidebase.io/) app created by running `pnpm create sidebase@latest`. This project uses the following technologies for a great developer- and user-experience:
4+
- [TypeScript](https://www.typescriptlang.org/)
5+
- [Nuxt 3](https://nuxt.com)
6+
- Tailwind CSS
7+
- nuxt-auth
8+
- Linting via ESLint and @antfu/eslint-config
49

5-
## Overview
10+
## How to get going?
611

7-
This repository current contains the following starters:
12+
This is a straight-forward setup with minimal templating and scaffolding. The options you selected during the sidebase CLI setup are all here though. Good places to continue reading are:
13+
- [the First Steps documentation](https://sidebase.io/sidebase/usage)
14+
- [our discord](https://discord.gg/auc8eCeGzx)
815

9-
## Local starter
16+
Some tasks you should probably do in the beginning are:
17+
- [ ] replace this generic README with a more specific one
18+
- [ ] install the Vue Volar extension
19+
- [ ] enable [Volar takeover mode](https://nuxt.com/docs/getting-started/installation#prerequisites) to ensure a smooth editor setup
20+
- [ ] [install Nuxt 3 devtools](https://github.com/nuxt/devtools#installation) if you want to use them
21+
- [ ] Auth: Configure your auth providers to the [NuxtAuthHandler](./server/api/auth/[...].ts)
22+
- [ ] Auth, optional: Enable global protection by setting `enableGlobalAppMiddleware: true` in [your nuxt.config.ts](./nuxt.config.ts). Delete the local middleware in the [protected.vue](./pages/protected.vue) page if you do
1023

11-
The `local` starter contains a basic `@sidebase/nuxt-auth` starter with the local provider setup. `local` is best when you already have a backend that accepts username + password as a login or want to build a static application. You can read more about the `local` provider [here](https://auth.sidebase.io/guide/local/quick-start).
24+
### Setup
1225

13-
This starter connects to a mocked Nuxt server api that handles: `signIn`, `signOut` and `getSession`.
26+
Make sure to install the dependencies:
1427

15-
View the starter [here](/starters/local/).
28+
```bash
29+
pnpm install
30+
```
1631

17-
## AuthJS starter (with GitHub)
32+
### Development Server
1833

19-
The `authjs-github` starter contains a basic `@sidebase/nuxt-auth` starter with the `authjs` provider setup with a GitHub OAuth provider, preconfigured. `authjs` is best suited for plug-and-play OAuth for established oauth-providers or magic-url based sign-ins. You can read more about the `authjs` provider [here](https://auth.sidebase.io/guide/authjs/quick-start).
34+
Start the development server on http://localhost:3000
2035

21-
View the starter [here](/starters/authjs-github/).
36+
```bash
37+
pnpm run dev
38+
```
2239

23-
## Contributing
40+
### Production
2441

25-
If you would like to add another starter, please first open an issue, where you either share the idea for the starter, if it does not exist yet, or link to a public repository containing the starter. After agreeing on the implementation of the starter, you can open a new pull request to add it.
42+
Build the application for production:
2643

27-
Contributions that update any package versions of the starters are always appreciated!
44+
```bash
45+
pnpm run build
46+
```
47+
48+
Locally preview production build:
49+
50+
```bash
51+
pnpm run preview
52+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
11
{
2-
"name": "nuxt-auth-examples",
3-
"version": "0.8.1",
2+
"name": "@sidebase/authjs-starter",
43
"private": true,
54
"type": "module",
5+
"engines": {
6+
"pnpm": ">=9.4.0",
7+
"node": ">=22.3.0"
8+
},
69
"scripts": {
7-
"test": "echo 'Hello!'"
8-
}
10+
"dev": "nuxt dev",
11+
"typecheck": "nuxt typecheck",
12+
"lint:fix": "eslint . --fix",
13+
"lint": "oxlint --deny-warnings -D correctness -D suspicious -D perf && eslint --max-warnings 0 .",
14+
"postinstall": "nuxt prepare",
15+
"build": "nuxt build",
16+
"start": "NODE_ENV=production node .output/server/index.mjs"
17+
},
18+
"dependencies": {
19+
"nuxt": "^3.12.4",
20+
"vue": "^3.4.29",
21+
"vue-router": "^4.3.3"
22+
},
23+
"devDependencies": {
24+
"@antfu/eslint-config": "^2.11.5",
25+
"@nuxtjs/tailwindcss": "^6.11.4",
26+
"@sidebase/nuxt-auth": "^0.8.2",
27+
"@types/node": "^20.11.30",
28+
"eslint": "^8.57.0",
29+
"oxlint": "^0.2.15",
30+
"typescript": "^5.4.3",
31+
"vue-tsc": "^2.0.7"
32+
},
33+
"peerDependencies": {
34+
"next-auth": "4.21.1"
35+
},
36+
"packageManager": "[email protected]"
937
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)