VaibhavArora314 / StyleShare

A simple web based platform where users can easily create, explore, and share Tailwind CSS components and designs with fellow users.
https://style-share.vercel.app
MIT License
40 stars 68 forks source link

feat: Created admin login backend and frontend successfully issue 320 #330

Closed MeetDOD closed 4 months ago

MeetDOD commented 4 months ago

Pull Request Resolves [#320 ]

Title: Created admin login backend and frontend successfully.

Description

  1. In backend, In prisma at user add new field i.e isAdmin: bool, In routes created admin folder in that i created controllers for adminLogin and fetching admin profile with adminAuth middleware, created routes for both and created zodSchema for admin.
  2. In frontend, created a login page and created a route for that and implement it on navbar.
  3. In admin folder, AdminLogin all the post is done and i browerrouter the AuthenticatedAdminRoute for accessing the dashboard.
  4. The design is reponse and admin activity is protected from outside world.
  5. For accessing the admin feature tha admin of the project should go in the mongodb database and make isAdmin user to true.
  6. All the proper toast message is used to show every error respectively.

Related Issues

Fixes #320

Changes Made

New features: Created admin login backend and frontend.

Screenshots

demo3

demo2

demo1

I certify that I have carried out the relevant code of conduct and provided the requisite screenshot for validation by submitting this pull request.

Thank You for this contribution.

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
style-share ❌ Failed (Inspect) Jun 30, 2024 10:15am
github-actions[bot] commented 4 months ago

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

MeetDOD commented 4 months ago

@VaibhavArora314 @Ultimateutkarsh11 can you show me the logs for deployment failed :)

VaibhavArora314 commented 4 months ago

image

MeetDOD commented 4 months ago

@VaibhavArora314 It's already have all the packages in dependencies !

image

I think it's because of the folder structure ?

VaibhavArora314 commented 4 months ago

@VaibhavArora314 It's already have all the packages in dependencies !

image

I think it's because of the folder structure ?

let me check and find some solutions

MeetDOD commented 4 months ago

@VaibhavArora314 i think we should move admin folder to the frontend folder so it will use the frontend dependencies.

eg:

image

MeetDOD commented 4 months ago

@VaibhavArora314 I moved all the admin logic to frontend only because creating 2 react apps does not make any sense also all the logic is written in admin folder also created admiauth atom store for same and backend is same.

now, please tell me why deployement is failed ?

VaibhavArora314 commented 4 months ago

@VaibhavArora314 I moved all the admin logic to frontend only because creating 2 react apps does not make any sense also all the logic is written in admin folder also created admiauth atom store for same and backend is same.

now, please tell me why deployement is failed ?

please don't move the logic of admin to frontend, as I want to separate their logic based on their usage. also, the reason deployment fails is because the express server is trying to admin react app but you deleted the whole admin app, so it isn't able to find it.

MeetDOD commented 4 months ago

@VaibhavArora314 I moved all the admin logic to frontend only because creating 2 react apps does not make any sense also all the logic is written in admin folder also created admiauth atom store for same and backend is same. now, please tell me why deployement is failed ?

please don't move the logic of admin to frontend, as I want to separate their logic based on their usage. also, the reason deployment fails is because the express server is trying to admin react app but you deleted the whole admin app, so it isn't able to find it.

oops, sorry i will do the changes as it was previously. sorry for ininconvenience !

MeetDOD commented 4 months ago

@VaibhavArora314 now tell me the issues, i did exactly what you told me to do !

MeetDOD commented 4 months ago

@VaibhavArora314 I haven't worked on such project folder can you tell me in brief. how do i code in this folder and all or just update the readme file so that i could finish the work ASAP. It's a request from my side. Thank you !

VaibhavArora314 commented 4 months ago

I am thinking that you can split this task into two pull requests, one with backend logic and other with admin logic. Currently there are too many changes in this pull request and also I will be able to look into the reason as why there are dependency issues in the admin.

MeetDOD commented 4 months ago

I am thinking that you can split this task into two pull requests, one with backend logic and other with admin logic. Currently there are too many changes in this pull request and also I will be able to look into the reason as why there are dependency issues in the admin.

@VaibhavArora314 i created issues for backend and frontend respectively you can close this one, i will start from new pr .

VaibhavArora314 commented 4 months ago

closing this since this is being continued in other pull requests and issues