Skip to content

banudik/Tobeto3A-NArchitecture.BootcampProject

Repository files navigation


CodeStorm Educational Platform Backend API (.NET)

Project Description

This project provides the backend API for the CodeStorm Educational Platform. It is developed based on Clean Architecture principles and designed using nArchitectureGen. The project offers a high-performance and scalable structure.

Features

- Clean Architecture - CQRS (Command Query Responsibility Segregation)
- Advanced Repository Pattern - Role-Based Access Control (Instructor, Student, Admin)
- Dynamic Query - Pagination
- OTP (One-Time Password) - Authentication with JWT
- Logging with Serilog - PDF Generation (Certificate)
- Cloudinary Media Service - Global Exception Handling
- MsSQL - Refresh Token and Token Renewal
- Token Revocation - Mail Service
- Mediatr

Architecture

This project adopts Clean Architecture and CQRS (Command Query Responsibility Segregation) principles. This architectural structure ensures the project is modular, testable, and maintainable. Mediatr is used in the implementation of the CQRS pattern.

File Structure

Project Image 1

💻 About nArchitectureGen

nArchitectureGen

Developed inspired by Clean Architecture, nArchitecture is a monolithic project showcasing advanced development techniques. The project includes Clean Architecture, CQRS, Advanced Repository, Dynamic Querying, JWT, OTP, Google and Microsoft Authentication, Role-Based Management, Distributed Caching (Redis), Logging (Serilog), Elastic Search, Code Generator, and more.

Usage

API Documentation You can use Swagger UI for all API endpoints and details used in the project.

Features

Clean Architecture This project applies Clean Architecture principles to provide a modular, testable, and maintainable structure. It minimizes dependencies between layers and makes business logic independent of the UI, database, or other external dependencies.

CQRS (Command Query Responsibility Segregation)

CQRS separates commands (data modification operations) and queries (data reading operations). This improves performance optimization and better data integrity.

Authentication with JWT

Project Image 1

Authentication is performed using JWT (JSON Web Token). This offers a secure and stateless authentication method. The JWT Payload decode part is as shown in the image.

OTP (One-Time Password)

We provide an extra layer of security by using one-time passwords to verify user identities.

Logging with Serilog

Project Image 1

Using Serilog, logs in the application are configured and recorded. This is very useful for debugging and monitoring the application. In the current demo, log records are stored as text files, and the infrastructure for MongoDB usage is available.

Dynamic Query

Dynamic querying capabilities allow flexible and customizable queries according to the needs of the user or the application.

Global Exception Handling

Global exception handling manages errors centrally by capturing them at a single point, regardless of where they occur in the application. This provides more consistent error messages and a better user experience.

Refresh Token and Token Renewal

Project Image 1

Using refresh tokens, we extend user session durations, so users do not need to log in again. When a user logs out or in case of a security breach, the token is revoked, blocking access. RefreshToken is created as HttpOnly Cookie when the user logs in. HttpOnly type allows this cookie to be carried only with http requests.

Token Revocation

Token revocation allows users to manually end their sessions or block access in case of security breaches. This is an important feature that enhances application security.

PDF Generation (Certificate)

Project Image 1 Project Image 2

In our project, we use the iTextSharp library to generate certificates when users complete their training. This library allows us to dynamically create and edit PDF files. It enables users to create documents like course completion certificates in PDF format. This provides users with a tangible indicator of achievement and enhances the platform's professionalism.

Mail Service

Project Image 1

We use the MailKit library and Gmail's SMTP server to send emails to users. This structure provides a reliable and flexible solution for performing actions such as email verification and password reset. Emails are sent for various operations (password reset, account verification, two-factor authentication), enhancing user experience and security. Mail bodies are stored as HTML files, and when a mail is sent, the appropriate link or one-time code field in the file is filled out and sent.

Database Schema and Request-Response Body Examples

default-header
Database Diagram
cloud-db-logo
Response on Successful Login
cloud-db-logo
Login Request
gradient-markdown-logo
Generated Certificates
custom-logo
Response on Error
skills-light
Student Registration Schema
gradient-markdown-logo
Command Request
readme-ai-header
Training Creation Schema
black-logo
Certificate Creation Schema
gradient-markdown-logo
Chapter Request

Contribution Guide

If you want to contribute to this project, please follow the steps below:

  • Fork the repository.
  • Create a new branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Create a Pull Request.

Contact

If you have any questions or feedback about this project, please contact us here.

Thank you

About

Tobeto NArchitecture Bootcamp Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •