Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/no0dles/daita-demo
https://github.com/no0dles/daita-demo
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/no0dles/daita-demo
- Owner: no0dles
- Created: 2019-11-30T08:55:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T13:18:38.000Z (about 2 years ago)
- Last Synced: 2024-04-28T04:42:20.070Z (9 months ago)
- Language: TypeScript
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# daita-demo
## Installation instructions
```
npm install
npm run migrate
```## Run api
```
npm start
```## Configuration
| Name | Description | Default |
| ------------ | ------------------------------------------------ | ------------------------- |
| PORT | port to serve api | 4000 |
| JWT_SECRET | JWT secret used to sign and verify bearer tokens | replace_me |
| POSTGRES_URL | postgres connection string | postgres://localhost/blog |## Tables
![Table Diagram](./docs/diagram.svg)
### Author
Contains all profile information about the author, gets created on first blog post or comment.### BlogPost
Contains the content of the blog post and references the author and comments.### BlogComment
A comment from a user about a blog post containing the reference of the creator.## API resources
### GET /api/author
| Type | Name | Description | Default | Required |
| ----- | ----- | ------------------------------------- | ------- | -------- |
| query | skip | Number of items to skip | 20 | yes |### PUT /api/author/:id
| Type | Name | Description | Default | Required |
| ----- | ----- | ------------------------------------- | ------- | -------- |
| path | id | ID of the author | - | yes |### GET /api/author/:id/blog
| Type | Name | Description | Default | Required |
| ----- | ----- | ------------------------------------- | ------- | -------- |
| path | id | ID of the author | - | yes |### GET /api/author/:id/author
| Type | Name | Description | Default | Required |
| ----- | ----- | ------------------------------------- | ------- | -------- |
| path | id | ID of the author | - | yes |GET /api/blog-post
POST /api/blog-post
PUT /api/blog-post/:slug
DELETE /api/blog-post/:slugGET /api/blog-comment/:slug/comment
POST /api/blog-comment/:slug/comment## Documentation
The documentation about daita is available [here](https://app.gitbook.com/@no0dles/s/daita/)