Skip to content

schwastek/5s-audit-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

202 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

5S Audit App

Overview

5S audits promote more efficient operations. In simple terms, 5S methodology helps keep the workplace organized and clean. This app allows you perform an audit to ensure the 5S approach is followed.

This application is still in development. See Roadmap.

Features

  • Create and browse audits
  • API: JWT authentication with refresh tokens
  • API: Paging, sorting
  • API: Security headers

Built with

Getting started

Prerequisites

Make sure you have installed the following prerequisites:

git --version
# => git version 2.34.0.windows.1
node --version
# => v20.11.1

npm --version
# => 10.2.4
dotnet --version
# => 8.0.111
dotnet ef --version
# => 9.0.0

Installation

  1. Clone the repository
git clone https://github.com/schwastek/5s-audit-app.git
  1. Install npm packages of React
cd client
npm clean-install
  1. Or install npm packages of Angular
cd client-angular
npm clean-install
  1. Generate SSL certificate for Angular local development
cd client-angular/ssl
dotnet dev-certs https --export-path ./certificate.pem --no-password --trust --format PEM

Running application

When you start ASP.NET Core web API, it won't launch React or Angular client app automatically.
Both frontend and backend must be started manually.

Run React frontend app:

cd client
npm start

Or run Angular frontend app:

cd client-angular
npm start

Run ASP.NET Core web API:

cd Api
dotnet run

In a web browser, navigate to http://localhost:3000 (React) or https://localhost:4200 (Angular).

Log in with email and password:

  • john@test.com
  • Pa$$w0rd

Swagger

Swagger UI is available at https://localhost:5000/swagger/index.html after running the application.

Swagger UI

To execute protected endpoints you need to authenticate yourself first.

Execute /api/account/login endpoint to obtain the access token.

Then click Authorize button and paste the access token in the following format: Bearer xxxxxxxx.yyyyy.zzzzz.

Swagger Authentication

Usage

Log in

Login page

Create new audit

New audit

Browse audits

Browse audits

Documentation

API

API Description
GET /api/audits Get a list of audits (paged by default)
GET /api/audits?orderBy=author asc&pageSize=5&pageNumber=1 Get a list of audits (paged and sorted)
GET /api/audits/{{id}} Get an audit by ID
POST /api/audits Create an audit
POST /api/actions Add an action to audit
PUT /api/actions/{{id}} Update an action
DELETE /api/actions/{{id}} Delete an action
GET /api/questions Get a list of questions
POST /api/account/login Log a user in
POST /api/account/refreshToken Refresh token for a logged in user
GET /api/account Get the current logged in user
POST /api/account/register Register a new user

Database

SQLite database file is created in the special "local" folder for your platform.
Use Run command below (WIN+R) to open the "local" folder on Windows: C:\Users\{Username}\AppData\Local.

%LocalAppData%

You can run Data console application to seed database:

Setup database console application

Common commands

To manage migrations you can use dotnet ef CLI tools or Package Manager Console.

# Add migration
dotnet ef migrations add MyMigration --project Data --startup-project Data

# Remove last migration
dotnet ef migrations remove --project Data --startup-project Data

# Apply migrations (specify environment)
dotnet ef database update --project Data --startup-project Data -- --environment Development

# Or apply migrations using Package Manager Console
Update-Database -Project Data -StartupProject Data -Args '--environment Development'

EF CLI options:

  • --project - where migrations are stored (DbContext project).
  • --startup-project - which project EF runs to build the model (usually the executable app).

Roadmap

  • Create audits
  • Browse audits
  • Login
  • Audit actions
  • Registration
  • Action comments
  • Image upload

License

Distributed under the MIT License. See LICENSE.txt for more information.

Acknowledgments

Resources I find helpful and would like to give credit to:

  • Dockx, K. (2019). Building a RESTful API with ASP.NET Core 3. Pluralsight. - CourseGitHub
  • Dockx, K. (2020). Implementing Advanced RESTful Concerns with ASP.NET Core 3. Pluralsight. - CourseGitHub
  • Resca, S. (2019). Hands-On RESTful Web Services with ASP.NET Core 3. Packt Publishing. - BookGitHub
  • Rippon, C. (2019). ASP.NET Core 3 and React. Packt Publishing. - BookGitHub
  • Cummings, N. (2019). Complete guide to building an app with .Net Core and React. Udemy. - CourseGitHub
  • Code Maze (2023). Ultimate ASP.NET Core Web API. - Book

About

This app allows you perform an audit to ensure the 5S approach is followed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors