Git Product home page Git Product logo

clean-contacts-app's Introduction

Clean Contacts App

Contacts app to collect customer contacts information (with clean arch/code)

Project structure

  • server - Server application to handle http request over REST API
    • Using Express, Typescript, Jest, celebrate (Joi validation as middleware)
    • Under Clean Architecture/Code and SOLID principles
  • client - Client application to serve facing pages and user interaction.
    • Using ReactJS, Typescript, Tailwind CSS, React hooks, Axios

Running the applications

Disclaimer: presuming you have docker and docker-compose safely installed in your machine

  • Simply run:
  $ docker-compose up -d

  # it will build both `server` and `client` projects and serve those at: 
  # http://localhost:4202 (server)
  # http://localhost:4201 (client)

Application Features

  • Application Models:
      type ContactModel = {
        name: string
        email: string
        phone: string
        address: {
          country: string
          houseNumber: number
          streetName: string
          city: string
          state: string
        }
      }
  • Server application:
    • POST api/contacts - Submit and create new contact
      curl --location --request POST 'http://localhost:4202/api/contacts' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --data-raw '{
          "name": "Victor Wagner",
          "email": "[email protected]",
          "phone": "+5584123456789",
          "address": {
              "country": "BR",
              "houseNumber": 123,
              "streetName": "Street 0",
              "city": "João Pessoa",
              "state": "PB"
          }
      }'
    • GET api/contacts - Retrieve all submitted contacts
      curl --location --request GET 'http://localhost:4202/api/contacts' \
      --header 'Accept: application/json'
    • PATCH api/contacts/:contactId - Kindly update a single contact by id
      curl --location --request PATCH 'http://localhost:4202/api/contacts/ckw4z8a9i0000itvrci6jc1bq' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --data-raw '{
          "name": "Victor Ribeiro",
          "phone": "+1-902-555-0116",
          "address": {
              "country": "CA",
              "city": "Sydney",
              "state": "NS"
          }
      }'
    • DELETE api/contacts/:contactId - Smoothly delete a contact by id
      curl --location --request DELETE 'http://localhost:4202/api/contacts/ckw4cdk6k0001y2vrekjfgo3f' \
      --header 'Accept: application/json'
  • Client application:
    • /contacts-form: Outside users may post their contact info to our server
    • /admin: Internal users may manage submitted contacts

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.