Thank you for your interest in contributing to SharpSite! Your contributions are valuable and help improve the project for everyone.
SharpSite's source code is organized with a release branch, release train system to group new features and fixes to the application. You will see branches in the main repository with a name like v0.5 that indicate these are the release branches the team is actively working on. Developers that are working on features as part of this v0.5 release will send pull-requests to the v0.5 release and those changes are queued up in a v0.5 pull request that merges the v0.5 branch into main. When work is completed for a release, this pull-request is completed and merged into the main branch. A matching tag is applied to the main branch for the former branch number.
When released versions need patches / fixes applied, there will be a similar fix-release branch with a name like v0.5.1 that is based on the v0.5 tag. A similar working branch and pull-request is created to organize and apply the fixes
Here's how you can get started working with the source code, submit features and code fixes:
-
Fork the repository to your GitHub account.
-
Clone the forked repository to your local machine using:
git clone https://github.com/YOUR-USERNAME/SharpSite.git
-
Add an upstream reference to the main repository:
git remote add upstream [email protected]:FritzAndFriends/SharpSite.git
-
Checkout a copy of the release branch that you would like to contribute to. If the case of milestone 0.5, the release branch is called v0.5 you would execute this command:
git checkout --track upstream/v0.5
-
Create a new branch for your feature or bugfix. By running this command from the v0.5 branch that was checked out in step 4, it will be based on the v0.5 branch the team is actively collaborating on:
git checkout -b feature_your-feature-name
-
Ensure you have .NET 9 SDK installed on your machine.
-
Configure Docker or Podman on your machine. We will use this with .NET Aspire. More details about configuring and using .NET Aspire can be found at: https://learn.microsoft.com/dotnet/aspire/fundamentals/setup-tooling
-
Install the necessary dependencies. From the root folder, run this command:
dotnet restore
-
Build the project from the SharpSite.AppHost folder:
dotnet build
-
Install development certificates for local development.
Generate a new HTTPS development certificate:
dotnet dev-certs https --trust
Export the HTTPS development certificate:
dotnet dev-certs https -ep path/to/certificate.pfx -p yourpassword
Verify the HTTPS development certificate:
dotnet dev-certs https --check --trust
-
Run the project locally with .NET Aspire from the SharpSite.AppHost folder:
dotnet run
To run the unit tests locally, you can do this at the command line with this command from the base folder of the repository:
dotnet test UnitTests.slnf
You should run a few commands periodically to ensure that your local code is updated with the current changes in the main repsitory.
The sample command updates the main branch. You can run this for other feature branches that you are tracking and working with
git checkout main
git pull upstream
You should bring the latest commits from the shared branch into your feature branch to minimize the conflicts when you are ready to share your code with the rest of the project team. This sample checks out your work in the feature_MY-WORKING-BRANCH branch and merges the latest updates from the main branch
git checkout feature_MY-WORKING-BRANCH
git merge main
The default user that is built and initialized in SharpSite is an Administrator and has these credentials:
- username:
admin@localhost
- password:
Admin123!
- Follow the C# coding conventions as outlined in the Microsoft C# Coding Conventions.
- Keep code changes concise and focused.
- Write clear, descriptive commit messages.
- Add unit tests where appropriate
- Do not break unit tests or end-to-end tests
To add translations for a new locale, follow these steps:
-
Add a .resx File:
- Navigate to the
SharpSite.Web/Locales
folder in the project. - Add a new
.resx
file with the appropriate naming convention, e.g.,SharedResource.<locale>.resx
(e.g.,SharedResource.fr.resx
for French). - Add the necessary key-value pairs for the translations in the
.resx
file.
- Navigate to the
-
Update Locales Configuration:
-
Open
Locales/Configuration.cs
. -
Add an entry for the new locale in the appropriate configuration section. For example:
public static class Configuration { public readonly static string[] SupportedCultures = { "en-US", "nl-NL" // Add your new locale here "<locale>" }; ... }
-
-
Verify Translations:
- Ensure that the translations are correctly loaded and displayed in the application.
- Test the application with the new locale to verify that all translations are working as expected.
-
Ensure all tests pass before submitting a pull request.
-
Update documentation as needed.
-
Push your branch to your forked repository:
git push origin feature_your-feature-name
-
Open a pull request against the release branch (in the sample above, it was v0.5) of the main repository. GitHub will typically prompt you with a banner at the top of the repository that offers to assist you in creating this pull request. Make sure that it is merging into a base that is the release branch you are working from, in the sample case that branch is v0.5
If you find a bug or have a feature request, please open an issue on GitHub. Provide as much detail as possible to help us address the issue quickly.
Jeff Fritz is the lead project maintainer. Feel free to reach out to him for any significant inquiries or guidance regarding SharpSite.
We adhere to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
By contributing to SharpSite, you agree that your contributions will be licensed under the MIT License.