This project is a minimal REST API built as part of a DevOps task. It demonstrates how to create, deploy, and manage a simple backend service using Python (Flask), served with Gunicorn, and exposed publicly via an Nginx reverse proxy.
The API contains three endpoints and is deployed on a VPS with persistent uptime.
- Python (Flask)
- Gunicorn (WSGI server)
- Nginx (reverse proxy)
- Linux (Ubuntu server)
git clone https://github.com/Hacker-Dark/personal-api.git
cd personal-apipython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython app.pyApp runs on:
http://localhost:5000
Response:
{
"message": "API is running"
}Response:
{
"message": "healthy"
}Response:
{
"name": "Mordecai Amehson",
"email": "amehsonmordecai07@gmail.com",
"github": "https://github.com/Hacker-Dark"
}- Application runs on a private port (5000) using Gunicorn
- Nginx is configured as a reverse proxy to expose the API on port 80
- Service is managed using systemd to ensure it stays running automatically
http://YOUR_SERVER_IP/
(Replace with your actual server IP)
-
All endpoints return:
- HTTP Status Code: 200
- Content-Type: application/json
-
Response time is under 500ms
-
The service runs persistently without manual restarts
- Use
systemctl status personal-apito debug if API fails - Use
sudo nginx -tbefore restarting nginx to avoid config errors - If port 80 fails, check firewall:
sudo ufw allow 'Nginx Full'