Open vplasencia opened 11 months ago
Can I work on this issue?
Hey @hriztam! Yes, sure. Do you want me to assign you this issue?
Yes
@hriztam let us know if you need any help 👍
I'm having trouble setting up the project
Hey @hriztam! These are the steps:
1- Clone the repository: git clone https://github.com/privacy-scaling-explorations/bandada.git
2- Go to the bandada
folder: cd bandada
3- Install dependencies: yarn
4- Copy env variables. Run in the project root folder: cp apps/api/.env.example apps/api/.env
5- Start the project: yarn dev
6- Go to http://localhost:3001
I think that step 4 should solve your issue.
It's working, thanks
Great! I will update the Readme file to add that step, thanks for pointing this out.
Also where will I get this group ids and all
Hey @hriztam! I just updated the Readme file. Here is all the info about the application urls: https://github.com/privacy-scaling-explorations/bandada/tree/main?tab=readme-ov-file#application-urls
You can get the data from the API. If you create an off-chain group, you can get the information using this url: http://localhost:3000
. The API has a UI, you can play around with it there.
You can also use the Bandada sdk to get the information, but you will need to pass the development url, like so:
const apiSdk = new ApiSdk(SupportedUrl.DEV)
This repo can help with it too: https://github.com/vplasencia/bandada-sdk-demo
Hey @hriztam ! Thank you for picking up this issue. Were you able to work on it? Any troubles or work pending?
@hriztam heya, I'm going to unassign this task from you so it's available for anyone to take.
But please let me know if you have progress or need any help to complete it.
Hello @aguzmant103 can I work on this ?
Hey @ScottyDavies! Do you want me to assign this issue to you?
Yes please
Hey @ScottyDavies! Done. Thank you. Please let us know if you have questions.
Hi, I'm PSE student. I would like to try this. @vplasencia
Hey @family36! I just assigned the issue to you. Let us know if you have questions.
hi @vplasencia I made minimal changes, taking into account the impact on others. The members in the response are limited to 100 per page. Does this modification meet the requirements you intended?
bandada\apps\api\src\app\groups\groups.controller.ts
@Get(":group")
@ApiOperation({ description: "Returns a specific group." })
@ApiCreatedResponse({ type: Group })
async getGroup(
@Param("group") groupId: string,
@Query("page") page?: number
) {
const group = await this.groupsService.getGroup(groupId)
const fingerprint = await this.groupsService.getFingerprint(groupId)
let members = group.members
if (page) {
const membersPerPage = 100
const startIndex = (page - 1) * membersPerPage
members = group.members.slice(
startIndex,
startIndex + membersPerPage
)
}
const paginatedGroup = { ...group, members }
return mapGroupToResponseDTO(paginatedGroup, fingerprint)
}
Hey @family36!
Thank you very much. Yes, the idea is to have something like that. I added a bit more ideas, resources and context for this issue in the issue description. I also removed the good first issue
tag because I think this task can be a bit difficult and take some time, and you will also need to understand more about the API code.
Please let me know if you're still interested in working on this issue.
If you prefer to take a look at other good first issues, you can find the list of open good first issues here. Feel free to ask for any other that is not assigned yet.
@vplasencia ok, I will try other good first issue. Thank you!
Description
Right now, when you return the members of a group, you will get all of them together, then it is necessary to allow pagination in the API for lists.
The idea is to integrate pagination into the API.
The first step would be to do some research to find the best solution for Nestjs. Maybe it's better to use a library or do it manually.
Two libraries that can help:
https://www.npmjs.com/package/nestjs-paginate
https://www.npmjs.com/package/nestjs-typeorm-paginate