跳到主内容

前端

The source code for Casdoor's frontend is located inside the /web folder: https://github.com/casdoor/casdoor/tree/master/web

It is a Create-React-App (CRA) project, which follows the classic CRA folder structure as outlined below:

文件/目录描述
publicThe root HTML file for React
srcSource code
craco.config.jsThe Craco configuration file. You can change the theme color (blue by default) here
crowdin.ymlCrowdin i18n configuration file
package.jsonNPM/Yarn 依赖文件
yarn.lockYarn lockfile

Inside the /src directory, you will find several important files and folders:

文件/目录描述
accountThe "My profile" page for logged-in users
authAll code related to authentication, such as OAuth, SAML, sign up page, sign in page, forget password page, etc.
backendThe SDK for calling the Go backend API. It contains all the fetch() calls
basicThe homepage (dashboard page) for Casdoor, which contains several card widgets
commonShared UI widgets
localesi18n translation files in JSON, synced with our Crowdin project: https://crowdin.com/project/casdoor-site
App.jsThe entry JS file containing all the routes
Setting.jsUtility functions used by other code
OrganizationListPage.jsThe page for the organization list, similar to all other XXXListPage.js files
OrganizationEditPage.jsThe page for editing one organization, similar to all other XXXEditPage.js files