Category: Blog

  • fullbogons-nftables-gen

    fullbogons-nftables-gen

    The tool exists to create a definition file for nftables from the fullbogons
    files from Team Cymru. It can be used to filter out bogons
    from incoming traffic with nftables.

    There is probabily little advantage to this, but I wanted to play around with
    named sets and so forth.

    This is duct tape programming max. There are no tests and there is no plans
    to add any. It’s for a very specific usecase I had and it’s not really going
    to expand beyond this.

    Usage

    The intended usage is to be used in cron or systemd.timers, to generate a
    definition file. The name of this file is the only argument to the program.
    The file will be atomically replaced, so there should not be an instance of
    a half written file, as long as rename is implemented atomically.

    Extras

    To make usage easier, I’ve included a systemd.timer file that will execute this
    once every 4 hours roughly. This is how you can install it:

    sudo install fullbogons-nftables-gen /usr/local/bin
    sudo install -m644 contrib/systemd/fullbogons-nftables-gen.* /etc/systemd/system
    sudo install -Dm644 contrib/nftables/example-refresh-set.nft /etc/nftables.d/refresh-fullbogons.nft
    
    # This will fail, and that is ok, it is just to get the inital definitions file.
    sudo systemctl start fullbogons-nftables-gen.service
    
    # Then update /etc/nftables.conf with something akin to the content of
    # contrib/nftables/example-ruleset.nft
    
    # Then enable the timer
    sudo systemctl enable --now fullbogons-nftables-gen.timer
    

    I’ve also included two example nftables files. The first contrib/nftables/example-ruleset.nft
    is an example usage of the defintions file. The second
    contrib/nftables/example-refresh-set.nft is an example usage for hotswapping the
    contents of the bogons sets, without reloading the whole ruleset.

    Visit original content creator repository
    https://github.com/rHermes/fullbogons-nftables-gen

  • intellij-idea-coco-r-plugin

    Coco/R Plugin for IntelliJ IDEA

    Build

    Version Downloads

    This plugin adds support for Coco/R to the IntelliJ IDEA Platform. The initial version was developed as part of a bachelor theses and the first public release was on 2018-01-25. Maintenance will be performed on a best effort basis.

    Plugin Installation

    The plugin can be installed directly from the official Jetbrains Plugin Repository or via the zip file provided on the Releases page.

    Plugin features

    • Syntax Highlighting – Customizable via settings page
    • Commenter (Block and line comments)
    • Syntax Error highlighting (unexpected tokens)
    • Reference check (report unresolvable references to characters, tokens and productions)
    • Declaration order check (report references to characters and tokens declared after usage)
    • Attributes check (productions have to be used with or without attributes according to declaration)
    • Highlight unused characters, tokens, pragmas and productions
    • Code Folding
    • Structure View
    • Find usages
    • Inplace rename refactorings (Compiler, Characters, Tokens, Pragmas and Productions)
    • Brace matching for (), [], {}, <>, <..> and (..)
    • Code completion (Compiler, Character, Token, Pragma and Production names)
    • Go to declaration
    • Go to symbol / Symbol search
    • Go to generated code (for productions)
    • Configurable Java language injection
    • Generate Scanner and Parser via menu action
    • Automatic detection of appropriate output folder for generated Java classes
    • Automatic detection of package in case no $package directive is pre
    • Automatic detection of appropriate output root for generated Java classes
    • Warnings and Errors during Coco/R execution are shown within the Problems Tool Window
    • Errors from generated Parser are mapped back to the grammar file

    Documentation

    Please refer to the attached PDF on the Releases page. Additional documentation (as part of the README or via Wiki) will be added in the future.

    IDE support limitations

    In it’s current state the plugin is designed specifically for usage with the Java version of Coco/R. The language for global fields and methods, as well as semantic actions is always assumed to be Java, which will also be injected. Due to this fact the plugin currently cannot be used with any IDEs not including Java support (e.g. Rider, WebStorm, RubyMine, …). If you still want to use Coco/R in any of these IDEs or a non Java version of Coco/R you have some options:

    License

    The plugin is licensed under the GNU General Public License v3.0

    Visit original content creator repository https://github.com/tsalzinger/intellij-idea-coco-r-plugin
  • awesome-cardano

    Visit original content creator repository
    https://github.com/benohanlon/awesome-cardano

  • goit-react-hw-02-phonebook

    React homework template

    Цей проект був створений за допомогою Create React App. Для знайомства і налаштування додаткових можливостей звернися до документації.

    Створення репозиторію за шаблоном

    Використовуй цей репозиторій організації GoIT як шаблон для створення репозиторію свого проєкта. Для цього натисни на кнопку «Use this template» і вибери опцію «Create a new repository», як показано на зображенні.

    Creating repo from a template step 1

    На наступному кроці відкриється сторінка створення нового репозиторію. Заповни поле його імені, переконайся що репозиторій публічний, після чого натисни кнопку «Create repository from template».

    Creating repo from a template step 2

    Після того як репозиторій буде створено, необхідно перейти в налаштування створеного репозиторію на вкладку Settings > Actions > General як показано на зображенні.

    Settings GitHub Actions permissions step 1

    Проскроливши сторінку до самого кінця, у секції «Workflow permissions» вибери опцію «Read and write permissions» і постав галочку в чекбоксі. Це необхідно для автоматизації процесу деплою проєкту.

    Settings GitHub Actions permissions step 2

    Тепер у тебе є особистий репозиторій проекту, зі структурою файлів і папок репозиторію-шаблону. Далі працюй із ним як із будь-яким іншим особистим репозиторієм, клонуй його собі на комп’ютер, пиши код, роби комміти і відправляй їх на GitHub.

    Підготовка до роботи

    1. Переконайся що на комп’ютері встановлено LTS-версія Node.js. Завантаж і встанови її якщо необхідно.
    2. Встанови базові залежності проєкту командою npm install.
    3. Запусти режим розробки, виконавши команду npm start.
    4. Перейди в браузері за адресою http://localhost:3000. Ця сторінка буде автоматично перезавантажуватися після збереження змін у файлах проєкту.

    Деплой

    Продакшн версія проєкту буде автоматично проходити лінтинг, збиратися і деплоїтися на GitHub Pages, у гілку gh-pages, щоразу, коли оновлюється гілка main. Наприклад, після прямого пушу або прийнятого пул-реквесту. Для цього необхідно у файлі package.json відредагувати поле homepage, замінивши your_username і your_repo_name на свої, і відправити зміни на GitHub.

    "homepage": "https://your_username.github.io/your_repo_name/"

    Далі необхідно зайти в налаштування GitHub-репозиторію (Settings > Pages) і виставити роздачу продакшн-версії файлів із папки /root гілки gh-pages, якщо це не було зроблено автоматично.

    GitHub Pages settings

    Статус деплоя

    Статус деплою крайнього коміту відображається іконкою біля його ідентифікатора.

    • Жовтий колір – виконується збірка і деплой проєкту.
    • Зелений колір – деплой завершився успішно.
    • Червоний колір – під час лінтингу, сборки або деплою сталася помилка.

    Детальнішу інформацію про статус можна подивитися, клікнувши на іконку, і у вікні, що випадає, перейти за посиланням Details.

    Deployment status

    Жива сторінка

    Через якийсь час, зазвичай кілька хвилин, живу сторінку можна буде подивитися за адресою, вказаною у відредагованій властивості homepage. Наприклад, ось посилання на живу версію для цього репозиторію https://goitacademy.github.io/react-homework-template.

    Якщо відкривається порожня сторінка, переконайся, що у вкладці Console немає помилок пов’язаних із неправильними шляхами до CSS і JS файлів проєкту (404). Швидше за все у тебе неправильне значення властивості homepage у файлі package.json.

    Маршрутизація

    Якщо додаток використовує бібліотеку react-router-dom для маршрутизації, необхідно додатково налаштувати компонент <BrowserRouter>, передавши у пропе basename точну назву твого репозиторію. Слеш на початку рядка обов’язковий.

    <BrowserRouter basename="/your_repo_name">
      <App />
    </BrowserRouter>

    Як це працює

    How it works

    1. Після кожного пушу в гілку main GitHub-репозиторія, запускається спеціальний скрипт (GitHub Action) з файла .github/workflows/deploy.yml.
    2. Усі файли репозиторію копіюються на сервер, де проект ініціалізується і проходить лінтинг і збірку перед деплоєм.
    3. Якщо всі кроки пройшли успішно, зібрана продакшн-версія файлів проєкту відправляється в гілку gh-pages. В іншому випадку, в лозі виконання скрипта буде вказано в чому проблема.
    Visit original content creator repository https://github.com/Mayotopia04/goit-react-hw-02-phonebook
  • goit-react-hw-02-phonebook

    React homework template

    Цей проект був створений за допомогою Create React App. Для знайомства і налаштування додаткових можливостей звернися до документації.

    Створення репозиторію за шаблоном

    Використовуй цей репозиторій організації GoIT як шаблон для створення репозиторію свого проєкта. Для цього натисни на кнопку «Use this template» і вибери опцію «Create a new repository», як показано на зображенні.

    Creating repo from a template step 1

    На наступному кроці відкриється сторінка створення нового репозиторію. Заповни поле його імені, переконайся що репозиторій публічний, після чого натисни кнопку «Create repository from template».

    Creating repo from a template step 2

    Після того як репозиторій буде створено, необхідно перейти в налаштування створеного репозиторію на вкладку Settings > Actions > General як показано на зображенні.

    Settings GitHub Actions permissions step 1

    Проскроливши сторінку до самого кінця, у секції «Workflow permissions» вибери опцію «Read and write permissions» і постав галочку в чекбоксі. Це необхідно для автоматизації процесу деплою проєкту.

    Settings GitHub Actions permissions step 2

    Тепер у тебе є особистий репозиторій проекту, зі структурою файлів і папок репозиторію-шаблону. Далі працюй із ним як із будь-яким іншим особистим репозиторієм, клонуй його собі на комп’ютер, пиши код, роби комміти і відправляй їх на GitHub.

    Підготовка до роботи

    1. Переконайся що на комп’ютері встановлено LTS-версія Node.js. Завантаж і встанови її якщо необхідно.
    2. Встанови базові залежності проєкту командою npm install.
    3. Запусти режим розробки, виконавши команду npm start.
    4. Перейди в браузері за адресою http://localhost:3000. Ця сторінка буде автоматично перезавантажуватися після збереження змін у файлах проєкту.

    Деплой

    Продакшн версія проєкту буде автоматично проходити лінтинг, збиратися і деплоїтися на GitHub Pages, у гілку gh-pages, щоразу, коли оновлюється гілка main. Наприклад, після прямого пушу або прийнятого пул-реквесту. Для цього необхідно у файлі package.json відредагувати поле homepage, замінивши your_username і your_repo_name на свої, і відправити зміни на GitHub.

    "homepage": "https://your_username.github.io/your_repo_name/"

    Далі необхідно зайти в налаштування GitHub-репозиторію (Settings > Pages) і виставити роздачу продакшн-версії файлів із папки /root гілки gh-pages, якщо це не було зроблено автоматично.

    GitHub Pages settings

    Статус деплоя

    Статус деплою крайнього коміту відображається іконкою біля його ідентифікатора.

    • Жовтий колір – виконується збірка і деплой проєкту.
    • Зелений колір – деплой завершився успішно.
    • Червоний колір – під час лінтингу, сборки або деплою сталася помилка.

    Детальнішу інформацію про статус можна подивитися, клікнувши на іконку, і у вікні, що випадає, перейти за посиланням Details.

    Deployment status

    Жива сторінка

    Через якийсь час, зазвичай кілька хвилин, живу сторінку можна буде подивитися за адресою, вказаною у відредагованій властивості homepage. Наприклад, ось посилання на живу версію для цього репозиторію https://goitacademy.github.io/react-homework-template.

    Якщо відкривається порожня сторінка, переконайся, що у вкладці Console немає помилок пов’язаних із неправильними шляхами до CSS і JS файлів проєкту (404). Швидше за все у тебе неправильне значення властивості homepage у файлі package.json.

    Маршрутизація

    Якщо додаток використовує бібліотеку react-router-dom для маршрутизації, необхідно додатково налаштувати компонент <BrowserRouter>, передавши у пропе basename точну назву твого репозиторію. Слеш на початку рядка обов’язковий.

    <BrowserRouter basename="/your_repo_name">
      <App />
    </BrowserRouter>

    Як це працює

    How it works

    1. Після кожного пушу в гілку main GitHub-репозиторія, запускається спеціальний скрипт (GitHub Action) з файла .github/workflows/deploy.yml.
    2. Усі файли репозиторію копіюються на сервер, де проект ініціалізується і проходить лінтинг і збірку перед деплоєм.
    3. Якщо всі кроки пройшли успішно, зібрана продакшн-версія файлів проєкту відправляється в гілку gh-pages. В іншому випадку, в лозі виконання скрипта буде вказано в чому проблема.
    Visit original content creator repository https://github.com/Mayotopia04/goit-react-hw-02-phonebook
  • Xbox-GDK-Samples

    Xbox-GDK-Samples

    This repo contains game development samples written by the Microsoft Xbox Advanced Technology Group using the Microsoft Game Development Kit (GDK).

    Requirements

    • Visual Studio 2019 (16.9 update or later) or Visual Studio 2022
    • Microsoft Game Development Kit (GDK)
    • -or- Microsoft Game Development Kit with Xbox Extensions (GDKX)

    Privacy Statement

    When compiling and running a sample, the file name of the sample executable will be sent to Microsoft to help track sample usage. To opt-out of this data collection, you can remove the block of code in Main.cpp labeled Sample Usage Telemetry.

    For more information about Microsoft’s privacy policies in general, see the Microsoft Privacy Statement.

    Code of Conduct

    This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

    Trademarks

    This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

    Other Samples

    For more ATG samples, see DirectML Samples, PlayFab-Samples, Xbox-ATG-Samples, and Xbox-LIVE-Samples.

    Samples list by category

    Samples List

    Visit original content creator repository
    https://github.com/microsoft/Xbox-GDK-Samples

  • gleam-nix

    Gleam on Nix

    This repo provides packages and development shells for
    working with Gleam projects using Nix.

    Usage

    # running `gleam --version`
    $ nix run github:vic/gleam-nix -- --version
    gleam 1.9.0
    
    # you can also override to use any gleam revision (commit,branch,release) and any rust version (prefer stable releases)
    $ nix run github:vic/gleam-nix --override-input gleam github:gleam-lang/gleam/v1.9.1 --override-input rust-manifest file+https://static.rust-lang.org/dist/channel-rust-1.85.0.toml -- --version
    gleam 1.9.1
    

    For previous versions see Historic Builds

    Hack with Gleam

    If you are creating a new awesome project with Gleam,
    this flake can provide you with a development environment
    containing gleam and two of its run-times: erlang and nodejs.

    $ nix run github:vic/gleam-nix -- new my-new-project
    $ cd my-new-project
    $ nix develop github:vic/gleam-nix -c $SHELL -l
    

    If you are using direnv, create an .envrc file with
    the following content:

    # .envrc
    use flake github:vic/gleam-nix

    Hack on Gleam

    If you are willing to contribute to Gleam development,
    this flake can provide you an entire development environment
    ready for you to focus only on making Gleam awesome.

    $ git clone https://github.com/gleam-lang/gleam
    $ cd gleam
    $ nix develop github:vic/gleam-nix#hack-on-gleam --override-input gleam "path:$PWD" -c $SHELL -l

    If you are using direnv, create an .envrc file with
    the following content:

    # .envrc
    use flake github:vic/gleam-nix#hack-on-gleam --override-input gleam "path:$PWD"

    Hack on this repo

    $ nix develop .#hack-on-gleam-nix -c $SHELL -l

    If you are using direnv this repo already contains an .envrc you can load.

    Contributing

    Yes, please :).

    See hack-on-gleam-nix

    Try not to change gleam pinned release unless it no longer builds with
    the current Rust toolchain. In that case, update the rust-manifest input
    and the gleam pinned release. And please update Historic Builds with the range of known versions able to build.

    FAQ

    • How is this different from the gleam package provided by nixpkgs.

      This flake existed before we had an official gleam package on nixpkgs.
      And most people would indeed only use that package.

      However, for gleam hackers, this flake would be better suited since
      it provides a development shell with dependencies based on Gleam’s source.

      Also people trying to use a more recent or experimental version of Gleam
      will benefit from this flake.

    • I’m getting a option 'allow-import-from-derivation' is disabled error.

      Old versions of this repo bundled a Cargo.nix file containing all of Gleam’s
      dependencies in order for nix to know how to fetch them and how to build the
      Gleam cargo workspace.

      However, one inconvenience of this was that the Cargo.nix file was tied to
      a particular Gleam revision, and since Gleam is improving quite rapidly, it
      was not uncommon to find the Cargo.nix file on this repo being outdated with
      respect to Gleam’s source code.

      People had to regularly re-create the Cargo.nix file with cargo2nix.

      Now, instead of using cargo2nix, we use crate2nix which allows us to generate
      the Cargo.nix file as part of the build. Thus not requiring we to bundle it
      on this repo, and prevent it from getting outdated. One advantage is that using
      --override-input gleam <some-gleam-url> will automatically generate Cargo.nix
      for that particular gleam revision.

      This repo will only need to be updated when we have to bump the rust toolchain
      as expected by Gleam.

      On the other side, by not bundling a Cargo.nix, building with crate2nix
      requires the allow-import-from-derivation nix option to be enabled.

      This flake enables this option as part of flake.nix and will
      be activated if you are listed as trusted-user in your nix.conf or
      provide --accept-flake-config explicitly.

    Visit original content creator repository
    https://github.com/vic/gleam-nix

  • chapullmarket

    #Exchange-Website-Django

    This is the documentation for the new website called Chapull Market, which was created on spring term of
    2014 [Bilgi University Computer Science Web Project]

    This website is designed on purpose to help people recycle their items through a web site that users. Recycling in this project context means exchange of items. Users have to register the website in order to see information on the web site and recycle. There is a table which shows all items are available to recycle on home page. Users see information about any items such as photograph, model, state, status etc. then users should press more button or click the item’s photo which redirects the users to item detail page. Users also create their own items for recycling the other users items. Each item of users are shown on their profile page. Users can give offer to all other users’ items with recycling own items. Each offers of items are shown on profile page and users can accept or reject the offers of for each own items. The following three sections discuss the design goals, maintaining the site, examples of the pages and functions of the codes.

    When designing the new website, here are the goals we had in mind:

    A. Provide a user page with info for registered people

    • Include all items that are available for recycling.
    • Include search area that name of searching item to be recycled.
    • Include login and register button.
    • Provide “profile” link that users can see their all own items.
    • Provide “add item” link that user to direct create an item.
    • Include logout button.

    B. Visual design

    • Provide a uniform look­and­feel for all pages on the site.
    • Use colors compatible with the UMD logo (gray, red, white).
    • Don’t use frames.
    • Make the pages usable even on small (800 pixel width) screens.
    • Try to make the page layout work for multiple web browsers and multiple platforms.

    C. Maintenance

    • Try to clean up the directory structure for the site.
    • Use modular structure for page elements, to facilitate updating of the pages.
    • Try to make it easy to edit the pages with text editor.

    Our main tool for building the new site has been Django.

    Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Developed in 2003 by a fast moving online news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high performing, elegant Web applications quickly. Django is an Open Source web framework that enables you to build clean and feature rich web applications with minimal time and effort.

    Django promotes the use of human readable urls.

    Django offers the flexibility to customize pieces of the web site to suit the needs of the project at hand instead of relying on pre-built applications. Using Django, we can customize that widget to display what we want, how we want.

    Because of the way that Django is developed and installed, you have a greater level of security when you compare it to a website that was developed with PHP for example. This is because the source code, excluding the html and css files, for your web site are not directly exposed to the Internet and your viewers online. In most cases the web pages are dynamically generated and then sent to your browser using templates.

    The templates that we develop are for creating a look and feel specific to your website. We are not just filling in information in a template that we downloaded off of another site. Therefore you are guaranteed that the site we develop for you will look unique. This is one of the big features of Django.

    Using this template structure makes it much easier for us to add additional pages as well as make site wide, visual or code changes. The template structure also ensures that your website will have a consistent look and feel throughout the entire site.

    • add_item(request):
      To create an new item.
      It requires login.
    • listing (request):
      Shows all available item with pagination.
      It requires login.
    • item_detail(request, event_id):
      Shows details of selected item.
      It requires login.
    • search(request):
      To search all existing items with name, brand or description.
      It requires login.
    • aboutus(request):
      Shows developers’ name.
      It requires login.
    • exit(request):
      To logout.
      It requires login.

    Visit original content creator repository
    https://github.com/buraksahin/chapullmarket

  • chapullmarket

    #Exchange-Website-Django

    This is the documentation for the new website called Chapull Market, which was created on spring term of
    2014 [Bilgi University Computer Science Web Project]

    This website is designed on purpose to help people recycle their items through a web site that users. Recycling in this project context means exchange of items. Users have to register the website in order to see information on the web site and recycle. There is a table which shows all items are available to recycle on home page. Users see information about any items such as photograph, model, state, status etc. then users should press more button or click the item’s photo which redirects the users to item detail page. Users also create their own items for recycling the other users items. Each item of users are shown on their profile page. Users can give offer to all other users’ items with recycling own items. Each offers of items are shown on profile page and users can accept or reject the offers of for each own items. The following three sections discuss the design goals, maintaining the site, examples of the pages and functions of the codes.

    When designing the new website, here are the goals we had in mind:

    A. Provide a user page with info for registered people

    • Include all items that are available for recycling.
    • Include search area that name of searching item to be recycled.
    • Include login and register button.
    • Provide “profile” link that users can see their all own items.
    • Provide “add item” link that user to direct create an item.
    • Include logout button.

    B. Visual design

    • Provide a uniform look­and­feel for all pages on the site.
    • Use colors compatible with the UMD logo (gray, red, white).
    • Don’t use frames.
    • Make the pages usable even on small (800 pixel width) screens.
    • Try to make the page layout work for multiple web browsers and multiple platforms.

    C. Maintenance

    • Try to clean up the directory structure for the site.
    • Use modular structure for page elements, to facilitate updating of the pages.
    • Try to make it easy to edit the pages with text editor.

    Our main tool for building the new site has been Django.

    Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Developed in 2003 by a fast moving online news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high performing, elegant Web applications quickly. Django is an Open Source web framework that enables you to build clean and feature rich web applications with minimal time and effort.

    Django promotes the use of human readable urls.

    Django offers the flexibility to customize pieces of the web site to suit the needs of the project at hand instead of relying on pre-built applications. Using Django, we can customize that widget to display what we want, how we want.

    Because of the way that Django is developed and installed, you have a greater level of security when you compare it to a website that was developed with PHP for example. This is because the source code, excluding the html and css files, for your web site are not directly exposed to the Internet and your viewers online. In most cases the web pages are dynamically generated and then sent to your browser using templates.

    The templates that we develop are for creating a look and feel specific to your website. We are not just filling in information in a template that we downloaded off of another site. Therefore you are guaranteed that the site we develop for you will look unique. This is one of the big features of Django.

    Using this template structure makes it much easier for us to add additional pages as well as make site wide, visual or code changes. The template structure also ensures that your website will have a consistent look and feel throughout the entire site.

    • add_item(request):
      To create an new item.
      It requires login.
    • listing (request):
      Shows all available item with pagination.
      It requires login.
    • item_detail(request, event_id):
      Shows details of selected item.
      It requires login.
    • search(request):
      To search all existing items with name, brand or description.
      It requires login.
    • aboutus(request):
      Shows developers’ name.
      It requires login.
    • exit(request):
      To logout.
      It requires login.

    Visit original content creator repository
    https://github.com/buraksahin/chapullmarket

  • Dotnet8-Angular17-JWT-Authentication-Authorization

    Angular 17 and .Net 8 Jwt Authentication Application

    This is an Angular 17 standalone application that demonstrates user authentication, role-based access control, and token refresh using CanActivateFn for guards and HttpInterceptorFn for interceptors.

    Features

    • User login and registration
    • Auth guard for protecting routes
    • Role guard for role-based access control
    • Refresh token mechanism to maintain user sessions
    • Standalone Angular configuration without app.module.ts

    Prerequisites

    • Node.js (v14 or higher recommended)
    • Angular CLI (v17 or higher)

    Getting Started

    Installation

    1. Clone the repository:

      git clone https://github.com/onurtpl/Dotnet8-Angular17-JWT-Authentication-Authorization.git
      cd Dotnet8-Angular17-JWT-Authentication-Authorization/frontend
      npm install
    2. Run backend:

      cd Dotnet8-Angular17-JWT-Authentication-Authorization/backend/API
      dotnet watch run
    1. Run frontend:

      cd Dotnet8-Angular17-JWT-Authentication-Authorization/frontend
      ng serve -o

    Project Structure

    Backend

    |—backend/
    |—|–API/
    |—|—|—Configurations/
    |—|—|—|—APIConfigurations.cs
    |—|—|—|—ApplicationConfigurations.cs
    |—|—|—|—InfrastructureConfigurations.cs
    |—|—|—|—RepositoryConfigurations.cs
    |—|—|–─-Controllers/
    |—|—|—|—Abstractions/
    |—|—|—|—|—ApiController.cs
    |—|—|—|—AuthController.cs
    |—|—|—|—RoleController.cs
    |—|—|—|—UserController.cs
    |—|—|—Middlewares/
    |—|—|—|—ExceptionMiddleware.cs
    |—|—|—Models/
    |—|—|—|—ErrorResultModel.cs
    |—|—|—|—ErrorStatusCodeModel.cs
    |—|—|—|—ValidationErrorDetailsModel.cs
    |—|—|—Program.cs
    |—|—|—API.csproj
    |—|—|—appsettings.json
    |—|—|—appsettings.Development.json
    |—|—Application/
    |—|—|—Behaviors/
    |—|—|—|—CustomValidationBehavior.cs
    |—|—|—Contracts/
    |—|—|—|—IdentityContracts/
    |—|—|—|—|—IIdentityRepository.cs
    |—|—|—|—MailContracts/
    |—|—|—|—|—IMailRepository.cs
    |—|—|—Dtos/
    |—|—|—|—PaginationDtos/
    |—|—|—|—|—PaginationRequestDto.cs
    |—|—|—|—|—PaginationResponseDto.cs
    |—|—|—|—AuthResponseDto.cs
    |—|—|—Features/
    |—|—|—|—Application/
    |—|—|—|—Identity/
    |—|—|—|—|—Commands/
    |—|—|—|—|—|—AssignRole/
    |—|—|—|—|—|—|—AssignRoleCommand.cs
    |—|—|—|—|—|—|—AssignRoleCommandHandler.cs
    |—|—|—|—|—|—|—AssignRoleCommandValidator.cs
    |—|—|—|—|—|—CreateRole/
    |—|—|—|—|—|—|—CreateRoleCommand.cs
    |—|—|—|—|—|—|—CreateRoleCommandHandler.cs
    |—|—|—|—|—|—|—CreateRoleCommandValidator.cs
    |—|—|—|—|—|—ForgotPassword/
    |—|—|—|—|—|—|—ForgotPasswordCommand.cs
    |—|—|—|—|—|—|—ForgotPasswordCommandHandler.cs
    |—|—|—|—|—|—|—ForgotPasswordCommandValidator.cs
    |—|—|—|—|—|—GetUsers/
    |—|—|—|—|—|—|—GetUsersCommand.cs
    |—|—|—|—|—|—|—GetUsersCommandHandler.cs
    |—|—|—|—|—|—|—GetUsersCommandResult.cs
    |—|—|—|—|—|—Login/
    |—|—|—|—|—|—|—LoginCommand.cs
    |—|—|—|—|—|—|—LoginCommandHandler.cs
    |—|—|—|—|—|—|—LoginCommandValidator.cs
    |—|—|—|—|—|—RefreshToken/
    |—|—|—|—|—|—|—RefreshTokenCommand.cs
    |—|—|—|—|—|—|—RefreshTokenCommandHandler.cs
    |—|—|—|—|—|—|—RefreshTokenCommandValidator.cs
    |—|—|—|—|—|—Register/
    |—|—|—|—|—|—|—RegisterCommand.cs
    |—|—|—|—|—|—|—RegisterCommandHandler.cs
    |—|—|—|—|—|—|—RegisterCommandValidator.cs
    |—|—|—|—|—|—ResetPassword/
    |—|—|—|—|—|—|—ResetPasswordCommand.cs
    |—|—|—|—|—|—|—ResetPasswordCommandHandler.cs
    |—|—|—|—|—|—|—ResetPasswordCommandValidator.cs
    |—|—|—|—|—Queries/
    |—|—|—|—|—|—GetRoles/
    |—|—|—|—|—|—|—GetRolesQuery.cs
    |—|—|—|—|—|—|—GetRolesQueryHandler.cs
    |—|—|—|—|—|—|—GetRolesQueryResult.cs
    |—|—|—|—Application.csproj
    |—|—|—|—ApplicationAssembly.cs
    |—|—Domain/
    |—|—|—Entities/
    |—|—|—|—Abstractions/
    |—|—|—|—|—BaseEntity.cs
    |—|—|—|—Errors/
    |—|—|—|—|—ErrorLog.cs
    |—|—|—|—IdentityEntities/
    |—|—|—|—|—ApplicationRole.cs
    |—|—|—|—|—ApplicationUser.cs
    |—|—|—Domain.csproj
    |—|—Infrastructure/
    |—|—|—Configurations/
    |—|—|—|—ApplicationRoleConfiguration.cs
    |—|—|—|—ApplicationUserConfiguration.cs
    |—|—|—|—ErrorLogConfiguration.cs
    |—|—|—Context/
    |—|—|—|—ApplicationDbContext.cs
    |—|—|—Implementations/
    |—|—|—|—ApplicationImplementations/
    |—|—|—|—IdentityImplementations/
    |—|—|—|—|—IdentityRepository.cs
    |—|—|—|—MailImplementations/
    |—|—|—|—|—MailRepository.cs
    |—|—|—Initializations/
    |—|—|—|—SeedUserAndRole.cs
    |—|—|—Mapping/
    |—|—|—|—MappingProfile.cs
    |—|—Infrastructure.csproj
    |—|—backend.sln

    frontend

    src/
    |—frontend/
    |—|—src/
    |—|—|—app/
    |—|—|—|—common/
    |—|—|—|—|—components/
    |—|—|—|—|—|—footer/
    |—|—|—|—|—|—|—footer.component.html
    |—|—|—|—|—|—|—footer.component.scss
    |—|—|—|—|—|—|—footer.component.ts
    |—|—|—|—|—|—image-hover-card/
    |—|—|—|—|—|—|—image-hover-card.component.html
    |—|—|—|—|—|—|—image-hover-card.component.scss
    |—|—|—|—|—|—|—image-hover-card.component.ts
    |—|—|—|—|—|—navbar/
    |—|—|—|—|—|—|—navbar.component.html
    |—|—|—|—|—|—|—navbar.component.scss
    |—|—|—|—|—|—|—navbar.component.ts
    |—|—|—|—|—|—reactive-text-input/
    |—|—|—|—|—|—|—reactive-text-input.component.htm
    l
    |—|—|—|—|—|—|—reactive-text-input.component.scs
    s
    |—|—|—|—|—|—|—reactive-text-input.component.ts
    |—|—|—|—|—directives/
    |—|—|—|—|—|—toggle-password.directive.ts
    |—|—|—|—|—guards/
    |—|—|—|—|—|—auth.guard.ts
    |—|—|—|—|—|—role.guard.ts
    |—|—|—|—|—interceptors/
    |—|—|—|—|—|—auth.interceptor.ts
    |—|—|—|—|—interfaces/
    |—|—|—|—|—|—jwt-payload.ts
    |—|—|—|—|—|—pagination-request.ts
    |—|—|—|—|—|—pagination-response.ts
    |—|—|—|—|—|—user-response.ts
    |—|—|—|—|—modules/
    |—|—|—|—|—|—app-common/
    |—|—|—|—|—|—|—app-common.module.ts
    |—|—|—|—|—|—material-form-shared/
    |—|—|—|—|—|—|—material-form-shared.module.ts
    |—|—|—|—|—services/
    |—|—|—|—|—|—generic-http.service.ts
    |—|—|—|—|—|—notification.service.ts
    |—|—|—|—layouts/
    |—|—|—|—|—admin/
    |—|—|—|—|—|—pages/
    |—|—|—|—|—|—|—user-detail/
    |—|—|—|—|—|—|—|—user-detail.component.html
    |—|—|—|—|—|—|—|—user-detail.component.scss
    |—|—|—|—|—|—|—|—user-detail.component.ts
    |—|—|—|—|—|—user-list/
    |—|—|—|—|—|—|—|—user-list.component.html
    |—|—|—|—|—|—|—|—user-list.component.scss
    |—|—|—|—|—|—|—|—user-list.component.ts
    |—|—|—|—|—|—services/
    |—|—|—|—|—|—|—admin.service.ts
    |—|—|—|—|—|—admin.component.html
    |—|—|—|—|—|—admin.component.scss
    |—|—|—|—|—|—admin.component.ts
    |—|—|—|—|—|—admin.routes.ts
    |—|—|—|—|—auth/
    |—|—|—|—|—|—interfaces/
    |—|—|—|—|—|—|—auth-response.ts
    |—|—|—|—|—|—|—forgot-password-request.ts
    |—|—|—|—|—|—|—login-request.ts
    |—|—|—|—|—|—|—refresh-token-request.ts
    |—|—|—|—|—|—|—register-request.ts
    |—|—|—|—|—|—|—reset-password-request.ts
    |—|—|—|—|—|—pages/
    |—|—|—|—|—|—|—forgot-password/
    |—|—|—|—|—|—|—|—forgot-password.component.htm
    l
    |—|—|—|—|—|—|—|—forgot-password.component.scs
    s
    |—|—|—|—|—|—|—|—forgot-password.component.ts
    |—|—|—|—|—|—|—login/
    |—|—|—|—|—|—|—|—login.component.html
    |—|—|—|—|—|—|—|—login.component.scss
    |—|—|—|—|—|—|—|—login.component.ts
    |—|—|—|—|—|—|—register/
    |—|—|—|—|—|—|—|—register.component.html
    |—|—|—|—|—|—|—|—register.component.scss
    |—|—|—|—|—|—|—|—register.component.ts
    |—|—|—|—|—|—|—reset-password/
    |—|—|—|—|—|—|—|—register.component.html
    |—|—|—|—|—|—|—|—register.component.scss
    |—|—|—|—|—|—|—|—register.component.ts
    |—|—|—|—|—|—services/
    |—|—|—|—|—|—|—auth.service.ts
    |—|—|—|—|—|—auth.component.html
    |—|—|—|—|—|—auth.component.scss
    |—|—|—|—|—|—auth.component.ts
    |—|—|—|—|—|—auth.routes.ts
    |—|—|—|—|—home/
    |—|—|—|—|—|—pages/
    |—|—|—|—|—|—|—home-detail/
    |—|—|—|—|—|—|—|—home-detail.component.html
    |—|—|—|—|—|—|—|—home-detail.component.scss
    |—|—|—|—|—|—|—home-main/
    |—|—|—|—|—|—|—|—home-main.component.html
    |—|—|—|—|—|—|—|—home-main.component.scss
    |—|—|—|—|—|—|—|—home-main.component.ts
    |—|—|—|—|—home.component.html
    |—|—|—|—|—home.component.scss
    |—|—|—|—|—home.component.ts
    |—|—|—|—|—home.routes.ts
    |—|—|—|—not-found/
    |—|—|—|—|—not-found.component.html
    |—|—|—|—|—not-found.component.scss
    |—|—|—|—app.component.html
    |—|—|—|—app.component.scss
    |—|—|—|—app.component.ts
    |—|—|—|—app.config.ts
    |—|—|—|—app.routes.ts
    |—|—assets/
    |—|—|—images/
    |—|—|—|—kodlama.png
    |—|—environments/
    |—|—|—environment.development.ts
    |—|—|—environment.prod.ts
    |—|—|—environment.ts

    Visit original content creator repository
    https://github.com/onurtpl/Dotnet8-Angular17-JWT-Authentication-Authorization