π A simple REST API for managing users and books. Allows user registration, book registration linked to users, and book listing by user. Designed as a foundation for future features like book search, login, or wishlist functionality.
This project is a backend API developed as a practical exercise with Node.js and Express. Its current focus is basic user and book management, serving as the foundation for future catalog, search, or book management applications.
- π€ User registration and listing
- π Book registration linked to users
- π Book listing by user
- π§± Modular structure with Controllers, Middlewares, and Routers
- π Code ready for future authentication and feature expansion
- It is not possible to register a user with an existing email
- It is not possible to register the same book
- It is not possible to delete a non-existent account
- It is not possible to delete a non-existent book
- Backend: Node.js / Express.js
- Language: JavaScript (ES Modules)
- Other: UUID for unique ID generation
- Node.js >= 18.x
- npm
- Git
# Clone the repository
git clone [email protected]:Fransuelton/api-book.git
# Navigate to the project folder
cd api-book
# Install dependencies
npm install
# Start the server
npm run dev- Base URL:
http://localhost:3333
POST /usersRegisters a new user.
Request Body:
{
"name": "John Doe",
"email": "[email protected]"
}GET /usersReturns a list of all registered users.
POST /booksRegisters a book for an authenticated user (simulated with email header).
Headers:
email: [email protected]Request Body:
{
"name": "Book Title",
"author": "Author Name",
"company": "Publisher",
"description": "Book description",
"user_id": "user-uuid"
}GET /books/:user_idReturns all books linked to a specific user.
api-book/
βββ src/
β βββ controllers/
β βββ data/
β βββ middlewares/
β βββ routes/
β βββ app.js
β βββ server.js
βββ .gitignore
βββ package.json
βββ README.mdDuring the development of this project, I practiced key backend development concepts:
- API organization using Controllers, Middlewares, and Routers
- Best practices with Express.js
- Separation of data simulating future database integration
- First steps for building fullstack projects with Node.js
This project is licensed under the MIT License. See the LICENSE file for details.
Fransuelton Francisco
π« [email protected]
π fransuelton.dev
π github.com/Fransuelton
πΌ linkedin.com/in/fransuelton
βοΈ If you found this project useful or are learning from it, please consider leaving a star!