Coder Social home page Coder Social logo

crm-backend's Introduction

CRM-Backend

CRM Backend is built with Go. It is the server-side portion of a complete CRM application. Users are able to make HTTP requests to perform CRUD operations. With this project, I have implemented several different RESTful endpoints which allow you to perform CRUD operations.

CRM-Backend provides an API that includes functionality to read, write, update, and delete content. This application can easily be integrated with any front-end application. All requests are done through HTTP, and requests and responses are in JSON.

To test out the application you can use Postman or cURL.

Overview

The application handles the following 5 operations for customers:

  • Getting a single customer: /customers/{id}
  • Getting all customers: /customers
  • Creating a customer: /customers
  • Updating a customer: /customers/{id}
  • Deleting a customer: /customers/{id}

Install

Clone the project to a local directory:

git clone https://github.com/sonnyochoa/CRM-Backend.git

Inside the project directory run:

go run main.go

Request Data Schema

{
    "name": "new customer",
    "role": "test role",
    "email": "[email protected]",
    "phone": "5551234567",
    "contacted": true
}

DO NOT INCLUDE A USER ID. IT WILL BE AUTO GENERATED

Examples

Getting all customers: /customers GET

EXAMPLE: GET /customers

Output:

{
    "1": {
        "id": 1,
        "name": "sonny",
        "role": "admin",
        "email": "[email protected]",
        "phone": "1234567890"
    },
    "2": {
        "id": 2,
        "name": "panda",
        "role": "writer",
        "email": "[email protected]",
        "phone": "5552346789"
    },
    "3": {
        "id": 3,
        "name": "bear",
        "role": "builder",
        "email": "[email protected]",
        "phone": "3012456789",
        "contacted": true
    }
}

Getting a single customer: /customers/{id} GET

EXAMPLE: GET /customers/1

Output:

{
    "id": 1,
    "name": "sonny",
    "role": "admin",
    "email": "[email protected]",
    "phone": "1234567890"
}

Creating a customer: /customers POST

EXAMPLE: POST /customers

Request Body Input:

{
    "name": "22new customer",
    "role": "22test customer",
    "email": "[email protected]",
    "phone": "2225555555",
    "contacted": true
}

Output:

{
    "id": 200428821,
    "name": "22new customer",
    "role": "22test customer",
    "email": "[email protected]",
    "phone": "2225555555",
    "contacted": true
}

Updating a customer: /customers/{id} PUT

EXAMPLE: PUT /customers/1

Request Body Input:

{
    "name": "SONNY",
    "role": "SUPER ADMIN",
    "email": "[email protected]",
    "phone": "5555555555",
    "contacted": true
}

Output:

{
    "id": 1,
    "name": "SONNY",
    "role": "SUPER ADMIN",
    "email": "[email protected]",
    "phone": "5555555555",
    "contacted": true
}

Deleting a customer: /customers/{id} DELETE

EXAMPLE: DELETE /customers/2

Output:

{
    "1": {
        "id": 1,
        "name": "SONNY",
        "role": "SUPER ADMIN",
        "email": "[email protected]",
        "phone": "5555555555",
        "contacted": true
    },
    "3": {
        "id": 3,
        "name": "bear",
        "role": "builder",
        "email": "[email protected]",
        "phone": "5552456789",
        "contacted": true
    }
}

crm-backend's People

Contributors

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