Git Product home page Git Product logo

node-rest-api's Introduction

NodeJS API

Introduction

  • NodeJS API is a sample NodeJS Express API that provides a set of endpoints for users to interact with. It is built with NodeJS, ExpressJS, and MongoDB. The API provides a set of endpoints for users to interact with, including getting the hottest stocks, information about a select country, and a dog picture of the day. The API also provides user authentication and authorization features, allowing users to sign up and log in to their accounts. It can be accessed globally at this link.

Project Support Features

  • Users can signup and login to their accounts
  • Authenticated users can access and interact with all endpoints, namely getting hottest stocks, information about a select country, and a dog picture of the day.

Installation Guide

  • You need to write the following commands on the terminal screen so that you can run the project locally.
git clone https://github.com/Xeryto/node-rest-api.git
cd node-rest-api
npm install
  • After that, go to .env file and insert the API keys as well as the connection string to your MongoDB database.

Usage

  • To start the server, run
node setup/index.js
  • The application is running on localhost.
  • Connect to the API using Postman on port 3000.

API Endpoints

HTTP Verbs Endpoints Action
POST /auth/register To sign up a new user account
POST /auth/login To login an existing user account
PATCH /user/update/:username?username=:newUsername To edit the username of the user account
DELETE /user/delete/:username To delete a user account
GET /API/hottestStocksInfo To retrieve top-3 most discussed stocks on Reddit with stock info attached to each stock
GET /API/guide?country=:targetCountry&targetCurrency=:targetCurrency&money=:moneySum&currency=:ownCurrency To retrieve info about a country by its name or currency. If both currency and money query fields are provided, it also tried to translate the money sum into local currency and adds a corresponding field to response
GET /API/pictureOfDay Returns a random picture of the dog, updated every 24 hours

Technologies Used

  • NodeJS This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server. It allows for installation and managing of dependencies and communication with databases.
  • ExpressJS This is a NodeJS web application framework.
  • MongoDB This is a free open source NOSQL document database with scalability and flexibility. Data are stored in flexible JSON-like documents.
  • Mongoose ODM This makes it easy to write MongoDB validation by providing a straight-forward, schema-based solution to model to application data.

Authors

node-rest-api's People

Contributors

xeryto 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.