This is a back-end for a Financial-tracker, an app I made to learn React and to learn the basics of CRUD RESTful API in C#.
- ASP.NET 8
- SQLite
- dotnet CLI
Simply clone the repository and run the command:
dotnet run --project Finance
POST /expenses
{
"title": "Groceries",
"amount": 279.7,
"date": "2024-06-08T08:00:00"
}
201 Created
Location: {{host}}/expenses/{{id}}
{
"id": "00000000-0000-0000-0000-000000000000",
"title": "Groceries",
"amount": 279.7,
"date": "2024-06-08T08:00:00"
}
GET /expenses?pageNumber={yourPart}&pageSize={yourPart}&filterField={yourPart}&filterValue={yourPart}&sortField={yourPart}&sortOrder={yourPart}
200 OK
{
"expenses": [
{
"id": "286d7bbf-e6e0-4bfd-b4e0-906a613193db",
"title": "Car Repair",
"amount": 350.5,
"date": "2024-02-15T08:00:00"
},
{
"id": "3f91f017-af32-46b3-9c53-47adb1314c9a",
"title": "Groceries",
"amount": 75.3,
"date": "2024-03-10T08:00:00"
},
{
"id": "9faf45e0-38c5-4c27-b9d8-f6b04b719060",
"title": "Electric Bill",
"amount": 120.75,
"date": "2024-04-05T08:00:00"
},
{
"id": "805795d0-f73d-4334-94af-ce4fab83e142",
"title": "Dinner Out",
"amount": 60.2,
"date": "2024-04-18T08:00:00"
},
{
"id": "537126c9-f485-4674-900e-c77ae349c25f",
"title": "Movie Tickets",
"amount": 45.0,
"date": "2024-05-01T08:00:00"
}
],
"totalCount": 5,
"pageNumber": 1,
"pageSize": 10
}
GET /expenses/{{id}}
200 OK
{
"id": "00000000-0000-0000-0000-000000000000",
"title": "Groceries",
"amount": 279.7,
"date": "2024-06-08T08:00:00"
}
PUT /expenses/{{id}}
{
"id": "00000000-0000-0000-0000-000000000000",
"title": "Groceries",
"amount": 279.7,
"date": "2024-06-08T08:00:00"
}
204 No Content
or
201 Created
Location: {{host}}/expenses/{{id}}
DELETE /expenses/{{id}}
204 No Content
Post /users
{
"firstName": "Beka",
"lastName": "Birhanu",
"email": "[email protected]",
"password": "************"
}
201 Created
{
"id": "00000000-0000-0000-0000-000000000000",
"firstName": "Beka",
"lastName": "Birhanu",
"email": "[email protected]",
"token": "afldfkjasdflkjasldf.slfkdjsdflkasdfl.sjadfljasldkfj"
}
Post /auth/signIn
{
"email": "[email protected]",
"password": "************"
}
200 Ok
{
"id": "00000000-0000-0000-0000-000000000000",
"firstName": "Beka",
"lastName": "Birhanu",
"email": "[email protected]",
"token": "afldfkjasdflkjasldf.slfkdjsdflkasdfl.sjadfljasldkfj"
}
Post /auth/signOut
{
"email": "[email protected]",
"token": "afldfkjasdflkjasldf.slfkdjsdflkasdfl.sjadfljasldkfj"
}
204 No Content