β‘ Angular Tailwind Data Portal
Angular app using TailwindCSS components & Angular Signals to display backend data
Note: to open web links in a new window use: ctrl+click on link
Data shown on a grid of Tailwind-styled cards
Angular Signals used to track the state of changing backend data so rendering can be optimised.
Any JSON data object made available on localhost:3000
can be displayed on the Angular frontend. It is easy to modify the frontend Typescript model and HTML markup to match the JSON object on the backend. I used drug product JSON data as test data - see db.json
Run npm i
to install dependencies.
This frontend requires a backend data source - see /models/pharma.data.ts
for format, on port http://localhost:3000
npm run server
to run fake backend. Navigate to http://localhost:3000/api
to see data object.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Fake databse data in db.json
used to test frontend.
'data.service.ts' function to return data array Observable with fetch status and catch errors
loadData ( ) : Observable < State < Array < IPharmaData > > | State < null > > {
return this . http . get < Array < IPharmaData > > ( `${ environment . API_URL } /api` ) . pipe (
share ( ) ,
map ( ( data ) => {
return new State < Array < IPharmaData > > (
StatusNotification . OK ,
data ,
null
) ;
} ) ,
catchError ( ( error : HttpErrorResponse ) => {
return throwError (
new State < Array < IPharmaData > > (
StatusNotification . ERROR ,
undefined ,
error
)
) ;
} )
) ;
}
Tailwind build for production CSS purge results in a very small styles bundle (about 7kB)
Status: working
To-Do: Nothing
This project is licensed under the terms of the MIT license.
Repo created by ABateman , email: gomezbateman@gmail.com