Git Product home page Git Product logo

full-stack-project-03's Introduction

Full-Stack-Project-03

DEMO: https://fs-project-03.herokuapp.com/ (HUOM! Ei graafista käyttöliittymää! Käytä Postmania tai vastaavaa palvelua. Myös reittien kirjoittaminen suoraan osoiteriville voi onnistua. // NOTE! No graphical user interface! Use Postman or similar service. Writing the routes directly to the address bar may also work.)


Kolmas projekti Laurean Full Stack kurssille. Tämän projektin ideana on API, jonka kautta käyttäjä voi lisätä, hakea, muokata ja poistaa musiikki albumeihin liittyvää dataa. Tämä data on tallennettuna MongoDB tietokannassa. API:ssa on 8 eri reittiä.

  1. /api/getall - Hakee tietokannasta kaikki dokumentit.

  2. /api/:id - Hakee tietokannasta yhden dokumentin syötetyn ID:n perusteella.

  3. /api/artist/:artist - Hakee tietokannasta kaikki dokumentit, joissa on sama artistin nimi. (Kirjainkoko herkkä! Tulee kirjoittaa täysin samalla tavalla kuin tietokannassa. Muuten dokumentteja ei löydy.)

  4. /api/album/:title - Hakee tietokannasta kaikki dokumentit, joissa on sama albumin nimi. (Kirjainkoko herkkä! Tulee kirjoittaa täysin samalla tavalla kuin tietokannassa. Muuten dokumentteja ei löydy.)

  5. /api/label/:label - Hakee tietokannasta kaikki dokumentit, joissa on sama levy-yhtiön nimi. (Kirjainkoko herkkä! Tulee kirjoittaa täysin samalla tavalla kuin tietokannassa. Muuten dokumentteja ei löydy.)

  6. /api/add - Lisää tietokantaan uuden dokumentin. Dokumentin arvot syötetään URL parametreina.

  • Esimerkki: /api/add/?title=Zero+Point&artist=Rob+Clouth&year=2020&label=Mesh&catno=MESH029&cover=https://f4.bcbits.com/img/a3010879936_10.jpg (Kansikuvalinkin laittaminen ei välttämättä toimi aina tällä tavalla. Tämä esimerkki toimii kuitenkin Postman palvelun kautta hyvin.)
  1. /api/update/:id - Päivittää yhden dokumentin annetun ID:n perusteella. Käyttäjä itse syöttää ne paramterit, jotka haluaa päivittää ja antaa niille uudet arvot.

  2. /api/delete/:id - Poistaa yhden dokumentin annetun ID:n perusteella.

Projektissa on hyödynnetty seuraavia Node.js paketteja: Express, Mongoose

Projektiin on tarkoitus vielä saada graafinen käyttöliittymä. Tämä tapahtuu seuraavassa Full Stack projektissa, jossa rakennan käyttöliittymän React kirjaston avulla. API:n toiminnallisuutta voisi vielä laajentaa, jotta tiedon hakeminen ja filteröinti olisi sujuvampaa. Esim. hakeminen artistin tai levy-yhtiön mukaan olisi hyödyllistä. Teen nämä lisäkset ehkä myöhemmin.


The third project for Laurea's Full Stack development course. The idea of the project is an API, which allows the user to add, search, edit and delete data about music albums. The data is stored on a MongoDB database. The API has 8 different routes.

  1. /api/getall - Fetches all documents from the database.

  2. /api/:id - Fetches data from a single document based on the given ID.

  3. /api/artist/:artist - Fetches all documents that have the same artist name (Case sensitive! Has to be written exactly as it is in the database. Otherwise documents are not found.)

  4. /api/album/:title - Fetches all documents that have the same album title (Case sensitive! Has to be written exactly as it is in the database. Otherwise documents are not found.)

  5. /api/label/:label - Fetches all documents that have the same label name (Case sensitive! Has to be written exactly as it is in the database. Otherwise documents are not found.)

  6. /api/add - Adds a new document to the database. The document values are provided as URL parameters.

  • Example: /api/add/?title=Zero+Point&artist=Rob+Clouth&year=2020&label=Mesh&catno=MESH029&cover=https://f4.bcbits.com/img/a3010879936_10.jpg (Adding the link to the cover artwork doesn't always work like this. The example works well when passed through Postman.)
  1. /api/update/:id - Updates a single document based on the given ID. The user inputs only the parameters they want to update and gives them new values.

  2. /api/delete/:id - Deletes a single document based on the given ID.

This project utilizes the following Node.js packages: Express, Mongoose

The goal is to eventually get a graphical user interface for the project. This is done in the next Full Stack project, where I will build a UI with React. The functionality of the API could still be expanded, so searching and filtering data would be more convenient. E.g. searching by artist or label would be useful. I might do these additions later.

full-stack-project-03's People

Contributors

olentotm avatar

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.