Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLATFORM: Add create new project #244

Closed
kriptonian1 opened this issue May 28, 2024 · 18 comments · Fixed by #540
Closed

PLATFORM: Add create new project #244

kriptonian1 opened this issue May 28, 2024 · 18 comments · Fixed by #540
Assignees
Labels
difficulty: 4 foss hack Clustering all the curated issues for Foss Hack 2024 priority: high scope: platform Everything related to the keyshade platform package type: feature Release drafter tag for tagging PRs related to adding new features

Comments

@kriptonian1
Copy link
Contributor

kriptonian1 commented May 28, 2024

Description

Implement a “create new project” functionality in the dashboard of the platform. The created new project should be immediately updated in the project dashboard. Some part of create new project is done, which can find in apps/platform/src/app/(main)/page.tsx.

Scope of work

You have to implement 2 features from create new project.

  1. Add environment for the project, by default there is an environment named default. In the array of object environment, there should be only one default workspace. And user can add as many environments as they want.
  2. After sending the environment request. The project dashboard should auto refresh to show the recently added project.

Postman URL

Type of new project and environment

export const zEnvironment = z.object({
name: z.string(),
description: z.string().nullable(),
isDefault: z.boolean().optional(),
})
export const zNewProject = z.object({
name: z.string(),
description: z.string().nullable(),
storePrivateKey: z.boolean(),
environments: z.array(zEnvironment)
})

Dialog for create new project

<Dialog>
<DialogTrigger>
<Button>
{' '}
<AddSVG /> Create a new Project
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>Create a new project</DialogHeader>
<DialogDescription>
Fill in the details to create a new project
</DialogDescription>
<div className="flex flex-col gap-y-8">
<div className="flex w-full flex-col gap-y-4">
<div className="flex flex-col items-start gap-4">
<Label className="text-right" htmlFor="name">
Name
</Label>
<Input
className="col-span-3"
id="name"
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
name: e.target.value
}))
}}
placeholder="Enter the name"
/>
</div>
<div className="flex flex-col items-start gap-4">
<Label className="text-right" htmlFor="name">
Description
</Label>
<Input
className="col-span-3"
id="name"
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
description: e.target.value
}))
}}
placeholder="Enter the name"
/>
</div>
{/* {isNameEmpty ? (
<span className="ml-[3.5rem] mt-1 text-red-500">
Name cannot be empty
</span>
) : null} */}
</div>
</div>
<div className="flex w-full justify-end">
<Button
onClick={() => {
createProject(newProjectData, currentWorkspace.id)
.then(() => {
toast.success('New project added successfully')
router.refresh()
})
.catch(() => {
toast.error('Failed to add new project')
})
}}
variant="secondary"
>
Add project
</Button>
</div>
</DialogContent>
</Dialog>

@kriptonian1 kriptonian1 added scope: platform Everything related to the keyshade platform package enhancement labels May 28, 2024
@rajdip-b rajdip-b added type: feature Release drafter tag for tagging PRs related to adding new features priority: high and removed enhancement labels May 28, 2024
@kriptonian1 kriptonian1 added the foss hack Clustering all the curated issues for Foss Hack 2024 label Jun 20, 2024
@ayan-joshi
Copy link

@kriptonian1 @rajdip-b I would like to work on this issue can u assign me under FOSS HACK

@rajdip-b
Copy link
Member

rajdip-b commented Jul 9, 2024

Sure!

@kriptonian1
Copy link
Contributor Author

@ayan-joshi best of luck buddy, let me know if you need any help

@ayan-joshi
Copy link

@kriptonian1 there is postman url attached which is not opening will I need it for my work ?

Create project

@rajdip-b
Copy link
Member

@kriptonian1 there is postman url attached which is not opening will I need it for my work ?

Create project

Yeap! Here's the updated link: https://www.postman.com/keyshade/workspace/keyshade

@ayan-joshi
Copy link

@rajdip-b I have a question , for this pr I would need to setup all 4 ports and can u help me with project setting up

@rajdip-b
Copy link
Member

Hey @ayan-joshi! You can refer to our docs to understand how to set things up: https://docs.keyshade.xyz/contributing-to-keyshade/summary

@ayan-joshi
Copy link

@rajdip-b I got it running locally , how to pass through auth page can u help?

@rajdip-b
Copy link
Member

You would need to sign up like usual. Make sure the API is running.

@kriptonian1
Copy link
Contributor Author

Hey @ayan-joshi, you need to run the API server and the platform simultaneously, and you need to create a .env file inside the platform and there add NEXT_PUBLIC_BACKEND_URL=http://localhost:4200

@ayan-joshi
Copy link

NEXT_PUBLIC_BACKEND_URL=http://localhost:4200

@kriptonian1 Yes I have done it already , I have got docker running , api is running too but I cant go past the auth page

@kriptonian1
Copy link
Contributor Author

Can you show the errors in console

@ayan-joshi
Copy link

Can you show the errors in console

image

@kriptonian1
Copy link
Contributor Author

Can you show the errors in console

image

Are you running the api in parallel ?

@ayan-joshi
Copy link

Can you show the errors in console

image

Are you running the api in parallel ?

yes

@kriptonian1
Copy link
Contributor Author

If you are free then maybe we can get on a call tomorrow

@rajdip-b
Copy link
Member

This is related to error in your SMTP creds if im not wrong. I would advise you to call the endpoint from postman once

Can you show the errors in console

image

@rajdip-b
Copy link
Member

rajdip-b commented Nov 5, 2024

@ayan-joshi unassigning due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 4 foss hack Clustering all the curated issues for Foss Hack 2024 priority: high scope: platform Everything related to the keyshade platform package type: feature Release drafter tag for tagging PRs related to adding new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants