This project built a CURD funcationality application to create, update, Read and delete of book details.
Seperate client
folder is created to handle front-end(UI) part.
Please follow following steps to run this repository.
- Features
- Prerequisites
- Getting Started
- Docker
- APIs
- Useful Tools and Resources
- Things to do in future
- MVC Project Structure.
- Frontend built in React.js with typescript.
- Backend built in Node.js with typescript.
- Database: MongoDB.
- Container: Docker.
To build and run this app locally you MUST need a few things:
To get started you must follow following steps one after another:
- Clone this repository
- Install npm into your local VSCode by
npm install
. (optional) - Create
.env
file at the root of the project. - Put the required env variables into .env file, Check below for required env variables.
- Run docker compose command. First, simply run this command in the terminal:
make up
this command run docker-compose up and build services.
Follow Docker section for more details.
# Get the latest snapshot
git clone https://github.com/rohbdn07/book-list.git
# Change into root directory
cd book-list
npm install
Create .env
file at the root of the project. Put below env variables.
# required env variables
# you can put your own USER and PASSWORD
MONGO_DB_USER= root
MONGO_DB_PASSWORD= bookstore
After finishing above steps, simply run this command in your terminal:
make up
Make sure you're at the root folder of the project in the terminal.
# build and run the docker containers
make up
it then runs docker-compose up --build and install all the dependencies required.
Next, this backend will serve at: https://localhost:5000
Next, this Front-end will serve at: https://localhost:3000
Only run this command if you want to stop and removes all services containers.
# stops and remove the docker containers
make down
You can test api(s) through Postman. See at [APIs
] section.
Builds the app for production to the dist
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The followings are api(s):
Get Book list
-
GET Request
- http://localhost:5000/api/book/all\ Get all data of book list.
Post book details
-
POST Request
- http://localhost:5000/api/book/add\
body {
title,
author,
description
}
POST book details.
- http://localhost:5000/api/book/add\
body {
Update book By ID
- UPDATE Request
- http://localhost:5000/api/book/update/:id\ UPDATE book details by its id
Delete book By ID
- UPDATE Request
- http://localhost:5000/api/book/delete/:id\ DELETE book details by its id
TypeScript
Node Js
NPM
Express Js
TypeORM
MongoDB Atlas
Docker