Skip to content

A simple REST API that allows you to create, read, update and delete talkers. Made with Node.js & Express.js.

License

Notifications You must be signed in to change notification settings

gabrielmoisesa/talkers-api

Repository files navigation

Talkers API 🗣️

The Talkers API is a simple REST API designed for managing a collection of talkers. It provides basic CRUD (Create, Read, Update, Delete) operations to interact with talker data. This API is ideal for applications that require a backend system to handle speaker profiles, interviews, or any scenario where managing talkers' information is essential.

Table of Contents
  1. How to run
  2. API Endpoints
  3. Technologies Used
  4. Development
  5. Acknowledgments
  6. License
  7. Author

How to run

To run the project, you will need to have Node.js and Docker installed on your machine.

  1. Clone the repository
git clone git@github.com:gabrielmoisesa/talkers-api.git
  1. Navigate to the project folder
cd talkers-api
  1. Start the containers
docker-compose up -d
  1. Access the container bash
docker exec -it talker_manager bash
  1. Run the application
npm start
# with nodemon
npm run dev

API Endpoints

Talker:

GET /talker - Get all talkers

GET /talker/:id - Get talker by id

GET /talker/db - Get talkers from mysql database

GET /talker?q=${name}&rate=${rate}&date=${date} - Get talkers by query params

POST /talker - Create a new talker

PUT /talker/:id - Update talker by id

PATCH /talker/rate/:id - Update talker rate by id

DELETE /talker/:id - Delete talker by id

Login:

POST /login - Login

Technologies Used

  • Node.js
  • Express.js
  • MySQL 2

Development

The development of the project was based in requirements and testing by Trybe course.

Requirements List

Requirements
  • 1. Create the GET /talker endpoint

  • 2. Create the GET /talker/:id endpoint

  • 3. Create the POST /login endpoint

  • 4. Add validations for the /login endpoint

  • 5. Create the POST /talker endpoint

  • 6. Create the PUT /talker/:id endpoint

  • 7. Create the DELETE /talker/:id endpoint

  • 8. Create the GET /talker/search?q=searchTerm endpoint

  • 9. Create the minRate=rateNumber query parameter in the GET /talker/search endpoint

  • 10. Create the query parameter date=watchedDate in the GET /talker/search endpoint

  • 11. Create the PATCH /talker/rate/:id endpoint

  • 12. Create the GET /talker/db endpoint

Testing (by Trybe)

The project was developed based on tests and have all the cases covered.

Screenshot

Tests Screenshot

Running Tests

# Access the container bash
docker exec -it talker_manager bash
# Run tests
npm test
# Run a specific test
npm test 01
# Run lint
npm run lint

Acknowledgments

  • Trybe - Configuration and testing

License

MIT

Author

About

A simple REST API that allows you to create, read, update and delete talkers. Made with Node.js & Express.js.

Topics

Resources

License

Stars

Watchers

Forks