https://github.com/wastingnotime/contacts-backend-dotnet
This repository maintain a dotnet/webapi application that is part of "contacts" project, an initiative to explore technologies features.
https://github.com/wastingnotime/contacts-backend-dotnet
crud-api dotnet entity-framework migrations sqlite webapi
Last synced: 4 months ago
JSON representation
This repository maintain a dotnet/webapi application that is part of "contacts" project, an initiative to explore technologies features.
- Host: GitHub
- URL: https://github.com/wastingnotime/contacts-backend-dotnet
- Owner: wastingnotime
- License: mit
- Created: 2020-06-15T12:55:59.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T11:53:08.000Z (about 1 year ago)
- Last Synced: 2025-04-08T12:39:26.267Z (about 1 year ago)
- Topics: crud-api, dotnet, entity-framework, migrations, sqlite, webapi
- Language: C#
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# contacts-backend-dotnet
**contacts-backend-dotnet** is part of "contacts" project that is an initiative where we try to explore frontend and backend implementations in order to better understand it cutting-edge features. This repository presents a dotnet rest API sample.
## status
This repository belongs to the Contacts reference initiative started in 2020.
Its purpose was to understand how different stacks shape design decisions around the same domain model.
As of 2026, this project is frozen.
The exploration phase has been completed.
My current focus is depth, invariants, and system coherence rather than stack comparison.
This code remains as historical reference.
## stack
* dotnet 9.0
* webapi
* sqlite
* entity framework
## features
* migrations
## get started (linux instructions only)
### option 1 - use latest docker image from dockerhub
execute the remote docker image
```
docker run -p 8010:8080 wastingnotime/contacts-backend-dotnet:0.1.0-alpha
```
### option 2 - build and run a local docker image
build a local docker image
```
docker build --tag contacts-backend-dotnet .
```
execute the local docker image
```
docker run -p 8010:8080 contacts-backend-dotnet
```
### option 3 - execute from source code
- install dotnet 9 [how to](https://learn.microsoft.com/en-us/dotnet/core/install/linux)
- go to root of solution and execute the commands below
set environment for development
```
cp .env_example .env
```
update deps
```
dotnet restore
```
install migration tool (only once)
```
dotnet tool install --global dotnet-ef
```
run migrations
```
dotnet ef database update
```
and then run the application
```
dotnet run
```
## testing
create a new contact
```
curl --request POST \
--url http://localhost:8010/contacts \
--header 'Content-Type: application/json' \
--data '{
"firstName": "Albert",
"lastName": "Einstein",
"phoneNumber": "2222-1111"
}'
```
retrieve existing contacts
```
curl --request GET \
--url http://localhost:8010/contacts
```
more examples and details about requests on [verify.rest](https://raw.githubusercontent.com/wastingnotime/contacts-backend-dotnet/refs/heads/main/verify.rest)