Skip to content

solid-stack-solutions/voycar-backend

Repository files navigation

Backend - Your modern carsharing solution

also see Voycar Frontend!

Technology Overview

Installation and Usage

  • Have Docker set up
  • Get the source code, e.g. with...
git clone https://github.com/solid-stack-solutions/voycar-frontend
cd voycar-frontend
  • Make a copy of .env.example and name it .env (will be Git-ignored)
  • Set the names and values of your secret environment variables in there
  • Run docker compose up
  • Create and apply a migration (see Migrations)

Development

Conventions

  • Comments start with a space and a capital letter, e.g. // This is a comment
  • Identifiers of properties are usually PascalCase, e.g. MyProperty
  • Identifiers of dependency-injected properties are camelCase with a leading underscore, e.g. _myProperty

Migrations

Database migrations can be generated automatically from the EF Core DbContext. Creating migrations and applying them is necessary every time an entity associated with the DbContext changes.

# Make sure you are in the right directory with the necessary commands available
cd Voycar.Api.Web
dotnet tool restore

# Create a migration
dotnet ef migrations add <Migration_Name>
# Apply created migration to running (!) database
dotnet ef database update <Migration_Name> --connection "User ID=admin;Password=admin;Server=localhost;Port=5432;Database=VoycarDb"

If something doesn't work, it can help to delete old migrations ("Migrations" directory) and/or drop all the current tables in the database (but beware of the consequences).

Logging

with Serilog.AspNetCore

Level Usage
Verbose Verbose is the noisiest level, rarely (if ever) enabled for a production app.
Debug Debug is used for internal system events that are not necessarily observable from the outside, but useful when determining how something happened.
Information Information events describe things happening in the system that correspond to its responsibilities and functions.
Warning When service is degraded, endangered, or maybe behaving outside its expected parameters, Warning-level events are used.
Error When functionality is unavailable or expectations are broken, an Error event is used.
Fatal The most critical level, Fatal events demand immediate attention.

About

Voycar Backend - Your modern carsharing solution

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5