Skip to content

Commit abcd672

Browse files
committed
dry readme
1 parent c7bbb41 commit abcd672

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

ReadMe.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,55 @@
44
## Project Overview
55
This repository contains a **FastAPI backend** that serves a **static frontend** and provides the foundation for deploying the application on a **Google Cloud VM** using **Gunicorn** and **NGINX** for production.
66

7-
### 📁 Project Structure
7+
### Project Structure
88
```
99
back/python/serve.py # FastAPI application
1010
back/python/venv/ # Python virtual environment
1111
front/ # Frontend (HTML, CSS, JS)
1212
```
1313

14-
## 🏗 Features
15-
FastAPI backend
16-
Serves `index.html` and static files (`/static`, `/resources`, `/src`)
17-
Production-ready deployment with Gunicorn and NGINX
18-
Systemd service for automatic startup on boot
19-
Ready for HTTPS with Let's Encrypt (SSL encryption)
14+
## Features
15+
- FastAPI backend
16+
- Serves `index.html` and static files (`/static`, `/resources`, `/src`)
17+
- Production-ready deployment with Gunicorn and NGINX
18+
- Systemd service for automatic startup on boot
19+
- Ready for HTTPS with Let's Encrypt (SSL encryption)
2020

21-
## 🚀 How to Run Locally (Development)
22-
### 1️⃣ Create and activate a virtual environment:
21+
## How to Run Locally (Development)
22+
### 1. Create and activate a virtual environment:
2323
```bash
2424
cd back/python
2525
python3 -m venv venv
2626
source venv/bin/activate
2727
pip install fastapi uvicorn
2828
```
2929

30-
### 2️⃣ Run the app:
30+
### 2. Run the app:
3131
```bash
3232
uvicorn serve:app --reload --host 0.0.0.0 --port 8000
3333
```
3434

35-
### 3️⃣ Access the frontend:
35+
### 3. Access the frontend:
3636
```
3737
http://localhost:8000/
3838
```
3939

40-
## ☁️ Deployment on Google Cloud VM
41-
### 1️⃣ Install system dependencies:
40+
## Deployment on Google Cloud VM
41+
### 1. Install system dependencies:
4242
```bash
4343
sudo apt update
4444
sudo apt install python3 python3-venv python3-pip nginx certbot python3-certbot-nginx
4545
```
4646

47-
### 2️⃣ Set up virtual environment & dependencies:
47+
### 2. Set up virtual environment & dependencies:
4848
```bash
4949
cd /path/to/back/python
5050
python3 -m venv venv
5151
source venv/bin/activate
5252
pip install fastapi gunicorn uvicorn
5353
```
5454

55-
### 3️⃣ Create a systemd service:
55+
### 3. Create a systemd service:
5656
`/etc/systemd/system/fastapi.service`
5757
```ini
5858
[Unit]
@@ -69,14 +69,14 @@ Restart=always
6969
WantedBy=multi-user.target
7070
```
7171

72-
### 4️⃣ Reload and start the service:
72+
### 4. Reload and start the service:
7373
```bash
7474
sudo systemctl daemon-reload
7575
sudo systemctl start fastapi.service
7676
sudo systemctl enable fastapi.service
7777
```
7878

79-
## 🌐 NGINX Reverse Proxy Example
79+
## NGINX Reverse Proxy Example
8080
```nginx
8181
server {
8282
listen 80;
@@ -95,9 +95,9 @@ Reload NGINX:
9595
sudo systemctl reload nginx
9696
```
9797

98-
## 🔒 Enable SSL with Let's Encrypt
99-
### 1️⃣ Point your domain to your Google Cloud VM's external IP
100-
### 2️⃣ Obtain and install the SSL certificate:
98+
## Enable SSL with Let's Encrypt
99+
### 1. Point your domain to your Google Cloud VM's external IP
100+
### 2. Obtain and install the SSL certificate:
101101
```bash
102102
sudo certbot --nginx -d your-domain.com
103103
```
@@ -107,25 +107,25 @@ sudo certbot --nginx -d your-domain.com
107107
sudo certbot renew --dry-run
108108
```
109109

110-
### After this, your site will be accessible via:
110+
### After this, your site will be accessible via:
111111
```
112112
https://your-domain.com
113113
```
114114

115-
## 🔐 Security Recommendations
116-
Use `fastapiuser` with limited permissions
117-
Protect port `8000` with GCP firewall rules
118-
Enable HTTPS with Let's Encrypt
119-
Validate API inputs with Pydantic
120-
Keep system and Python dependencies updated
115+
## Security Recommendations
116+
- Use `fastapiuser` with limited permissions
117+
- Protect port `8000` with GCP firewall rules
118+
- Enable HTTPS with Let's Encrypt
119+
- Validate API inputs with Pydantic
120+
- Keep system and Python dependencies updated
121121

122-
## 🛠 Future Improvements
122+
## Future Improvements
123123
- Add more API endpoints
124124
- Add frontend framework support (React/Vue)
125125

126-
## 📄 Usage Rights
126+
## Usage Rights
127127
The code provided here is shared in the spirit of free education. Please do not use this code directly for your coursework or professional projects. Instead, let these implementations serve as inspiration to develop your own solutions.
128128

129129
If you have any questions, suggestions, or feedback, feel free to contact me.
130130

131-
© 2025 by Amir Nourinia
131+
© 2025 by Amir Nourinia

0 commit comments

Comments
 (0)