Code Monkey home page Code Monkey logo

phonebook-api's Introduction

The Awesome ๐ŸŒŸ Phone Book API

This API is here to help you manage all your contacts in a breeze.

Note:

This API documentation is meant for educational purposes to demonstrate friendly and approachable technical writing.

Install the Needed Goodies ๐Ÿ”ฅ

Just run npm install and all the dependencies will be ready to roll! ๐Ÿš€

Set Up That Env File ๐Ÿ“

Copy .env.example to .env and personalize it with your DB info.

cp .env.example .env

Come on, I know you'll get it right!

APP_NAME=PhoneBook API
APP_SCHEMA=http
APP_HOST=localhost
APP_PORT=8000
APP_ROUTE_PREFIX=/api

DB_TYPE=mysql
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=
DB_PASSWORD=
DB_DATABASE=phonebook
DB_SYNCHRONIZE=
DB_LOGGING=true

LOGGING_OUTPUT=dev

Prepare the Database ๐Ÿ’พ

Just run npm run db:migrate and voila, your tables will be ready for some contact action! ๐Ÿ“ฆ

Build and Roll! ๐Ÿšš

Run npm run build to prep the backend ๐Ÿ’ช Then node dist/src/index.js to start the party! ๐ŸŽ‰

Test Drive This Baby ๐ŸŽ๏ธ

Check out your contacts at http://localhost/api/contacts ๐Ÿ‘€ Or try out the routes below with Insomnia, Postman or curl. ๐Ÿค“ A Postman collection with requests is included in the source code for testing the API.

Available Endpoints ๐Ÿš€

/contacts

  • GET - Get all contacts ๐Ÿ“
  • POST - Add a new contact โž•
  • GET /:id - Get contact by ID ๐Ÿ“–
  • PUT /:id - Update my contact โœ๏ธ
  • DELETE /:id - Remove contact โŒ

Docker deployment

You can build a Docker image and run a container as follows:

docker build -t phonebookapi-image .
docker run -p 8000:8000 --name phonebook-api --env-file .env phonebookapi-image

Built With โš’๏ธ

  • Express (for some fast backends) ๐Ÿšš
  • TypeORM (ORM) ๐Ÿค–
  • MySQL (for storage) ๐Ÿ’พ
  • Node.js ( obviously!) ๐Ÿ‘€
  • TypeScript (for type safety) ๐Ÿ“ฆ

This API is ready to handle all your contact ๐ŸŒŸ needs! Let me know if you have any other questions. ๐Ÿค” Happy dialing! ๐Ÿ“ž

phonebook-api's People

Contributors

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