-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from hollow-leaf/feat/apiMigrate
feat: some api migrate
- Loading branch information
Showing
14 changed files
with
104 additions
and
8,717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ yarn-error.log* | |
# Misc | ||
.DS_Store | ||
*.pem | ||
|
||
wrangler.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
### February Milestone Plan for Doro | ||
|
||
1. Frontend (focus here): | ||
* PWA Integration: | ||
- Migrate React Native components to Next.js PWA, prioritizing compatibility and responsiveness. | ||
- Create a dedicated web page to complement the PWA user experience. | ||
|
||
2. Contract CI/CD - Test and Deploy: | ||
* Roulette Contract Testing: | ||
- Conduct comprehensive testing on the Roulette contract to ensure reliability and security. | ||
* Deploy on Berkeley Testnet: | ||
- Complete the deployment of the tested Roulette contract on the Berkeley Testnet for real-world validation. | ||
|
||
3. Backend - Optimize Serverless Part: | ||
* Serverless API Migration: | ||
- Transfer stateless APIs to the serverless architecture for improved scalability and flexibility. | ||
* Mina-Sign Verification: | ||
- Implement and verify Mina-Sign functionality in the backend or serverless environment to enhance security. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### API Design | ||
|
||
> /test (deprecated) | ||
Only for test | ||
|
||
### Game Lobby API | ||
|
||
> /latest_game | ||
> /get_answer/:id | ||
> /get_game/:id | ||
> /get_game_user/:id | ||
### Game | ||
|
||
> /draw/:id | ||
(will deprecated) | ||
|
||
(Same API, but return different) | ||
> /reveal/:id | ||
> /decrypt/:id | ||
> /setGame | ||
### Lobby (better UX) | ||
> /gameLobby | ||
> /lobbyTestData | ||
### Wallet | ||
> /generate_key | ||
> /user/:address | ||
(user can use ethereum wallet to recovery their mina key) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { OpenAPIHono } from '@hono/zod-openapi' | ||
import { lobbyController, swaggerController, minaController } from './controllers' | ||
import { cors } from 'hono/cors' | ||
|
||
const app = new OpenAPIHono() | ||
type Bindings = { "doro-": KVNamespace } | ||
|
||
const app = new OpenAPIHono<{ Bindings: Bindings }>() | ||
|
||
lobbyController(app) | ||
swaggerController(app) | ||
minaController(app) | ||
|
||
export default app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// lobby function | ||
import { OpenAPIHono, createRoute } from "@hono/zod-openapi" | ||
import { UserSchema, ParamsSchema } from "../models/userModel" | ||
import { createController, ResponseType } from "../utils" | ||
|
||
const responses: ResponseType[] = [ | ||
{ | ||
statusCode: 200, | ||
content: { | ||
'application/json': { | ||
schema: UserSchema, | ||
}, | ||
}, | ||
description: 'Retrieve the user', | ||
}, | ||
{ | ||
statusCode: 404, | ||
description: 'User not found', | ||
}, | ||
]; | ||
|
||
const UserController = createController('get', '/users/{id}', ParamsSchema, responses) | ||
|
||
export default (app: OpenAPIHono) => { | ||
// path: /users/{id} | ||
app.openapi(UserController, (c: any) => { | ||
const { id } = c.req.valid('param') as any | ||
return c.json({ | ||
id, | ||
age: 20, | ||
name: 'Ultra-man', | ||
d: 'a' | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.