Skip to content

alobuuls/angular-posts-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Angular Posts CRUD

Angular TypeScript RxJS CRUD Completed

Repository GitHub Stars Last Commit


๐Ÿ“‘ Table of Contents


๐ŸŒ Live Demo

๐Ÿ”— https://alobuuls.github.io/angular-posts-crud/


๐Ÿ“– Description

Note

An Angular 16 CRUD application that consumes REST APIs and implements advanced user experience patterns, route protection, reusable architecture, state management, and reactive programming.

The project demonstrates real-world Angular development practices including CRUD operations, feature modules, route guards, LocalStorage persistence, dynamic loading states, centralized error handling, reusable services, and scalable application architecture.


โš™๏ธ System Requirements

Before running the project, make sure you have installed:

  • ๐Ÿ“ฆ Node.js: v16.14.x โ€“ v18.x (recommended: v18 LTS)
  • ๐Ÿ“ฆ npm: v8+
  • ๐Ÿ…ฐ๏ธ Angular CLI: v16.x

Recommended using nvm

nvm install 18
nvm use 18

๐Ÿ” Verify Installed Versions

Run the following commands in your terminal:

node -v
npm -v
ng version

๐Ÿš€ Project Installation

1๏ธโƒฃ Clone the repository

git clone git@github.com:alobuuls/angular-posts-crud.git

cd angular-posts-crud

2๏ธโƒฃ Install dependencies

npm install

โ–ถ๏ธ Run the Project

Start the development server:

ng serve

Then open:

http://localhost:4200

๐Ÿง  Project Architecture

The application follows a modular architecture based on Core, Shared, Feature Modules, Route Guards, and reusable services.

๐Ÿ“„ Posts Module

Responsible for:

  • Listing posts
  • Creating posts
  • Editing posts
  • Viewing post details
  • Deleting posts

๐ŸŽฎ Feature Modules

Responsible for:

  • Movies management
  • Games management
  • Devices management
  • Route organization
  • Child routes configuration

๐Ÿ›ก๏ธ Pending Changes Guard

Responsible for:

  • Preventing accidental navigation
  • Detecting unsaved form changes
  • Displaying confirmation dialogs
  • Protecting user-entered data

โš ๏ธ Error Handler Service

Responsible for:

  • Centralized error handling
  • API error mapping
  • State management
  • User feedback

๐Ÿ”” Alerts Service

Responsible for:

  • Confirmation dialogs
  • Success notifications
  • Error notifications
  • User interaction feedback

๐Ÿงฉ Shared & Core Modules

Responsible for:

  • Reusable functionality
  • Shared components
  • Application-wide services
  • Modular organization

โœจ Features

CRUD Operations

  • ๐Ÿ“„ List records
  • ๐Ÿ” View details by ID
  • โž• Create records
  • โœ๏ธ Edit records
  • ๐Ÿ—‘๏ธ Delete records

User Experience

  • ๐Ÿ’พ Auto-save form progress in LocalStorage
  • ๐Ÿ›ก๏ธ Navigation protection for unsaved changes
  • โš ๏ธ Confirmation dialogs before deleting data
  • ๐Ÿšซ Prevent duplicate form submissions
  • ๐Ÿ”„ Inline loading indicators inside buttons
  • ๐Ÿ“ข Friendly feedback messages

Smart Forms

  • ๐Ÿ’พ Form persistence after page refresh
  • ๐Ÿ” Change detection on edit forms
  • โšก Skip unnecessary update requests
  • ๐Ÿ“ Validation before submission

Loading States

Dynamic loading messages such as:

Loading...
Getting data...
We are about to finish this...
Almost there...
Just a second more...

State Management

  • โณ Loading State
  • โœ… Success State
  • ๐Ÿ“ญ Empty State
  • โŒ Error State

Routing

  • ๐Ÿ›ก๏ธ Route Guards
  • ๐Ÿงญ Child Routes
  • ๐Ÿšซ Custom 404 Page
  • ๐Ÿ“ฆ Feature Module Routing

๐Ÿ›  Technologies Used

Technology Purpose
Angular 16 Front-End Framework
TypeScript Application Logic
RxJS Reactive Programming
Angular Router Navigation
Route Guards Route Protection
LocalStorage API Form Persistence
Reactive Forms Form Management
Feature Modules Modular Architecture
Services Business Logic
REST APIs Data Source

๐Ÿ“ Project Structure

angular-posts-crud/

โ”œโ”€โ”€ src/app/
โ”‚
โ”œโ”€โ”€ core/
โ”‚   โ””โ”€โ”€ menu/
โ”‚
โ”œโ”€โ”€ shared/
โ”‚
โ”œโ”€โ”€ guards/
โ”‚   โ””โ”€โ”€ pending-changes-form.guard.ts
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ posts.service.ts
โ”‚   โ”œโ”€โ”€ alerts.service.ts
โ”‚   โ””โ”€โ”€ errHandler.service.ts
โ”‚
โ”œโ”€โ”€ interfaces/
โ”‚
โ”œโ”€โ”€ helpers/
โ”‚
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ posts/
โ”‚   โ”œโ”€โ”€ movies/
โ”‚   โ”œโ”€โ”€ games/
โ”‚   โ”œโ”€โ”€ devices/
โ”‚   โ””โ”€โ”€ 404/
โ”‚
โ”œโ”€โ”€ app.routes.ts
โ”œโ”€โ”€ app.routing.module.ts
โ””โ”€โ”€ app.module.ts

๐Ÿ”ฅ Best Practices Implemented

  • Feature Module Architecture
  • Core Module Pattern
  • Shared Module Pattern
  • Route Guards
  • Reactive Forms
  • Child Routing
  • Separation of Concerns
  • Centralized Error Handling
  • Reusable Services
  • Strong Typing with TypeScript
  • LocalStorage Persistence
  • Smart Form Validation
  • UX-Oriented Design
  • State Management Patterns
  • Scalable Angular Structure

๐ŸŽฏ Project Goal

Practice and strengthen advanced Angular concepts through the implementation of a real-world CRUD application.

Key concepts covered:

  • CRUD Operations
  • REST API Consumption
  • Reactive Programming with RxJS
  • Route Guards
  • Child Routes
  • Reactive Forms
  • LocalStorage Persistence
  • Error Handling
  • Loading States
  • Feature Modules
  • Core & Shared Modules
  • Dependency Injection
  • TypeScript Best Practices
  • Front-End Architecture

๐Ÿ“„ License

This project is intended for educational and portfolio purposes.

Created by Alondra Francisco.

About

Angular 16 CRUD application that demonstrates scalable architecture, reactive forms, route guards, global error handling, loading states with RxJS, and complete REST API integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors