https://github.com/dxtaner/bookstore-nodejsapi
book Api
https://github.com/dxtaner/bookstore-nodejsapi
api-rest books bookstore jwt-authentication nodejs user
Last synced: about 2 months ago
JSON representation
book Api
- Host: GitHub
- URL: https://github.com/dxtaner/bookstore-nodejsapi
- Owner: dxtaner
- Created: 2023-02-16T13:13:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-07-17T12:53:02.000Z (11 months ago)
- Last Synced: 2025-12-29T05:50:21.459Z (6 months ago)
- Topics: api-rest, books, bookstore, jwt-authentication, nodejs, user
- Language: JavaScript
- Homepage:
- Size: 827 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Book Node.js Project Description
================================
Getting Started
---------------
1. Clone the project:
git clone (https://github.com/dxtaner/BookStore-NodejsApi)
3. Navigate to the project directory:
cd BookStore-NodejsApi
5. Install dependencies:
npm install
7. Add the MongoDB connection URL to the `.env` file:
DB_URL=
9. Start the application:
npm start
API Routes
----------
### Users
* `GET /api/users` - Lists all users.
* `GET /api/users/:id` - Retrieves a specific user.
* `POST /api/users` - Creates a new user.
* `PUT /api/users/:id` - Updates a specific user's information.
* `DELETE /api/users/:id` - Deletes a specific user.
### Authors
* `GET /api/authors` - Lists all authors.
* `GET /api/authors/:id` - Retrieves a specific author.
* `POST /api/authors` - Creates a new author.
* `PUT /api/authors/:id` - Updates a specific author's information.
* `DELETE /api/authors/:id` - Deletes a specific author.
### Books
* `GET /api/books` - Lists all books.
* `GET /api/books/:id` - Retrieves a specific book.
* `POST /api/books` - Creates a new book.
* `PUT /api/books/:id` - Updates a specific book's information.
* `DELETE /api/books/:id` - Deletes a specific book.
Data Model
----------
### User Model
* `name` - User's name (String).
* `email` - User's email address (String).
* `age` - User's age (Number).
### Author Model
* `name` - Author's name (String).
* `birthDate` - Author's date of birth (Date).
* `nationality` - Author's nationality (String).
### Book Model
* `title` - Book title (String).
* `author` - Reference to the Author model.
* `publicationDate` - Book's publication date (Date).
* `genre` - Book's genre (String).
Additional Information
----------------------
* The project uses a MongoDB database. The connection is set via the `DB_URL` environment variable.
* Built with Express.js, using routers to handle HTTP requests.
* Separate routes are available for users, authors, and books.
* Data models and routes are located in the `/models` and `/routes` directories.
License
-------
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT). For more details, see the `LICENSE` file.