Skip to content

nventive/cloud-template

Repository files navigation

Open Source Project Template

This repository contains a template to seed a repository for an Open Source project.

Prior to submitting your request for publication, make sure to review the Open Source guidelines for publications.

Features (to keep as-is, configure or remove)

The following is the template for the final README.md file:


Project Title

{Project tag line}

{Small description of the purpose of the project}

License

Getting Started

The main prerequisites for a developer setup are:

  • either Linux (including WSL) or macOS as OS;
  • the Nix package manager with flakes enabled;
  • direnv and nix-direnv;
  • Docker;
  • Visual Studio Code with the C# DevKit extension for debugging;
  • an Azure account to deploy and run in the cloud.

Precise installations instructions are as follow:

For WSL Users

  • If you’re using Docker Desktop, remember to enable it in your WSL distro
  • VS Code extensions must be activated in WSL.
  • The ASP.NET Core developement certificate installed in WSL must be trusted in your Windows browser.

Then you need to trust the ASP.NET Core development certificate.

  1. Install the .NET SDK in Windows whichever way you want.
  2. Install and activate the ASP.NET Core development certificate ([password] being any password you’ll remember in the next minute). In Windows:
dotnet dev-certs https --clean
dotnet dev-certs https --trust
dotnet dev-certs https -ep https.pfx -p [password]
  1. Restart your browser to make sure it trusts the new certificate.
  2. Import the certificate in WSL and trust it for inter-service communications ([path] being the path to the windows directory you executed the previous commands, and [password] being the password entered previously):
sudo apt install dotnet-sdk-8.0
dotnet dev-certs https --clean --import /mnt/c/[path]/https.pfx --password [password]
sudo -E dotnet dev-certs https -ep /usr/local/share/ca-certificates/aspnet/https.crt --format PEM
sudo update-ca-certificates

For macOS and straight Linux users

ASP.NET Core development certificate is more simple.

  1. Install a .NET SDK.
  2. Install and activate the ASP.NET Core development certificate
dotnet dev-certs https --clean
dotnet dev-certs https --trust

For all OSes: install Nix, direnv

Use the Determinate Nix installer:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Follow any instructions, including those necessary to get nix in path.

  1. Install direnv.
nix profile install nixpkgs#nix-direnv
  1. Hook direnv into your shell.

For bash this means adding the following line in your ~/.bashrc:

eval "$(direnv hook bash)"

For zsh (macOS), the file is ~/.zshrc and the line is

eval "$(direnv hook zsh)"
  1. Don’t forget to reload your shell
source ~/.bashrc

or

source ~/.zshrc
  1. Install nix-direnv in your user Nix profile and hook it up to direnv.
nix profile install nixpkgs#nix-direnv
source $HOME/.nix-profile/share/nix-direnv/direnvrc

Start for real

  1. Get this repository’s content
git checkout https://github.com/nventive/cloud-template.git
  1. Copy the template to wherever you want to have it and enable the development shell (you can replace MyProject with whatever you want). Warning: the last step may take a while, as it’s downloading/building all tools and dependencies.
cp -r cloud-template/template MyProject
cd MyProject
direnv allow
  1. Rename the project according to your inspirations (Placeholder is the actual string to be replaced; MyProject can be whatever you want).
fd Placeholder | tac | xargs rnm -rs '/Placeholder/MyProject/g' -y
fd --hidden --type file --exec sd Placeholder MyProject
  1. Start VS Code. NB: it has to be started this way to ensure the correct .NET frawework is found and debugging works.
just code

To get a list of other recipes:

just --list

Further instructions are in the README of your new project.

Features

{More details/listing of features of the project}

Breaking Changes

Please consult BREAKING_CHANGES.md for more information about version history and compatibility.

License

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on the process for contributing to this project.

Be mindful of our Code of Conduct.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published