https://github.com/yogyy/fool-translations-api
novel collection api
https://github.com/yogyy/fool-translations-api
bun hono lucia-auth oslo sqlite
Last synced: about 1 month ago
JSON representation
novel collection api
- Host: GitHub
- URL: https://github.com/yogyy/fool-translations-api
- Owner: yogyy
- Created: 2024-09-30T15:26:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-25T16:03:55.000Z (over 1 year ago)
- Last Synced: 2025-02-02T19:30:37.555Z (over 1 year ago)
- Topics: bun, hono, lucia-auth, oslo, sqlite
- Language: TypeScript
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# installation
You need [bun](https://bun.sh/) installed.
```bash
bun install
```
## Generate Migration and create Sqlite database
```bash
bun generate
```
### Run Migration
```bash
bun migrate
```
### Run Seeding (optional)
to run seeding, you need to turn on the server first, and then request to /api/v1/testing/seeding
```bash
bun dev
```
```bash
curl localhost:8787/api/v1/testing/seeding
```
### testing
make sure you're running seeding
```bash
bun test
```
### run server
```bash
bun dev
open http://localhost:8787 #wrangler
```
### Available Routes
#### Auth Routes
```bash
GET /api/v1/auth/validate
GET /api/v1/auth/invalidate
POST /api/v1/auth/signup
POST /api/v1/auth/signin
POST /api/v1/auth/signout
```
#### OAuth Routes
```bash
GET /api/v1/oauth/discord
GET /api/v1/oauth/google
```
#### Novel Routes
```bash
GET /api/v1/novels
GET /api/v1/novels/featured/hot
GET /api/v1/novels/featured/top
GET /api/v1/novels/:id
GET /api/v1/chapters
GET /api/v1/chapters/:id
GET /api/v1/novels/:id/favorite
POST /api/v1/novels/:id/favorite
GET /api/v1/novels/:id/subscribe
POST /api/v1/novels/:id/subscribe
GET /api/v1/novels/:id/rating
POST /api/v1/novels/:id/rating
```
#### Admin Routes
```bash
POST /api/v1/admin/novel
PUT /api/v1/admin/novel/:id
DELETE /api/v1/admin/novel/:id
POST /api/v1/admin/chapter
PUT /api/v1/admin/chapter/:id
DELETE /api/v1/admin/chapter/:id
```
#### Notification Routes
```bash
GET /api/v1/notifications
PATCH /api/v1/notifications
DELETE /api/v1/notifications
```