Please enable JavaScript.
Coggle requires JavaScript to display documents.
ASP.NET Core (Dtos (Data Transfer Objects) (UserForRegisterDto,…
ASP.NET Core
-
-
Controllers
AuthController
-
[HttpPost("register")]
-
[HttpPost("login")]
- generates token
-
-
UsersController
-
[HttpGet]
- getUsers()
-
[HttpGet("{id}")]
- getUser()
-
[HttpPut("{id}")]
- ...
-
-
-
PhotosController
-
[HttpPost]
- AddPhotoForUser
-
[HttpGet("{id}", Name = "GetPhoto")]
-
[HttpPost("{id}/setMain")]
-
[HttpDelete("{id})]
-
-
-
-
FallBack
- redirects routes from the
Angular application
Entity Framework (ef)
connected via
-
Migrations
- set up database with models
-
Data
DataContext
- uses models to form actual database entries
- interface for database queries
IAuthRepository
-
Task<User> Login(username, password)
-
Task<User> Register(user, password)
-
Task<bool> UserExists(username)
implemented by
AuthRepository
-
bool VerifyPasswordHash(password, hash, salt)
-
void CreatePasswordHash(password, out hash, out salt)
- sets users
- gets usernames, passwords
-
-
IDatingRepository
-
void Add<T>(T entity)
-
void Delete<T>(T entity)
-
Task<bool> SaveAll()
-
Task<IEnumerable<User>> GetUsers()
-
Task<User> GetUser(int id)
- ...
-
-
Models
Photo
- contains all properties of a photo: Id, Url, Description, ...
User
- contains all properties of a user: Id, Username, Password, ...
Like
- defined many-to-many relationship
-
Program.cs
- starts Kestrel server
- calls
UseStartup()
Startup.cs
- set configurations
- add services
- specifies authentication service with JWT-token
- adjusts security settings with cor-service
- connects Configuration with Cloudinary Settings
- use ExceptionHandler
service.AddDbContext
-
appsettings.json
- holds
DefaultConnection
for database
- Cloudinary access data
-
launchSettings.json
- sets development or production mode
Angular
app.module
- contains all components
- imports modules
- contains all providers
- adds bootstrap
- errorInterceptorProvider
members
member-detail.component
- detailed view of single member
-
-
-
member-list.component
- uses pagination
information from header
- contains the filter options
-
-
-
-
-
-
-
-
nav.component
- nav-bar with routing
- login and register
-
-
home.component
- initial website screen
- possibility to register
- contains
- communicate with inputs / outputs
-
app.component
- decodes saved token if site is opened
-
-
-
_services
user.service
JSON / http.get
activates controller, sends user id
/ returns user Dtos and Header
-
-
auth.service
- sends userForLogin/Register-Dto
- saves token
- contains general subjects (observables), e.g. MainPhoto
-
saves token
Browser
- provides local storage
- displays
error.interceptor
- global error handler which intercepts code if error occurs
-
alertify.service
- used for displaying information
-
-
styles.css
- adds general css to the application
-
-
environments
- contains baseUrl
- sets production / development mode
-
-
-
-
-
-
-