Skip to content

Commit 57910f9

Browse files
add license and enhance readme
1 parent 12da6de commit 57910f9

File tree

2 files changed

+86
-11
lines changed

2 files changed

+86
-11
lines changed

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2024 Hanko GmbH
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+66-11
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,99 @@
11
# Hanko React-Express Starter
22

3-
This template shows how you can integrate Hanko with your React App (Vite) and protect routes using express.js middleware.
3+
This repo demonstrates how to integrate Hanko with React-Express application for authentication and user management.
44

5-
## Clone the repo
5+
Hanko is an open-source authentication and user management solution with a focus on moving the login beyond passwords while being 100% deployable today.
6+
7+
- Built for [passkeys](https://www.passkeys.io) as introduced by Apple, Google, and Microsoft
8+
- Fast integration with Hanko Elements web components (login box and user profile)
9+
- API-first, small footprint, cloud-native
10+
11+
## Prerequisites
12+
13+
Before you begin, ensure you have the following:
14+
15+
- Node.js installed (version 20.0.0 or later)
16+
- Hanko API URL from [Hanko Cloud](https://cloud.hanko.io/)
17+
18+
> **Note:**
19+
> You'll need to create a Authentication Project on Hanko Cloud with the App URL `http://localhost:5173`. See our docs to learn how to setup a [auth project](https://docs.hanko.io/setup-hanko-cloud).
20+
21+
## Getting started
22+
23+
1. Clone the repository
624

725
```bash
826
git clone https://github.com/teamhanko/hanko-react-express-starter.git
927
```
1028

11-
## Get the Hanko API URL
12-
13-
Get the API URL from [Hanko console](https://cloud.hanko.io/) and add it to `.env` file of both frontend and backend directory.
29+
#### Frontend
1430

15-
## Run the project
16-
17-
### Run Frontend
31+
1. Navigate to the frontend directory:
1832

1933
```bash
2034
cd hanko-react-frontend
2135
```
2236

37+
2. Create a `.env` file in the frontend directory (`hanko-react-frontend`) and add the following environment variable:
38+
39+
```sh
40+
VITE_HANKO_API_URL=your-hanko-api-url
41+
```
42+
43+
3. Install the frontend dependencies using your preferred package manager (e.g., `npm`, `pnpm`, `yarn`, or `bun`). For this project, we've used `pnpm`:
44+
2345
```bash
2446
pnpm install
2547
```
2648

49+
4. Start the frontend development server:
50+
2751
```bash
28-
pnpm run dev
52+
pnpm dev
2953
```
3054

31-
### Run Backend
55+
#### Backend
56+
57+
1. Navigate to the backend directory:
3258

3359
```bash
3460
cd express-server
3561
```
3662

63+
2. Create a `.env` file in the backend directory (`express-server`) and add the following environment variable:
64+
65+
```sh
66+
HANKO_API_URL=your-hanko-api-url
67+
```
68+
69+
3. Install the backend dependencies:
70+
3771
```bash
3872
pnpm install
3973
```
4074

75+
4. Start the backend server:
76+
4177
```bash
42-
pnpm run dev
78+
pnpm dev
4379
```
4480

81+
## Usage
82+
83+
1. Start the application:
84+
85+
- Access the application by navigating to `http://localhost:5173` in your web browser.
86+
87+
2. Navigate to login page and experience Hanko Authentication.
88+
89+
90+
## Support
91+
92+
Feel free to reach out to us on [Discord](https://hanko.io/community) if you get into any issues.
93+
94+
## License
95+
96+
This project is licensed under the MIT License.
97+
98+
99+

0 commit comments

Comments
 (0)