npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

api-mvc-shop

v1.0.0

Published

Restful API using MVC structure and NoSQL database

Downloads

8

Readme

Api MVC Shop

NodeJs Javascript MongoDB

This program is a REST API that allows clients to add products and make orders in a NoSQL database. The database is hosted in MongoDB Atlas (Cloud) on a AWS server. This API is using the express architecture. Clients can access the API with a token system by using the jsonwebtoken (JWT) npm module.

Postman program have been used for for the client part tests (routes).

Getting Started

Prerequisites

  1. First, you must create an account on the mongoDB atlas website, and then create a cluster. Once created, you can now get the connection information from your cluster by clicking the "connect" button, choose the "Connect your Application" option and copy your "Connection String Only".

  2. Installing node.js

  • Mac (homebrew):
brew install node
  • Linux (packet manager):
sudo apt-get install nodejs npm
  • Node website:
https://nodejs.org/

Installing

  1. Clone the repository project in the directory of your choice with:
git clone https://github.com/vreymond/api-mvc-shop
  1. Move to the project directory, and install all npm modules dependencies needed by the program
npm install
  1. Create a .env file in the root of the directory with the following variable:
PORT=<your api port>
DB_CONNECT="<paste you connection string only mongoDB here"
JWT_KEY="<Json Web Token secret string to generate encoded tokens>"

// DB_CONNECT is like: 
// "mongodb+srv://<username>:<password>@<cluster-name>.mongodb.net/<database-name>?       retryWrites=true&w=majority

Program launch

  • Start your cluster on mongoDB atlas

  • Configure your .env file (Api port, mongoDb string connection, and your jsonwebtoken secreft key).

  • Start the API:

npm start

API usage

All the routes have been tested using the Postman program.

1°) API index

You can access the API by using the URL http://localhost:<portAPI>/ (default port is 3000).

2°) API Login check route

TO COMPLETE

Contributors

Valentin Reymond

Api MVC shop

github.com/vreymond

License

This project is licensed under the MIT License - see the LICENSE file for details