Code Monkey home page Code Monkey logo

users-crud-sample's Introduction

Users simple api with CRUD operations

Goal

The goal of this simple project is to learn how to create a simple API(Application programming interface) for users. Each user has 3 properties, name, age, and email, of course, there are 4 operations: Create, Read, Update and Delete a user (CRUD). These operations will operate upon a database, in case, MongoDb which is an incredibly powerful NoSql database.

Used Tecnologies

In this API, there are 4 main technologies: NodeJs, Express, MongoDB, and Mongoose. NodeJs is a runtime for JavaScript outside the browser, Express is a framework of NodeJs. MongoDB is one of the most famous NoSql Databases and, lastly, the mongoose is a framework that makes our interaction with MongoDb more easily with NodeJs

ES6 conventions

this API uses the last versions of javaScript and, of course, ES6 notation with import/export and so on.

Instalation

In order to install and use this API, you just need to clone the current repository, after that, you can run the command npm install or yarn install. Now you have all needed dependencies installed. Now, it's time to configure your working environment variables. First, create a file named .env and set the properties DB_URI and SERVER_PORT with your credentials. Lastly, you can run the command npm start or npm run devStart. The first choice runs the API with the standard node, and the second one runs it with nodemon.

Routes

There are 5 routes you can use in order to retrive, create, update and delete data from database.

Get all users

localhost:defined port/api/users

Get user by provided id

localhost:defined port/api/users/user id

Create new user

localhost:defined port/api/users

Update a created user

localhost:defined port/api/users/user id

Delete a created user

localhost:defined port/api/users/user id

users-crud-sample's People

Contributors

kpmge avatar

Stargazers

 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.