Skip to content

tmuratc/fast-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ Clans API

A simple, secure, and scalable REST API. It was developed to keep records of Clans. Built on FastAPI + PostgreSQL + GCP (Cloud Run & Cloud SQL) infrastructure.

🚀 Features

  • GET/clans: Lists all clans
  • POST/clans: Creates a new clan record
  • Swagger UI automatically integrated (/docs)
  • Publicly accessible via Cloud Run
  • Cloud SQL (PostgreSQL) database connection
  • Long data entries are blocked through middleware
  • Container build is done via GCP Artifact Registry

🏗️ Technologies Used

⚙️ Setup

1. Create the .env file

DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<db_name>

2. Build and push the Docker image

docker build -t gcr.io/<PROJECT_ID>/clans-api .
docker push gcr.io/<PROJECT_ID>/clans-api

3. Deploy to Cloud Run

gcloud run deploy clans-api \
  --image gcr.io/<PROJECT_ID>/clans-api \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated \
  --update-env-vars DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<db_name>

🌐 API Documentation

Swagger UI:

https://<YOUR_CLOUD_RUN_URL>/docs

🔐 Security & Limitations

  • Maximum length are set for type ve name fields.
  • Very long bodies are rejected by middleware.
  • Auth, rate limiting, etc. can be easily integrated in the future.

👨‍💻 Developer

Talha Murat Çamlı
LinkedIn
📍 Powered by FastAPI & GCP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published