We have 30 chemical compounds with you and their details. Details Include:
- Name
- Image
- Description
A webapp for where anyone can directly look into the compounds and its details. Editing of details also possible in case someone wants to change the information.
Backend - Node.js, Express, Sequelize, MySQL.
Frontend - Angular CLI 16.0.0, HTML, CSS.
- Make a card view with all the compound names and their images as separate cards.
- Use Pagination.
- (Use Routing) On click of each card change the route to a page to display the relevant compound details.
- Make CRUD API to access/edit Compound list and details.
- Make db table to access/store the given data (data provided in csv format from easy Import).
- Clone the repository to your local machine.
- Create a MySQL database and make a table named 'compounds' with query -
CREATE TABLE compounds (id INT, compoundName TEXT, compoundDescription TEXT, imageSource TEXT, imageAttribution TEXT, dateModified DATE);
- Update the
dgconfig.js
file in/backend_node/configs
and also upload the csv file which was provided to the created table. - Navigate to the
backend_node
directory and runnpm install
to install ExpressJS and Sequelize dependencies. - Navigate to the
frontend
directory and runnpm install
to install Angular dependencies. - Start the Express server using
nodemon server.js
and Angular app using the scriptnpm start
. - The
proxy.conf.json
file in frontend directory makes the angular app make its api calls to port no. 8080 and therefore integrates the backend with frontend running on port no. 4200.
There are currently 5 API calls in this app-
- GET /api/compound: Retrieve all compounds with pagination.
- GET /api/compound/:id: Get compound by ID.
- POST /api/compound/: Add a new compound.
- PUT /api/compound/:id: Update details of a compound with a specific ID.
- DELETE /api/compound/:id: Delete a compound with a specific ID.