Build a RESTful API for a bookstore application using Node.js, Express, and TypeScript. The API should manage books, authors, and categories. Each book has a title, author, category, publication year, and ISBN.
- Initialize a new Node.js project using npm or yarn.
- Use TypeScript for your project.
Set up an Express application with appropriate middleware. Include middleware for JSON parsing and logging.
Create routes for the following CRUD operations:
- Create a new book.
- Get a list of all books.
- Get details of a specific book.
- Update the details of a book.
- Delete a book.
- Create a new author.
- Get a list of all authors.
- Get details of a specific author.
- Update the details of an author.
- Delete an author.
- Create a new category.
- Get a list of all categories.
- Get details of a specific category.
- Update the details of a category.
- Delete a category.
- Use an in-memory array or a simple database (e.g., MongoDB or MySQL) to store books, authors, and categories.
- Implement appropriate relationships between books, authors, and categories.
- Validate the input data for creating and updating books, authors, and categories.
- Include appropriate error handling and return meaningful error messages.
Write unit tests for at least two routes using a testing framework of your choice (Jest, Mocha, etc.).
- Provide clear documentation on how to run your application and tests.
- Include a brief overview of the project structure and any important design decisions.
- Use Postman to document your endpoints
- Implement sorting and filtering options for the list of books, authors, and categories.
- Add pagination for the list endpoints.
- Include user authentication middleware.
- Fork this repository and commit your code.
- Include a README.md file with instructions on how to run the application and tests.
- Create a pull request with your completed assessment.