expressapi Svelte Themes

Expressapi

Express API + Svelte front end (school project)

đŸ˜Œ CAT Express 🚄

With CatExpress you can Create, Read, Update and Delete cat breeds

Features

đŸ˜œAdd breed

  • Add a breed by clicking on the big plus button which says "Add Breed".
  • Fill out the information.
  • If you leave the image field blank, a default cat image will be used.
  • Click Submit.
  • A toast message will tell you the breed has been added.

🙀 Edit breed

  • Edit a breed by clicking on the cat breed you want to edit, in the grid.
  • Click the edit button (📝) on the top left.
  • Edit the form to your needs.
  • Click submit.
  • A toast message will tell you the breed has been updated.

😿 Delete breed

  • Delete a breed by clicking on the breed you want to delete, in the grid.
  • Click the delete button (đŸ—‘ïž) on the top left.
  • A toast message will tell you the breed has been deleted.

đŸ˜» Search breed

  • Click the search bar on the top left to find a specific cat breed.
  • Search filters out breeds based on breed names.

đŸ±â€ CatExpress data

CatExpress consists of a server side and a client side

  • The server side is built on TypeScript using Express.
  • The client side is built on Svelte using Vite.
  • By default the CatExpress server runs on localhost and port 3000

Requirements

Node.js
npm

Project

Set up

git clone https://github.com/4l3x91/expressapi.git

Server

Set up

cd server
npm install

Build and run

tsc
npm run start

Run dev (nodemon)

npm run dev

Endpoints

Method URL Description
GET /api/cats/ Retrieve all cat breeds.
GET /api/cats/id/abys Retrieve breed with id "abys".
PUT /api/cats/abys Update breed with id "abys".
POST /api/cats/ Add a new breed.
DELETE /api/cats/id/abys Delete breed with id "abys".
#

Client

Set up

cd client
npm install

Build (vite build)

npm run build

Run (vite)

npm run dev

Krav för godkÀnt

  • Projektet innehĂ„ller minst 4 st. endpoints (GET, POST, PUT & DELETE för en resurs)
  • Samtliga endpoints skall kunna nĂ„s via en REST Client fil (.rest|.http)
  • Datan som API:et hanterar sparas lokalt i serverfilen
  • API'et ska svara med 404 om datan saknas.
  • Git & GitHub har anvĂ€nts
  • Projektmappen innehĂ„ller en README.md fil
  • Uppgiften lĂ€mnas in i tid

Krav för vÀl godkÀnt

  • Alla punkter för godkĂ€nt Ă€r uppfyllda
  • All data skall vara sparad i en JSON-fil istĂ€llet för i serverfilen
  • Datan i JSON-filen skall uppdateras dĂ„ nĂ„got lĂ€ggs till, uppdateras eller tas bort
  • Ett klient-grĂ€nssnitt skall byggas för att anropa API:ets alla olika endpoints och presentera datan, redigeringsformulĂ€r skall fyllas i med befintlig information.
  • Ytterligare en GET endpoint skall lĂ€ggas till dĂ€r det gĂ„r att hĂ€mta ett specifikt objekt

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes