A simple RESTful API built with NestJS to manage a collection of books. This project includes functionalities to retrieve all books, retrieve a specific book, add a new book, update an existing book, and delete a book.
You can use the live deployment here
- Getting Started
- Usage
- API Documentation
- Database Configuration
- Docker Deployment
- GitHub Actions CI
- Contributing
- License
- Node.js (v14 or later)
- npm
- NestJS CLI
- Your choice of SQL database (e.g., MSSQL)
-
Clone the repository:
git clone https://github.com/ohansck/beertech-lib.git
-
Install dependencies:
cd your-repo-name npm install
-
Set up your database configuration by providing environment variables in the
.env
file:DB_HOST=your_database_host DB_USERNAME=your_database_username DB_PASSWORD=your_database_password DB_DATABASE=your_database_name DB_PORT=your_database_port
-
Start the application:
npm run start:dev
-
Access the API at
http://localhost:3000/books
.
Run unit tests:
npm run test
Explore the API using Swagger documentation:
This project uses a SQL database to store book information. Ensure that you configure the database by providing the required environment variables in the .env
file.
Easily deploy the application using Docker and Docker Compose:
docker-compose up -d
Access the API at http://localhost:3000/books
.
The project includes a GitHub Actions workflow on the dev
and main
branch, automatically building and running tests on each code submission.
Feel free to open issues, submit pull requests, or provide feedback.