An open API service indexing awesome lists of open source software.

https://github.com/apsarawitharana/simple-rest-api

Whether you're a reviewer or just exploring the project, youโ€™ll find everything you need to test and understand this backend system below.
https://github.com/apsarawitharana/simple-rest-api

authentication express mysql nodejs rest-api

Last synced: 3 months ago
JSON representation

Whether you're a reviewer or just exploring the project, youโ€™ll find everything you need to test and understand this backend system below.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Simple REST API โ€“ Backend Developer Assignment

Welcome! This is a simple yet robust REST API built with **Node.js** and **Express**, developed as part of the **Backend Developer (Node.js) Internship Assignment** for **Future Code Technology**.

Whether you're a reviewer or just exploring the project, youโ€™ll find everything you need to test and understand this backend system below.

---

## ๐Ÿ“ฆ Features

๐Ÿ” **User Functionality**
- User Registration
- User Login
*(Note: Authentication is not required for this task โ€” open endpoints.)*

๐Ÿ“ฆ **Product Management (CRUD)**
Each product has the following attributes:
- `name` (String)
- `price` (Number)
- `quantity` (Number, optional)
- `description` (String, optional)

๐Ÿ—„๏ธ **Database**:
- Connected to **MySQL** using the `mysql2` driver.

---

## ๐Ÿ› ๏ธ Tech Stack

- **Node.js**
- **Express.js**
- **MySQL**
- **dotenv** (for environment configs)
- **helmet**, **cors**, **rate-limit** (for security & performance)
- **Postman** โ€“ for API testing and documentation

---

## ๐Ÿ“ซ API Testing

All API endpoints can be tested using Postman via the link below:

๐Ÿ”— **[Postman API Collection โ€“ View Online](https://documenter.getpostman.com/view/35385905/2sB2x8EBSE)**

You can test endpoints such as:

### ๐Ÿงช Product Endpoints:
- `GET /api/products` โ€“ List products (with pagination and search)
- `POST /api/products` โ€“ Create a product
- `GET /api/products/:id` โ€“ View a product by ID
- `PUT /api/products/:id` โ€“ Update a product
- `DELETE /api/products/:id` โ€“ Delete a product

### ๐Ÿ‘ค User Endpoints:
- `POST /api/auth/register` โ€“ Register a new user
- `POST /api/auth/login` โ€“ Login user *(no JWT or session โ€“ just simulated logic)*

### ๐Ÿฉบ Health Check:
- `GET /api/health` โ€“ Verify the API is up and running
---

## โš™๏ธ Getting Started Locally

To run the project on your machine:

### 1. Clone the Repository
```bash
https://github.com/ApsaraWitharana/Simple-Rest-API.git
```

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

#### This project is licensed under the [MIT License](LICENSE)

#### ยฉ 2025 All Right Reserved, Designed By [Sachini Apsara](https://github.com/ApsaraWitharana)