-
Install Postgres, the recommended way is to use your package manager.
-
Login as 'postgres' user, this can be done by executing
sudo -iu postgres
. The name could be different for you, but the convention is that the user is called 'postgres'. -
Create a new user by executing
createuser codidact
, you can choose any name here. -
Create a new database by executing
createdb --owner codidact codidact
, you can choose any name here. -
Prepare a connection string that will be used later. The format is
Host=localhost;Database=X;Username=X
. If you honored the suggestions the connection string would beHost=localhost;Database=codidact;Username=codidact
. -
You can logout of the shell using
logout
.
-
Fork the repository on GitHub and clone it into a local directory.
-
Navigate to that directory.
-
(optional) Add an upstream for the canonical repository this can be done using
git remote add upstream git://github.com/codidact/core
. This can be very helpful for rebasing.
- Run the following command inside of 'src/WebApp' to install the connection string
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "YOUR_CONNECTION_STRING"
-
Install the .NET Core SDK you need version 3.1, some package managers have a package for this. Note. On Arch Linux you need to install both the
dotnet-sdk
andaspnet-runtime
packages, other package managers might divide this functionality too. -
Install Visual Studio Code. You need the official version from Microsoft, the debugger for C# isn't included in packages from your package manager.
The following instructions are expressed very verbosely, many things can be done quicker with shortcuts.
-
Go to
View > Extensions
and install thems-vscode.csharp
extension. The extension will automatically start installing dependencies. -
Go to
File > Open Folder...
and open the directory where you setup the repository. There might be some popups messages, ignore them and use the instructions below, this will ensure that we are all on the same page. -
Go to
View > Command Palette...
and execute the.NET: Generate Assets for Build and Debug
command. You will be prompted to select a project, selectCodidact.WebUI
. -
New files should appear now, namely
.vscode/launch.json
and.vscode/tasks.json
. These determine how the project is built and launched. The default options are really good, however, I would recommend tinkering until they match your personal preferences. Especially the optionlogging.moduleLoad
is worth looking into, refer to this Stack Overflow question. -
More configuration can be done in
src/WebUI/Properties/launchSettings.json
, the defaults work though. -
You can launch the project by going to
Debug > Start Debugging
; a web browser should automatically open. -
In order to get IntelliSense (that is code completion as you type), go to
View > Command Palette...
and execute.NET: Restore All Projects
. -
It's currently not possible to run the tests from the editor directly, refer to the instructions without Visual Studio Code.
-
Install the .NET Core SDK you need version 3.1, some package managers have a package for this.
-
Navigate to the directory where you setup the repository.
-
Add your connection string to
src/WebUI/appsettings.Development.json
, refer to the instructions with Visual Studio Code. -
Change the configuration options in
src/WebUI/Properties/launchSettings.json
if you like, the defaults work though. -
You can launch the application by executing
dotnet run
in thesrc/WebUI
directory. -
You can run the tests by executing
dotnet test
in the root directory.
You'll also need to set up the auth provider. See these instructions for more information.