Skip to content

GraphQL API server built with NestJs and Typescript featuring TypeORM DB interface

License

Notifications You must be signed in to change notification settings

nwokoyepraise/memorable

Repository files navigation

Memorable

Logo

Memorable Backend Application


Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. API Endpoints
  4. UML Diagrams
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

About The Project

This project is a demo backend assessment for Memorable Memorable is linked at here

Services Available on the Backend

  • Asset Creation
  • Highly Customizable Asset Query
  • Asset Update
  • Retrieve Average Metric Data for Field

Built With

The project was built natively with the following technologies

Getting Started

To build the project locally, simply clone the github repository. Navigate to root project folder and run the following to install packages:

# Install packages
$ npm install

After packages have been installed. Proceed to run:

npm start

API Endpoint

***Base API: http://localhost:3000/graphql

Create Asset

'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' --data-binary '{"query":"mutation {\n  createAsset(\n    asset: { filename: \"file0001\", asset_type: \"image\", extension: \"png\" }\n  ) {\n    id\n    filename\n    asset_type\n    extension\n    time_added\n    score_type1\n    score_type2\n    score_type3\n  }\n}\n"}' --compressed

image

Get Asset

'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' --data-binary '{"query":"# Write your query or mutation here\nquery {\n  asset(id:\"f90ae0ee-7ca4-4668-b6da-3e48f6840720\"){\n    filename\n    score_type1\n    score_type2\n}\n}"}' --compressed

image

Update Asset Scores

'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' --data-binary '{"query":"mutation {\n  addScores(\n    id: \"ca9346f2-8a86-428f-8fac-a6dc17b08c0d\"\n    scores: { score_type1: 20, score_type2: 99, score_type3: 23 }\n  ) {\n    id\n    score_type1\n    score_type2\n    score_type3\n    filename\n    extension\n  }\n}\n"}' --compressed

image

Retrieve Average Score By Asset and Score Type

'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' --data-binary '{"query":"query {\n  getAverage(asset_type: \"image\", score_type: \"Type1\") {\n    average_score\n  }\n}\n"}' --compressed

image

UML Diagrams

DB Diagram:

memorable_asset

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

.

Support

License

This project is GNU-V3.

About

GraphQL API server built with NestJs and Typescript featuring TypeORM DB interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published