This is a Next.js project that manage the issues in this repository. The app is used to apply for Dcard's 2023 web frontend intern position.
View the project requirement for more information.
First, install the dependencies:
npm install
Second, create a .env.local
file in the root directory and add the following environment variables:
NEXT_PUBLIC_GITHUB_CLIENTID = 71a9fc5576675af39a30
GITHUB_CLIENT_SECRET = 12c7a461734220e9723f224e55ace86306d40b43
ADMIN_ACCESS_TOKEN = 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
Third, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
#### SignUp The SignUp page is the first page that the user sees. The user is redirected to the GitHub OAuth page to authenticate. After the user is authenticated, the user is redirected to the redirect page. #### Redirect The Redirect page is the page that the user is redirected to after the user is authenticated. This Page is used to get the access token from the GitHub OAuth page and save it in the localStorage. #### Issue The Issue page is the page that the user sees after the user is authenticated. This page is used to display the issues in the repository. User can create, edit, and delete the issues. But the user can only edit and delete the issues that the user created. #### Issue/[id] The Issue/[id] page is the page that the user sees after the user clicks the edit button of the issue. This page is used to display the issue details of the issue. User can edit the issue details. #### Issue/newIssue The Issue/newIssue page is the page that the user sees after the user clicks the add new issue button from Issue Page. This page is used to create the new issue.The Navbar component is used to display the navbar in many pages.
The IssueCard component is used to display the issue details in the Issue page.
The Dropdown component is used to display the dropdown menu in IssueCard.
The Label component is used to display the label of the issue, and also can be used to switch the label.
The Alert component is used to display the alert message in many places.
The Button and Card components are used to display the button and card in many places.
The config folder is used to store the configuration of the project. And some of the configuration is used to store the environment variables.
The hooks folder is used to store the custom hooks.
The useIssue hook is used to get the issues from the GitHub API.
The useAccessToken hook is used to get the access token from the localStorage.
The useUser hook is used to get the user information from the GitHub API.
The helpers folder is used to store the helper functions.
The githubClient is used to interact with the GitHub API. User can create the issue, edit the issue, and delete the issue in this client function.
The findOneIssue is used to get the certain issue details from the GitHub API.
This function is used to get user infomation from the GitHub API.
The styles folder is used to store the styles of the project.
The UserProvider is used to provide the user information to the children components.
The AlertProvider is used to provide the alert message to the children components.
The types folder is used to store the types of the project.
The Issue type is used to store the issue details. And the Label Type is used to stored the issue label types.
The User type is used to store the user information types.