georgeben / online-book-store

API for an online bookstore built with NestJS, MySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ONLINE BOOKSTORE

Online Bookstore ER Diagram

ER Diagram

Description

A RESTful API for a simple online bookstore.

Technologies

  • Typescript
  • NodeJS
  • NestJS
  • MySQL
  • Sequelize ORM
  • Redis
  • Docker

Features

  • RESTful API built with NestJS
  • Session authentication using Redis as session store
  • Input validation
  • Database transactions
  • Database migrations using Sequelize
  • Docker
  • Typescript support

API Documentation

Click here for the API Documentation

Getting Started

Before proceeding, make sure you have the following installed:

Follow the instructions given below to get this project up and running on your local machine.

  1. Clone this repository by running git clone git@github.com:georgeben/online-book-store.git
  2. cd online-book-store
  3. Create a file in the project's root named .env and copy the content of .env.schema and paste it into .env. Fill in the appropriate values for any missing env.
  4. Run docker-compose --env-file .env run api npm run db:init to initialize the database
  5. Run docker-compose --env-file .env up -d to start the application
  6. Access the application at localhost:3000

Scripts

# Install dependencies
$ npm install

# Start application
$ npm run start

# Start application in watch mode
$ npm run start:dev

# Initialize database
$ npm run db:init

# Run migrations
$ npm run migrate:up

# Run seeders
$ npm run db:seed

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Improvements

  • e2e tests
  • pagination

About

API for an online bookstore built with NestJS, MySQL


Languages

Language:TypeScript 75.1%Language:JavaScript 22.6%Language:Dockerfile 2.3%