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.
- Host: GitHub
- URL: https://github.com/apsarawitharana/simple-rest-api
- Owner: ApsaraWitharana
- License: mit
- Created: 2025-06-09T14:22:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T05:12:14.000Z (about 1 year ago)
- Last Synced: 2025-07-23T05:44:30.474Z (11 months ago)
- Topics: authentication, express, mysql, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)