Giter VIP home page Giter VIP logo

crud-app's Introduction

CRUD App

This is a CRUD (Create, Read, Update, Delete) application built with Angular, Material UI, and JSON Server. The app allows users to perform basic CRUD operations on a collection of data stored in a JSON server.

Table of Contents

Overview

  • Angular: Angular is an open-source front-end web application framework by Google. It enables developers to build dynamic, single-page web apps with a component-based architecture, two-way data binding, and dependency injection.

  • Angular Material: Angular Material is a UI component library for Angular apps. Developed by Google, it follows Material Design guidelines, providing pre-built and customizable UI elements for creating modern and responsive interfaces.

  • JSON Server: JSON Server is a lightweight Node.js application that creates a mock RESTful API server. It's ideal for front-end developers to prototype and test applications before connecting to a real backend.

Angular

Step 1: Install Angular CLI

First, you need to have Node.js installed on your system. If you don't have Node.js, you can download and install it from the official website: https://nodejs.org

Once you have Node.js installed, open your terminal or command prompt and run the following command to install the Angular CLI globally:

npm install -g @angular/cli

Step 2: Check Angular version

To verify that Angular CLI was installed successfully, run the following command to check the version:

ng version

This project was generated with Angular CLI version 16.1.5.

Step 3: Create a new Angular app

Now, let's create a new Angular app using the Angular CLI. In your terminal, run the following command:

ng new ng-crud-app

The Angular CLI will prompt you to choose some options for the project. For this CRUD app, we will select the following options:

  • Would you like to add Angular routing? (y/n): Type y and press Enter to include Angular routing in your app. Routing is essential for navigation between different components.

  • Which stylesheet format would you like to use? Choose SCSS and press Enter to use SCSS (Sass) as the default styling language for your app.

The Angular CLI will now create a new project folder named ng-crud-app with the necessary files and folder structure.

Step 4: Start the app

Now that we have our Angular app set up, we can run it locally using the Angular CLI. Run Run cd ng-crud-app to navigate to the project folder and start the app with the following command:

ng serve -o

The ng serve command compiles your app and launches a development server. The -o flag opens the app in your default web browser automatically.

You should now see your Angular CRUD app running at http://localhost:4200/. The application will automatically reload if you change any of the source files.

Step 5: Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

ng g c component-name

To generate a service run the following command:

ng g s services/service-name

Step 6: Testing

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

JSON Server

Step 1: Installation

To install JSON Server globally, open your terminal or command prompt and run the following command:

npm install -g json-server

Step 2: Getting started

Start JSON Server by running the following command in your terminal:

json-server --watch db.json

This creates the db.json file in the root directory with default data, if it doesn't exist. JSON Server will now be running at http://localhost:3000/. You can access your data through various RESTful endpoints.

Step 3: RESTful endpoints

JSON Server automatically creates RESTful endpoints based on the data in your db.json file. For example:

IntelliSense

VS Code IntelliSense features are powered by a language service. A language service provides intelligent code completions based on language semantics and an analysis of your source code. If a language service knows possible completions, the IntelliSense suggestions will pop up as you type. If you continue typing characters, the list of members (variables, methods, etc.) is filtered to only include members containing your typed characters. Pressing Tab or Enter will insert the selected member.

You can trigger IntelliSense by typing Ctrl + Space.

Preview

app dialog

Future Planned Features

Below are the planned features intended for implementation in the near future:

  1. Confirm Dialog for Employee Entry Deletion: The app prioritizes data safety and user experience. To prevent accidental data deletion, a confirm dialog will be introduced when users attempt to delete an entry from the database. This additional step aims to provide a clear warning and request confirmation before any irreversible actions are taken, ensuring users have greater control over their data.

  2. Extended Search Functionality: Search functionality is vital for a seamless user experience. In upcoming releases, the app aims to enhance its search features. The extended search option will enable users to apply advanced filters, making it easier and quicker to find specific content. Users will have more precise control over their search results, whether it's by date range, category, or other custom criteria.

  3. Add CI/CD Pipeline: On Gitlab (TBD)

  4. Deployment: On Gh Pages (TBD)

Acknowledgments

Special thanks to Tarique Akhtar Ansari for creating the tutorial Angular 15 CRUD app using material UI | JSON-server | step by step on which this project is based. The tutorial provided valuable insights into web development using Angular, Material UI, and JSON Server.

Back to Top

crud-app's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.