Skip to content

Commit

Permalink
Merge pull request #5 from smakosh/chore/add-cli
Browse files Browse the repository at this point in the history
feat: added first iteration of the cli and written docs for jwt and improved the examples
  • Loading branch information
smakosh authored Apr 16, 2024
2 parents eead85a + d3220fa commit 57d67e5
Show file tree
Hide file tree
Showing 39 changed files with 2,526 additions and 525 deletions.
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Bug report"
description: Report an issue
title: '[bug]: '
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
### Thanks for taking the time to create a bug report. Please search open/closed issues before submitting, as the issue may have already been reported/addressed.
- type: markdown
attributes:
value: |
#### If you aren't sure this is a bug or not, please open a discussion instead:
- [Discussions](https://github.com/smakosh/roll-your-own-auth/discussions/new?category=general)
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us how in the description. Thanks!
placeholder: Bug description
validations:
required: true

- type: input
id: part-affected
attributes:
label: Affected part/parts
description: Is this feature request relevant to any of the already existing examples?
placeholder: ex. rest-express-prisma-jwt-sqlite, rest-express-prisma-session-sqlite...
validations:
required: false

- type: textarea
id: reproduction
attributes:
label: How to reproduce
description: A step-by-step description of how to reproduce the bug.
placeholder: |
1. Go to '...'
2. Click on '....'
3. See error
validations:
required: true

- type: textarea
id: system-info
attributes:
label: System Info
description: Information about browsers, system or binaries that's relevant.
render: bash
placeholder: System, Binaries, Browsers
validations:
required: true

- type: checkboxes
id: terms
attributes:
label: Before submitting
description: By submitting this issue, you agree to follow our [Contributing Guidelines](https://github.com/smakosh/roll-your-own-auth/blob/main/CONTRIBUTING.md).
options:
- label: I've made research efforts and searched the documentation
required: true
- label: I've searched for existing issues
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Get Help
url: https://github.com/smakosh/roll-your-own-auth/discussions/new?category=general
about: If you can't get something to work the way you expect, open a question in our discussion forums.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Feature request"
description: Create a feature request for ryo-auth
title: '[feat]: '
labels: ['area: request']
body:
- type: markdown
attributes:
value: |
### Thanks for taking the time to create a feature request! Please search open/closed issues before submitting, as the issue may have already been reported/addressed.
- type: markdown
attributes:
value: |
#### If you aren't sure this is a bug or not, please open a discussion instead:
- [Discussions](https://github.com/smakosh/roll-your-own-auth/discussions/new?category=general)
- type: textarea
id: feature-description
attributes:
label: Feature description
description: Tell us about your feature request
placeholder: 'I think this feature would be great because...'
value: 'Describe your feature request...'
validations:
required: true

- type: input
id: part-affected
attributes:
label: Affected part/parts
description: Is this feature request relevant to any of the already existing examples?
placeholder: ex. rest-express-prisma-jwt-sqlite, rest-express-prisma-session-sqlite...
validations:
required: false

- type: textarea
id: context
attributes:
label: Additional Context
description: Add any other context about the feature here.
placeholder: ex. screenshots, Stack Overflow links, forum links, etc.
value: 'Additional details here...'
validations:
required: false

- type: checkboxes
id: terms
attributes:
label: Before submitting
description: By submitting this issue, you agree to follow our [Contributing Guidelines](https://github.com/smakosh/roll-your-own-auth/blob/main/CONTRIBUTING.md).
options:
- label: I've made research efforts and searched the documentation
required: true
- label: I've searched for existing issues and PRs
required: true
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Adapted from shadcn/ui.

name: Release

on:
push:
branches:
- main

jobs:
release:
if: ${{ github.repository_owner == 'smakosh' }}
name: Create a PR for release workflow
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PNPM
uses: pnpm/action-setup@v2.2.4
with:
version: 8.6.1

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
version: 8.6.1
node-version: 18
cache: "pnpm"

- name: Install NPM Dependencies
run: pnpm install

- name: Build the package
run: pnpm build:cli

- name: Create Version PR or Publish to NPM
id: changesets
uses: changesets/action@v1.4.1
with:
commit: "chore(release): version packages"
title: "chore(release): version packages"
version: node .github/changeset-version.js
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_ENV: "production"
129 changes: 129 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Contributing

Thanks for your interest in contributing to Roll Your Own Auth. We're happy to have you here.

Please take a moment to review this document before submitting your first pull request. We also strongly recommend that you check for open issues and pull requests to see if someone else is working on something similar.

If you need any help, feel free to reach out to [@smakosh](https://twitter.com/smakosh).

## About this repository

This repository is a monorepo.

- We use [pnpm](https://pnpm.io) and [`workspaces`](https://pnpm.io/workspaces) for development.
- We use [Turborepo](https://turbo.build/repo) as our build system.
- We use [changesets](https://github.com/changesets/changesets) for managing releases.

## Structure

This repository is structured as follows:

```
apps
└── docs
examples
└── [rest-graphql]-[framework]-[orm]-[session-jwt]-[database]
packages
└── cli
```

| Path | Description |
| --------------------- | ---------------------------------------- |
| `apps/docs` | The Docs. |
| `examples/` | All the examples/templates. |
| `packages/cli` | The `ryo-auth` package. |

## Development

### Fork this repo

You can fork this repo by clicking the fork button in the top right corner of this page.

### Clone on your local machine

```bash
git clone https://github.com/your-username/roll-your-own-auth.git
```

### Navigate to project directory

```bash
cd roll-your-own-auth
```

### Create a new Branch

```bash
git checkout -b my-new-branch
```

### Install dependencies

```bash
pnpm install
```

### Run a workspace

You can use the `pnpm --filter=[WORKSPACE]` command to start the development process for a workspace.

#### Examples

1. To run the `roll-your-own-auth.vercel.app` website:

```bash
pnpm --filter=docs dev
```

2. To run the `ryo-auth` package:

```bash
pnpm --filter=ryo-auth dev
```

## Documentation

The documentation for this project is located in the `docs` workspace. You can run the documentation locally by running the following command:

```bash
pnpm docs:dev
```

Documentation is written using [MDX](https://mdxjs.com). You can find the documentation files in the `apps/docs` directory.

## Commit Convention

Before you create a Pull Request, please check whether your commits comply with
the commit conventions used in this repository.

When you create a commit we kindly ask you to follow the convention
`category(scope or module): message` in your commit message while using one of
the following categories:

- `feat / feature`: all changes that introduce completely new code or new
features
- `fix`: changes that fix a bug (ideally you will additionally reference an
issue if present)
- `refactor`: any code related change that is not a fix nor a feature
- `docs`: changing existing or creating new documentation (i.e. README, docs for
usage of a lib or cli usage)
- `build`: all changes regarding the build of the software, changes to
dependencies or the addition of new dependencies
- `test`: all changes regarding tests (adding new tests or changing existing
ones)
- `ci`: all changes regarding the configuration of continuous integration (i.e.
github actions, ci system)
- `chore`: all changes to the repository that do not fit into any of the above
categories

e.g. `feat(components): add new prop to the avatar component`

If you are interested in the detailed specification you can visit https://www.conventionalcommits.org/

## CLI

Still too early, will write down more details once basic functionalities are implemented.

## Testing

Still too early, will write down more details once basic functionalities are implemented.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 smakosh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ You can use this in order to build your own auth system.

### Getting started

TBD
[Go here](https://roll-your-own-auth.vercel.app/)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
19 changes: 17 additions & 2 deletions apps/docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@ The issue is that it's really hard to find such criterias in a third party servi

*You can use this in order to build your own auth system.*

### Get started by choosing the approach you prefer
### Quick start via the CLI

```bash copy
npx ryo-auth@latest init
```

```bash
Starting the ryo-auth initialization process...
? Pick the auth approach you would like: Sessions
? Server side, pick the server side framework you are using: Express.js
? Pick the Database you would like to use: Sqlite
? Pick the ORM you would to use: Prisma
? Now client side, pick the client side framework you are using: Next.js
```

### Or get started by choosing the approach you prefer

<Cards>
<Card title="Sessions" href="/sessions" />
<Card title="JWT (coming soon)" href="/jwt" />
<Card title="JWT" href="/jwt" />
<Card title="SSO (coming soon)" href="/sso" />
<Card title="Passwordless (coming soon)" href="/passwordless" />
<Card title="2FA (coming soon)" href="/2fa" />
Expand Down
3 changes: 0 additions & 3 deletions apps/docs/pages/jwt.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions apps/docs/pages/jwt/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"index": "Get started",
"client": "Client",
"server": "Server"
}
Empty file.
Loading

0 comments on commit 57d67e5

Please sign in to comment.