THis project is a simple RESTful API for managing a collection of books. It was created to showcase some of my skills as a junior backend developer and was built using Typescript, MySQL and Jest. In the development I tried to follow SOLID principles and Test-Driven Development techniques to ensure code quality and maintainability. I also applied some design patterns, such as repository and service layers to separate concerns and improve code organization.
- Express
- Typescript
- MySQL
- Jest
- Docker
- Node.js
- Docker
-
Clone the repository:
git clone https://github.com/gapesasi/api-rest-typescript.git cd api-rest-typescript
-
Install dependencies:
npm install
-
Start the docker container:
npm run docker
-
Run the migrations to setup the database table:
npm run migrate
-
Start the development server:
npm run start:dev
- GET /books: Retrieve all books.
- GET /books/:id: Retrieve a book by ID.
- POST /books: Create a new book.
- PUT /books/:id: Update a book by ID.
- DELETE /books/:id: Delete a book by ID.
To run the tests, use the following command:
npm run test