- a small variation of a todo list
- it allows you to add your favourite books
Server
- Express.js
- TypeScript
Security
- Helmet
- Express Rate Limit
Database
- MySQL
- adding a new book to the list ✔️
- editing existing ones ✔️
- deleting specific one or all at once ✔️
- you can search your book by title or by author name ✔️
- you can list your positions by title, author, page number or by status ✔️
In order to run this app you need to create config.ts and place it in config folder. File should contain following fields with your correct data, for instance:
const config = {
dbHost: 'localhost',
dbUser: 'user',
dbDatabase: 'databaseName',
dbPassword: "",
corsOrigin: 'http://localhost:3000',
}
This project uses npm as package manager
npm install --global npm
Clone the project
git clone https://github.com/RavenPl/MyLibrary-v3-BE.git
Go to the project directory
cd my-library-BE
Install dependencies
npm install
Start the server
npm start
- Add your data into config file.
- Create table in your database using this SQL:
CREATE TABLE IF NOT EXISTS `books` (
`id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`title` varchar(5633) COLLATE utf8mb4_unicode_ci NOT NULL,
`author` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`pages` int(5) NOT NULL,
`status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'not read',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
☑️ putting together JavaScript, Typescript, mysql2 into one, working application
☑️ creating and running few test using Jest
☑️ adding basic security middlewares: express-rate-limit and helmet
☑️ fixing CORS problem
The project is closed.