mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
4.0 KiB
4.0 KiB
How to setup and build the project
- Setup the environment using VSCode by installing the extensions: ".NET Install Tool", "C#" (from Microsoft), "C# Dev Kit" (from Microsoft) in the Extensions tab
- Navigate to the "Source Control" tab (left side; looks like a node graph)
- Click "Clone Repository"
- Enter this repository's URL
- Follow the instructions to authenticate using GitHub
- Run the project using
F5ordotnet build && dotnet runin the console
Important endpoints/URLs
- Login: http://localhost:5275/Home/Login
- The login page
- Home: http://localhost:5275/Home/Index
- The home and overview page
- Swagger: http://localhost:5275/swagger/index.html
- (Active only in development environment)
- (Requires authorization)
- All controller endpoints are mapped here.
- You can test the endpoints here and debug issues.
- Elmah: http://localhost:5275/elmah/errors
- (Requires authorization)
- All errors are logged here.
- You can check for uncaught errors here.
- Healthz: http://localhost:5275/healthz
- (Requires authorization)
- Checks for the status of the LDAP database
- If an issue with the database is detected, you get "Unhealthy" as a result.
Logging
- The logs are - by default - output to
~/logs/. - The error logs are - by default - output to
~/Elmah
If necessary, change the folder in appsettings.json
Environments
Currently there are two environments
- Development
- Utilizes
appsettings.Development.jsonandappsettings.json - Points to a public LDAP running on ld50.dev (no SSL!)
- Is the default for local development
- Utilizes
- Production
- Utilizes
appsettings.Production.jsonandappsettings.json - Points to a local LDAP
- Is the default for the QA/Production
- Requires
DOTNET_ENVIRONMENTorASPNETCORE_ENVIRONMENTvariable to be set toProduction
- Utilizes
How to Install and configure LDAP locally
(This is not necessary for general development.)
- Install LDAP on Ubuntu and do basic configuration
- Configure the application to utilize your LDAP and run it once - all "ou" elements will be created automatically
How to connect to ldap server using apache directory studio
- Click "add new connection"
- Choose any connection name, hostname: "ld50.dev", port: 8389
- Authentication method: "Simple Authentication", Bind DN: "cn=admin,dc=localhost", bind password: "TestLDAP"
- Continue and finish setup
How to contribute
- Assign an open issue to yourself
- Create a new branch by clicking on "Create a branch" and confirming
- Do
git fetchor fetch via your IDE - Do
git switch BRANCHNAMEor select the newly created branch in your IDE - Implement your changes
- Prepare your changes to commit
- In "Source Control" under "Changes" you'll find the changed files. For each file:
- Click on each file, examine all the shown changes and check whether it's what you want committed. Remove temporary elements you added for debugging (e.g. "Console.Log")
- After cleaning up the file, click on the "+" on the right (Mouseover text: "Stage Changes")
- After staging all file changes in step 3, do a final test of the changes before you commit
- Select a commit message that best describes the change you did. e.g.:
- "Added [...]"
- "Fixed [...]"
- "Created [...]"
- "Implemented [...]"
- Do
git commit -m "MESSAGE"or press the big blue "Commit" button (VSCode) - Do
git push(in the "GRAPH" section there are a few buttons, one of which has an upward facing arrow and the mouseover text "Push"; use this one.) - After committing and pushing your changes, create a pull request in GitHub. (optional: Assign @LD-Reborn for code review.)
- Once there are no requested changes / the review is approved, merge the branch. If you encounter merge conflicts, contact @LD-Reborn.
How to perform E2E tests
cd tests/Berufsschule_HAM.E2ETestsdotnet build && dotnet test