This document is for developers who want to contribute.
Before you can run a .NET application, you need to install the .NET SDK. To install the latest .NET 8 SDK, follow these steps:
- Visit the .NET 8 SDK download page.
- Choose the SDK that corresponds to your operating system.
- Click on the download link and run the installer.
- Follow the instructions in the installer.
You can verify the installation by opening a new command prompt or terminal window and running the command dotnet --version
. This should display the version of the .NET SDK that you installed. If you installed it correctly, it should show a version number starting with 8.X.X
.
You have the flexibility to develop this project using one of the recommended IDEs below, or feel free to use your preferred IDE:
- Visual Studio Code: This is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS, and Linux. You can download it from the official Visual Studio Code page.
- After installing Visual Studio Code, open the project folder by clicking on
File -> Open Folder
.
- Visual Studio: This is a full-featured IDE that runs on Windows and macOS. You can download it from the official Visual Studio page.
- After installing Visual Studio, open the project by clicking on
File -> Open -> Project/Solution
and selecting the.sln
file of your project.
- JetBrains Rider: This is a fast and powerful .NET IDE developed by JetBrains. It runs on Windows, macOS, and Linux. You can download it from the official JetBrains Rider page.
- After installing Rider, open the project by clicking on
File -> Open
and selecting the.sln
file of your project.
⚠️ Important! Before running the application, make sure you have set up your environment correctly. You must have read the Managing Secrets with User-Secrets and Generating a GitHub Access Token sections.
-
Clone the repository: Use the
git clone
command followed by the URL of the repository. This will create a local copy of the project on your machine. -
Navigate to the project directory: Use the
cd
command followed by the path of the directory. For example, if the project is in a directory namedsrc/CrystaLearn
, you would use the commandcd src/CrystaLearn
. -
Run the web app: Navigate to the
Server/CrystaLearn.Server.Web
directory within the project directory. Use thedotnet run
command to start the web app. This command will build the project and start running the web server.
.NET provides a secrets manager tool that can be used for storing sensitive data during the development of a project. This tool stores sensitive data in a separate secrets.json file that is not checked into source control, unlike the appsettings.json
file.
Here's how you can use the secrets manager:
Install the Secret Manager tool globally. Run the following command in your terminal:
dotnet tool install --global dotnet-user-secrets
A GitHub access token is a way to authenticate with GitHub without using a password. You can generate a new token in this link: https://github.com/settings/tokens For more detailed information, you can visit the official GitHub documentation on Managing Your Personal Access Tokens.
For the SQL Server Connection String, you can request access to the Telegram group that contains the connection string. You can join the group using this link.
Check this document and create your PAT:
cd /src/CrystaLearn/src/Server/CrystaLearn.Server.Web
dotnet user-secrets init
dotnet user-secrets set "ConnectionStrings:SqlServerConnectionString" "Your SQL Server Connection String"
dotnet user-secrets set "GitHub:GitHubAccessToken" "Your GitHub Access Token"
dotnet user-secrets set "AzureDevOps:PersonalAccessToken" "Your Azure DevOps Personal Access Token"
cd /src/CrystaLearn/src/Console/CrystaLearn.Console
dotnet user-secrets init
dotnet user-secrets set "ConnectionStrings:SqlServerConnectionString" "Your SQL Server Connection String"
dotnet user-secrets set "GitHub:GitHubAccessToken" "Your GitHub Access Token"
dotnet user-secrets set "AzureDevOps:PersonalAccessToken" "Your Azure DevOps Personal Access Token"
cd /src/CrystaLearn/src/Core/CrystaLearn.Core.Tests
dotnet user-secrets init
dotnet user-secrets set "ConnectionStrings:SqlServerConnectionString" "Your SQL Server Connection String"
dotnet user-secrets set "GitHub:GitHubAccessToken" "Your GitHub Access Token"
dotnet user-secrets set "AzureDevOps:PersonalAccessToken" "Your Azure DevOps Personal Access Token"
Remember to replace "Your SQL Server Connection String"
and "Your GitHub Access Token"
with your actual connection string and access token.
This way, your secrets are kept out of your project files and won't be checked into source control. For more information on managing application secrets during development with User Secrets, you can visit the official Microsoft documentation here.