Skip to content

amanda-natallie/devices-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Devices Manager - NinjaOne Challenge

This project is a challenge for the NinjaOne selection process. The goal is to create a simple device manager application using React and TypeScript.

Features

  • Responsive design
  • List devices
  • Add/Update/Delete devices
  • Filter devices by multiple system names
  • Sort devices by name, system name, ascending and descending
  • Search devices by name
  • Reset filters

Requirements

  • Node.js 18.x or later
  • PNPM 8.x or later

Documentation

The detailed documentation for this project is available in the Notion.so platform.

Live Demo

You can access the live demo of this project here.

Screenshots

The application is responsive and works on desktop, tablet, and mobile devices.

  • Desktop Version:

Desktop

  • Tablet and Mobile Versions:

Tablet Mobile

Getting Started

  1. Clone the repository
  2. Install the dependencies with pnpm install
  3. Start the development server with pnpm dev:standalone. The application will be available at http://localhost:5173

Note: This application supports mocked API using mockoon. You can import the mockoon-crud.json file to Mockoon to use the mocked API. the pnpm dev:standalone command starts the application on port 5173 and the mocked server on port 7000. The REST url is http://localhost:7000.

Important: The application uses the REACT_APP_API_URL environment variable to set the API URL. You need to create a .env file in the root of the project with the following content to set the API URL:

VITE_USER_REST_API_URL=http://localhost:7000

Restart the development server after creating the .env file.

Scripts

  • pnpm dev: Start the development server without mocked API
  • pnpm dev:standalone: Start the development server with mocked API
  • pnpm build: Build the application
  • pnpm test: Run the unit tests with Vitest and V8
  • pnpm test:watch: Run the unit tests in watch mode
  • pnpm coverage: Run the unit tests with coverage
  • pnpm test:e2e: Run the end-to-end tests with Playwright
  • pnpm test:e2e-ui: Run the end-to-end tests with Playwright in UI mode
  • pnpm lint: Run the linter with ESLint
  • pnpm format: Format the code with Prettier

Note: the pnpm dev command needs to be run after the pnpm dev:standalone:mockoon command to start the development server with the mocked API. The easiest way to run both commands is to use pnpm dev:standalone to start the development server with the mocked API in concurrent mode.

Technologies

Architecture

Styling

Forms

State Management & API REST

Testing

  • Vitest with V8 as provider for faster testing
  • Playwright for end-to-end testing, browser automation and codegen

Linting & Formatting

Folder Structure

./
|-- .github
|   |-- workflows # Github Actions
|       |-- deploy.yml # Deploy to Amplify workflow. It runs after lint and test workflows pass
|       |-- linter.yml # Linter workflow with ESLint and Prettier
|       |-- playwright.yml # Playwright workflow for end-to-end tests
|       |-- vitest.yml # Vitest workflow for unit tests coverage with V8
|-- .vscode
|   |-- settings.json # VSCode settings to enforce Prettier and ESLint
|-- public # Static files
|-- src
|   |-- assets # Images
|   |-- components # Reusable components
|      |-- containers # Components that hold other components and/or uses Shadcn-ui components
|      |-- modals # Modal components
|      |-- ui # raw UI components like buttons, inputs, etc from Shadcn-ui
|   |-- config #constants for mapping select/dropdown options
|   |-- e2e # End-to-end tests with Playwright
|   |-- hooks # Custom hooks
|   |-- pages # Application pages
|   |-- store # Redux store
|      |-- api # API REST with RTK Query
|      |-- slices # Redux slices
|   |-- types # Custom types
|   |-- utils # Utility functions