[meta] New API & logic domains
fmartingr opened this issue · 2 comments
fmartingr commented
Summary
This is the meta-task for the ongoing of refactoring the API into the Gin framework, that will split the logic into different files to ease maintenance this way:
http/
├── context/
│ └── ... # Contains custom context types for the handlers.
├── frontend/
│ └── ... # Contains the assets for the frontend.
├── middleware/
│ ├── auth.go # Contains the middleware for the authentication.
│ └── ... # Other middlewares
├── response/
│ └── ... # Contains the response types for the API.
├── routes/
│ ├── api/
│ │ ├── v1/
│ │ │ ├── bookmark.go # Contains the API routes for the bookmark endpoints.
│ │ │ └── ...
│ ├── bookmark.go # Contains the routes for the UI bookmark endpoints.
│ └── ... # Other UI endpoints
└── server.go # The main file of the server, contains the main function and the server struct.
While this issue is open/currently being worked on, the two APIs will coexist in the code, though only the legacy one will be exposed to end users until the refactored one is complete.
Related pull requests
- Base work, new API using Gin, Auth domain, QoL: #497
- #648
- go-shiori/shiori-web-ext#49
- #651
Migration status
UI Routes
Category | Method | Endpoint | Ready | Tested | Migrated |
---|---|---|---|---|---|
System | GET |
/system/liveness | ✅ | ✅ | ✅ |
Bookmarks | GET |
/bookmarks/:id/content | |||
Bookmarks | GET |
/bookmarks/:id/archive | |||
Bookmarks | GET |
/bookmarks/:id/thumb | |||
Bookmarklet | GET |
/bookmarklet | |||
UI | GET |
/*files* |
✅ | ✅ | ✅ |
API routes
Category | Method | Endpoint | Ready | Swagger | Tested | Migrated |
---|---|---|---|---|---|---|
Tags | GET |
/api/v1/tags | ✅ | ✅ | ✅ | |
Tags | POST |
/api/v1/tags | ✅ | ✅ | ||
Tags | PUT/PATCH |
/api/v1/tags/:id | ||||
Tags | DELETE |
/api/v1/tags/:id | ||||
Accounts | GET |
/api/v1/accounts | ||||
Accounts | POST |
/api/v1/accounts | ||||
Accounts | PUT/PATCH |
/api/v1/accounts/:id | ||||
Accounts | DELETE |
/api/v1/accounts/:id | ||||
Auth | GET |
/api/v1/auth/account | ✅ | ✅ | ✅ | |
Auth | PUT |
/api/v1/auth/account | ||||
Auth | POST |
/api/v1/auth/login | ✅ | ✅ | ✅ | ✅ |
Auth | POST |
/api/v1/auth/refresh | ✅ | ✅ | ✅ | |
Bookmarks | GET |
/api/v1/bookmarks | ||||
Bookmarks | POST |
/api/v1/bookmarks | ||||
Bookmarks | PUT |
/api/v1/bookmarks/cache | ||||
Bookmarks | GET |
/api/v1/bookmarks/:id | ||||
Bookmarks | PUT/PATCH |
/api/v1/bookmarks/:id | ||||
Bookmarks | PUT |
/api/v1/bookmarks/:id/cache |
Database
Category | SQLite | MySQL | PSQL |
---|---|---|---|
CreateTags |
✅ | ✅ | ✅ |
Logic domains
- Auth
Related issues
stale commented
This issue has been automatically marked as stale because it has not had any activity for quite some time.
It will be closed if no further activity occurs.
Thank you for your contributions.
fmartingr commented
Closing in favor of the roadmap.