Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shashwatah/denote
REST API with JWT authentication for a generic notes app built with Deno, and Oak.
https://github.com/shashwatah/denote
authentication crud crud-application deno denon generic jsonwebtokens jwt notes notes-app oak rest rest-api typescript
Last synced: 3 months ago
JSON representation
REST API with JWT authentication for a generic notes app built with Deno, and Oak.
- Host: GitHub
- URL: https://github.com/shashwatah/denote
- Owner: shashwatah
- License: mit
- Created: 2020-05-27T15:18:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T19:15:29.000Z (about 1 year ago)
- Last Synced: 2024-01-10T21:01:04.581Z (about 1 year ago)
- Topics: authentication, crud, crud-application, deno, denon, generic, jsonwebtokens, jwt, notes, notes-app, oak, rest, rest-api, typescript
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Denote
REST API with JWT authentication for a generic notes app built with Deno (v1.4.0), Oak, and TypeScript.
## Instructions
Follow the standard procedure to clone the repository and then continue with the steps.
Denote uses ***denon*** as a nodemon alternative for deno. After installing run the following command to install denon.
```bash
$ deno install --allow-read --allow-run --allow-write --allow-net -f -q --unstable https://deno.land/x/[email protected]/denon.ts
```> It will use the config specified in ***denon.json***.
Run Denote with the following command:
```bash
$ denon start
```If denon doesn't work (or if you don't want to monitor file changes) use the following command:
```bash
$ deno run --allow-net --allow-read server.ts
```> Denote reads the port it is supposed to run on from the '.env' file. The default port is 108.
## Important information
### API Endpoints
```
GET /token # => Get auth token
GET /api/users # => Get all the users
POST /api/users # => Add a user
GET /api/users/:id # => Get one particular user
GET /api/users/:id/notes # => Get one user's notes
DELETE /api/users/:id # => Delete a user
GET /api/notes # => Get all the notes
GET /api/notes/:id # => Get one particular note
POST /api/notes # => Add a note
PUT /api/notes/:id # => Update a note
DELETE /api/notes/:id # => Delete a note
```### Default user creds
```
username: admin
password: admin
```### Accessing the API
To get started send a request to /token with the default username and password in the body to get the auth token. That token is required to be sent with every request to any other endpoint as the 'Authorization' header.
## Update checklist
| Status | Update |
|--------|:----------------------:|
| ✅ | JWT Authentication |
| | NoSQL Database |