https://github.com/nisalgunawardhana/api-learning-101
Welcome to API Learning 101! This repository is your comprehensive guide to understanding and working with APIs, complete with a fully functional REST API backend and hands-on learning resources.
https://github.com/nisalgunawardhana/api-learning-101
api api-learning api-rest postman postman-api
Last synced: about 2 months ago
JSON representation
Welcome to API Learning 101! This repository is your comprehensive guide to understanding and working with APIs, complete with a fully functional REST API backend and hands-on learning resources.
- Host: GitHub
- URL: https://github.com/nisalgunawardhana/api-learning-101
- Owner: nisalgunawardhana
- Created: 2026-01-10T20:16:56.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-20T14:47:05.000Z (5 months ago)
- Last Synced: 2026-01-20T23:04:53.944Z (5 months ago)
- Topics: api, api-learning, api-rest, postman, postman-api
- Language: JavaScript
- Homepage: https://api-learning-101.vercel.app
- Size: 914 KB
- Stars: 19
- Watchers: 0
- Forks: 46
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# API Learning 101 ๐
Welcome to API Learning 101! This repository is your comprehensive guide to understanding and working with APIs, complete with a fully functional REST API backend and hands-on learning resources.

## ๐ Live Demo
**Backend API**: [api-learning.nisalgunawardhana.com](https://api-learning.nisalgunawardhana.com)
## ๐ What You'll Learn
This repository provides:
- **Complete API fundamentals** - HTTP methods, status codes, headers, REST principles
- **Working backend API** - Real API you can interact with
- **Postman collection** - Ready-to-use API tests
- **Hands-on examples** - Practical demonstrations
- **Best practices** - Industry-standard approaches
## ๐ Repository Structure
```
api-learning-101/
โโโ docs/
โ โโโ 01-what-is-api.md
โ โโโ 02-http-methods.md
โ โโโ 03-status-codes.md
โ โโโ 04-rest-principles.md
โ โโโ 05-postman-guide.md
โ โโโ screenshots/
โโโ backend/
โ โโโ api/
โ โ โโโ index.js
โ โโโ data/
โ โ โโโ users.json
โ โโโ package.json
โ โโโ README.md
โโโ postman/
โ โโโ API-Learning-101.postman_collection.json
โโโ .github/
โ โโโ ISSUE_TEMPLATE/
โ โโโ workflows/
โโโ vercel.json
```
## ๐ Quick Start
### 1. Access the Public Postman Collection
**๐ Postman Workspace**: [API Learning 101 Collection](https://www.postman.com/cloudy-water-123799/workspace/api-learning)
1. Open the public Postman workspace link above
2. Fork the collection to your workspace
3. Start testing with the live API at `https://api-learning.nisalgunawardhana.com`
### 2. (Optional) Local Testing
If you want to test locally:
```bash
# Clone the repository
git clone https://github.com/nisalgunawardhana/api-learning-101.git
cd api-learning-101
# Install dependencies
cd backend
npm install
# Run locally
npm start
```
The API will be available at `http://localhost:3000`
## ๐ฏ API Endpoints
**Base URL**: `https://api-learning.nisalgunawardhana.com`
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/api/users` | Get all users |
| GET | `/api/users/:id` | Get user by ID |
| POST | `/api/users` | Create new user |
| PUT | `/api/users/:id` | Update user |
| DELETE | `/api/users/:id` | Delete user |
| GET | `/api/reset` | Reset data to initial state |
**๐ก Note about Data Persistence:**
- The API uses **in-memory storage** (no database required!)
- Data persists during the serverless function's lifetime
- Changes are temporary and reset periodically on Vercel
- Use `GET /api/reset` to manually reload initial data
- Perfect for learning and testing without worrying about data cleanup!
## ๐ Learning Path
Follow these guides in order:
1. [What is an API?](docs/01-what-is-api.md)
2. [HTTP Methods](docs/02-http-methods.md)
3. [Status Codes](docs/03-status-codes.md)
4. [REST Principles](docs/04-rest-principles.md)
5. [Postman Guide](docs/05-postman-guide.md)
## ๐งช Complete Testing Guide
### Step 1: Access Postman Collection
1. Visit the public workspace: [API Learning 101 Collection](https://www.postman.com/cloudy-water-123799/workspace/api-learning)
2. Click **Fork Collection** to add it to your workspace
3. All requests are pre-configured with the production URL
### Step 2: Test Each Request Type
You must test all request types and capture screenshots for submission:
#### ๐ **GET Request - Fetch All Users**
1. Select `GET All Users` from the collection
2. Click **Send**
3. Verify status code: `200 OK`
4. **Take a screenshot** showing:
- Request URL
- Response status
- Response body with user data
#### ๐ **GET Request - Fetch Single User**
1. Select `GET User by ID` from the collection
2. Replace `:id` with `1` in the URL
3. Click **Send**
4. Verify status code: `200 OK`
5. **Take a screenshot**
#### โ **POST Request - Create User**
1. Select `POST Create User` from the collection
2. Go to **Body** tab (raw JSON)
3. Use this sample data:
```json
{
"name": "Your Name",
"email": "yourname@example.com",
"age": 25
}
```
4. Click **Send**
5. Verify status code: `201 Created`
6. **Take a screenshot** showing the created user with generated ID
#### โ๏ธ **PUT Request - Update User**
1. Select `PUT Update User` from the collection
2. Use the ID from your created user
3. Update the data in Body:
```json
{
"name": "Updated Name",
"email": "updated@example.com",
"age": 26
}
```
4. Click **Send**
5. Verify status code: `200 OK`
6. **Take a screenshot** showing the updated user
#### ๐๏ธ **DELETE Request - Remove User**
1. Select `DELETE User` from the collection
2. Use the ID of the user you created
3. Click **Send**
4. Verify status code: `200 OK`
5. **Take a screenshot** showing successful deletion message
### Step 3: Organize Your Screenshots
Create a folder named `screenshots-[your-github-username]` with all 5 screenshots:
```
screenshots-yourusername/
โโโ 01-get-all-users.png
โโโ 02-get-single-user.png
โโโ 03-post-create-user.png
โโโ 04-put-update-user.png
โโโ 05-delete-user.png
```
### Step 4: Submit Your Work
1. Add your screenshots to the `docs/screenshots/` folder
2. Create a Pull Request with your screenshots
3. Go to **Issues** โ **New Issue**
4. Select **๐ Submission** template
5. Fill in:
- Your name
- Email address (for badges and prize notifications)
- GitHub username
- PR number
- T-shirt size (for winners only)
6. Submit the issue
**Note**: Your submission will be automatically assigned to @nisalgunawardhana for review. Once approved, you'll receive completion badges!
### ๐ Social Media Bonus!
Increase your chances to win **Postman swags**:
1. Share your completion on Twitter/LinkedIn/Facebook
2. Tag **@NisalGunawardhana** and **@Postman**
3. Use hashtag **#APILearning101**
4. Winners will be selected randomly from all approved submissions!
## ๐ Rewards & Badges
After successful submission and review:
**Everyone receives:**
- โ
**Submission Approved Badge**
- ๐ **API Learning 101 Completion Badge**
**Random winners receive:**
- ๐ **Exclusive T-Shirt** (winners selected randomly)
- ๐ **Chance for Postman Swags** (share on social media for more chances!)
We've included a comprehensive Postman collection with pre-configured requests:
- โ
All CRUD operations
- โ
Pre-request scripts
- โ
Tests for validation
- โ
Environment variables
See the [Postman Guide](docs/05-postman-guide.md) for detailed instructions.
## ๐ป Backend Technology
- **Runtime**: Node.js
- **Framework**: Express.js
- **Storage**: JSON file (no database needed!)
- **Hosting**: Vercel
## ๐ค Contributing
We welcome contributions! Please submit your work:
1. Fork the repository
2. Create your feature branch
3. Make your changes
4. Submit a pull request
5. Create a submission issue
Your submission will be reviewed and you'll receive contributor badges!
## ๐ Submission Process
1. Complete your work and create a PR
2. Use the **Submission** issue template
3. Fill in all required details
4. Your submission will be automatically tagged and assigned for review
5. Receive your contributor badge upon approval! ๐
## ๐ Badges
Contributors receive badges based on their submissions:
- ๐ก Pending Review
- โ
Approved
- ๐ Closed/Completed
## ๐ License
MIT License - feel free to use this for learning!
## ๐จโ๐ป Maintainer
**Nisal Gunawardhana** ([@nisalgunawardhana](https://github.com/nisalgunawardhana))
---
Happy Learning! ๐