Skip to content

Mo Expense Tracker is a multi-user web api for tracking user's expenditure. It was implemented to learn dotnet.

Notifications You must be signed in to change notification settings

Otumian-empire/MoExpenseTracker

Repository files navigation

MO Expense Tracker

Mo Expense Tracker is a multi-user web api for tracking user's expenditure. It was implemented to learn dotnet.

Application

Core

Core has functionality or object that is shared across the api such as exception handling, endpoint filters (for validation), response objects...

Data

Data has the database context

Features

It says break your api into features and so it was done. There are four featuresc as of this time. There are the Account, Auth, Category and Expense. Each feature may have a controller, dao, dto, endpoint and validation. (There was a time I wanted to remove the dao).

Migrations

Migrations has the table migrations created to the tables (models).

Models

Models represent the table for users, categories and expenses.

Important files

  • Program.cs - the entry point into the app
  • MoExpenseTracker.http - used as the api client to make api requests

Some resources

How to CRUD

How to use ef core and relationship (I didn't really much of these but you'd understand)

How to connect to a database

How to do authentication and authorization in dotnet

How to hash password - hash and verify

How to handle exceptions (global)

How to route endpoints (group routes)

How to create extension methods

How to validate request

MISC (extra information, won't hurt to watch, read or run through)

V0

Most contains the first implementations

V1 updates

These are the responses I had from reddit and discord (dotnet/csharp) group about this app and I am looking forward to integrate them in this version of the app.

  • api versioning ✅
  • rename controllers into handlers (not to miscommunicate that they are class "controllers") ✅
  • refactor to use endpoint filter for all validation ✅
  • refactor the content of the program.cs into another file ✅
  • use dateonly for the expense data ✅
  • lowercase user data on insert and update, especially email, description, etc ✅
  • for searching, implement filters and sorting and pagination ✅
    • issue: could not search for an expense by text in the description ❌
  • refactor the user id check in the request handlers and pass it as a dependency or endpoint filter ✅
  • use a middleware or some sort to validate the authentication and don't inject the http context ✅
  • return every created/updated record, this way an extra db call will be saved ✅
  • reduce the logic in the request handlers
  • when checking if the email is used on profile update, compare the user id rather when the result is not null ✅

About

Mo Expense Tracker is a multi-user web api for tracking user's expenditure. It was implemented to learn dotnet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages