Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a445b7f
Delete .github/ISSUE_TEMPLATE directory
AlfreMu Jan 15, 2026
3c65030
Merge pull request #1 from AlfreMu/chore/disable-issue-templates
AlfreMu Jan 15, 2026
5405d48
Create arquitectura.md for DevOps portfolio
AlfreMu Jan 15, 2026
02fa41c
Agregamos decisiones.md
AlfreMu Jan 15, 2026
c2e990b
Add README for Kubernetes portfolio manifests
AlfreMu Jan 15, 2026
34b8a70
Create README for GitHub workflows
AlfreMu Jan 15, 2026
d6569bf
Merge pull request #7 from AlfreMu/chore/bootstrap-devops-track
AlfreMu Jan 15, 2026
2a3a6fc
Actualizamos README para portfolio DevOps
AlfreMu Jan 15, 2026
512659a
Add runbook for local Docker setup
AlfreMu Jan 15, 2026
f2bd91c
Create kind.md
AlfreMu Jan 15, 2026
e3e45a5
Create aws-k3s.md
AlfreMu Jan 15, 2026
8704e0a
Create upstream
AlfreMu Jan 15, 2026
ec8284b
Delete docs/upstream
AlfreMu Jan 15, 2026
6c235d0
Create README for FastAPI template
AlfreMu Jan 15, 2026
9f0500a
Merge pull request #8 from AlfreMu/docs/bootstrap-readme
AlfreMu Jan 15, 2026
42bb912
feat(docker): agregar docker-compose del portfolio (baseline local)
AlfreMu Jan 15, 2026
e97dc4c
Merge pull request #9 from AlfreMu/phase1/docker-compose-portfolio
AlfreMu Jan 15, 2026
eb6e39e
Update roadmap to mark Phase 1 as complete
AlfreMu Jan 15, 2026
c10d764
feat(k8s): deploy backend en kind cluster
AlfreMu Jan 16, 2026
26e036c
Add PostgreSQL deployment configuration
AlfreMu Jan 16, 2026
f071882
Add PostgreSQL secret configuration
AlfreMu Jan 16, 2026
4d630be
Add Kubernetes Service for Postgres
AlfreMu Jan 16, 2026
d79109c
Add PersistentVolumeClaim for PostgreSQL
AlfreMu Jan 16, 2026
85b018d
Add volume mount for PostgreSQL data
AlfreMu Jan 16, 2026
1b40eb8
Update PostgreSQL configuration in configmap.yaml
AlfreMu Jan 16, 2026
1d54363
Add POSTGRES_PASSWORD to backend-secret
AlfreMu Jan 16, 2026
5e6ea1e
chore(ci): mover workflows upstream fuera de .github/workflows
AlfreMu Jan 16, 2026
e5abc3f
ci: agregar workflow de build (backend y frontend)
AlfreMu Jan 16, 2026
afdee52
Merge pull request #10 from AlfreMu/phase4/ci-github-actions
AlfreMu Jan 16, 2026
5c62e74
Add CI badge to workflows README
AlfreMu Jan 16, 2026
37b19ef
Update README with CI badge and roadmap changes
AlfreMu Jan 16, 2026
77ff53d
Merge pull request #11 from AlfreMu/phase4/ci-github-actions
AlfreMu Jan 16, 2026
31673b6
Add author information to README
AlfreMu Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/privileged.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
![CI](https://github.com/AlfreMu/devops-portfolio-fastapi/actions/workflows/ci.yml/badge.svg)

# Workflows (portfolio)

Workflows del portfolio:
- ci.yml: se ejecuta en Pull Requests
- cd.yml: deploy automático al mergear a main

Se construyen de forma incremental.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]

jobs:
docker-build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
service:
- name: backend
context: ./backend
- name: frontend
context: ./frontend

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build ${{ matrix.service.name }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.service.context }}
push: false
tags: devops-portfolio/${{ matrix.service.name }}:ci
cache-from: type=gha
cache-to: type=gha,mode=max
File renamed without changes.
257 changes: 37 additions & 220 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,233 +1,50 @@
# Full Stack FastAPI Template
# DevOps Portfolio — FastAPI Template (Docker + Kubernetes + CI/CD + AWS)

<a href="https://github.com/fastapi/full-stack-fastapi-template/actions?query=workflow%3A%22Test+Docker+Compose%22" target="_blank"><img src="https://github.com/fastapi/full-stack-fastapi-template/workflows/Test%20Docker%20Compose/badge.svg" alt="Test Docker Compose"></a>
<a href="https://github.com/fastapi/full-stack-fastapi-template/actions?query=workflow%3A%22Test+Backend%22" target="_blank"><img src="https://github.com/fastapi/full-stack-fastapi-template/workflows/Test%20Backend/badge.svg" alt="Test Backend"></a>
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/full-stack-fastapi-template" target="_blank"><img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/full-stack-fastapi-template.svg" alt="Coverage"></a>
![CI](https://github.com/AlfreMu/devops-portfolio-fastapi/actions/workflows/ci.yml/badge.svg)

## Technology Stack and Features
Este repositorio es un **portfolio personal DevOps/Cloud**. El objetivo es demostrar prácticas modernas de:
- Docker
- Kubernetes (kind en local / k3s en AWS EC2 — **sin EKS**)
- CI/CD con GitHub Actions
- Deploy automático al mergear Pull Requests

- ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
- 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
- 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
- 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.
- 🚀 [React](https://react.dev) for the frontend.
- 💃 Using TypeScript, hooks, [Vite](https://vitejs.dev), and other parts of a modern frontend stack.
- 🎨 [Tailwind CSS](https://tailwindcss.com) and [shadcn/ui](https://ui.shadcn.com) for the frontend components.
- 🤖 An automatically generated frontend client.
- 🧪 [Playwright](https://playwright.dev) for End-to-End testing.
- 🦇 Dark mode support.
- 🐋 [Docker Compose](https://www.docker.com) for development and production.
- 🔒 Secure password hashing by default.
- 🔑 JWT (JSON Web Token) authentication.
- 📫 Email based password recovery.
- 📬 [Mailcatcher](https://mailcatcher.me) for local email testing during development.
- ✅ Tests with [Pytest](https://pytest.org).
- 📞 [Traefik](https://traefik.io) as a reverse proxy / load balancer.
- 🚢 Deployment instructions using Docker Compose, including how to set up a frontend Traefik proxy to handle automatic HTTPS certificates.
- 🏭 CI (continuous integration) and CD (continuous deployment) based on GitHub Actions.
> La aplicación se utiliza como base open-source. El foco principal es infraestructura, automatización y despliegue.

### Dashboard Login
## Qué vas a encontrar acá
- `docs/`: arquitectura, decisiones técnicas y guías de ejecución
- `k8s/portfolio/`: manifiestos Kubernetes creados como parte del portfolio
- `.github/workflows/`: pipelines del portfolio (CI y CD)

[![API docs](img/login.png)](https://github.com/fastapi/full-stack-fastapi-template)
## Arquitectura (resumen)
- **Local (Docker):** ejecución reproducible con Docker/Compose
- **Local (Kubernetes):** cluster kind + manifests del portfolio
- **AWS:** instancia EC2 corriendo k3s + Nginx Ingress Controller
- **CI/CD:** GitHub Actions:
- CI en Pull Requests
- CD al mergear a `main`

### Dashboard - Admin
## Cómo ejecutarlo
- Local con Docker: ver `docs/runbooks/local-docker.md`
- Kubernetes local (kind): ver `docs/runbooks/kind.md`
- AWS (EC2 + k3s): ver `docs/runbooks/aws-k3s.md`

[![API docs](img/dashboard.png)](https://github.com/fastapi/full-stack-fastapi-template)
## Skills DevOps demostradas
- Containerización y buenas prácticas Docker
- Deploy y troubleshooting en Kubernetes
- Automatización CI/CD con GitHub Actions
- Deploy automático a infraestructura en AWS (sin EKS)
- Documentación técnica orientada a entrevistas

### Dashboard - Items
## Roadmap
- [X] Phase 1: Docker baseline
- [X] Phase 2: Kubernetes local (kind)
- [ ] Phase 3: CI/CD
- [ ] Phase 4: AWS EC2 + k3s deploy

[![API docs](img/dashboard-items.png)](https://github.com/fastapi/full-stack-fastapi-template)
---

### Dashboard - Dark Mode
<!-- trigger ci -->

[![API docs](img/dashboard-dark.png)](https://github.com/fastapi/full-stack-fastapi-template)
📌 Autor: AlfreMu

### Interactive API Documentation

[![API docs](img/docs.png)](https://github.com/fastapi/full-stack-fastapi-template)

## How To Use It

You can **just fork or clone** this repository and use it as is.

✨ It just works. ✨

### How to Use a Private Repository

If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.

But you can do the following:

- Create a new GitHub repo, for example `my-full-stack`.
- Clone this repository manually, set the name with the name of the project you want to use, for example `my-full-stack`:

```bash
git clone [email protected]:fastapi/full-stack-fastapi-template.git my-full-stack
```

- Enter into the new directory:

```bash
cd my-full-stack
```

- Set the new origin to your new repository, copy it from the GitHub interface, for example:

```bash
git remote set-url origin [email protected]:octocat/my-full-stack.git
```

- Add this repo as another "remote" to allow you to get updates later:

```bash
git remote add upstream [email protected]:fastapi/full-stack-fastapi-template.git
```

- Push the code to your new repository:

```bash
git push -u origin master
```

### Update From the Original Template

After cloning the repository, and after doing changes, you might want to get the latest changes from this original template.

- Make sure you added the original repository as a remote, you can check it with:

```bash
git remote -v

origin [email protected]:octocat/my-full-stack.git (fetch)
origin [email protected]:octocat/my-full-stack.git (push)
upstream [email protected]:fastapi/full-stack-fastapi-template.git (fetch)
upstream [email protected]:fastapi/full-stack-fastapi-template.git (push)
```

- Pull the latest changes without merging:

```bash
git pull --no-commit upstream master
```

This will download the latest changes from this template without committing them, that way you can check everything is right before committing.

- If there are conflicts, solve them in your editor.

- Once you are done, commit the changes:

```bash
git merge --continue
```

### Configure

You can then update configs in the `.env` files to customize your configurations.

Before deploying it, make sure you change at least the values for:

- `SECRET_KEY`
- `FIRST_SUPERUSER_PASSWORD`
- `POSTGRES_PASSWORD`

You can (and should) pass these as environment variables from secrets.

Read the [deployment.md](./deployment.md) docs for more details.

### Generate Secret Keys

Some environment variables in the `.env` file have a default value of `changethis`.

You have to change them with a secret key, to generate secret keys you can run the following command:

```bash
python -c "import secrets; print(secrets.token_urlsafe(32))"
```

Copy the content and use that as password / secret key. And run that again to generate another secure key.

## How To Use It - Alternative With Copier

This repository also supports generating a new project using [Copier](https://copier.readthedocs.io).

It will copy all the files, ask you configuration questions, and update the `.env` files with your answers.

### Install Copier

You can install Copier with:

```bash
pip install copier
```

Or better, if you have [`pipx`](https://pipx.pypa.io/), you can run it with:

```bash
pipx install copier
```

**Note**: If you have `pipx`, installing copier is optional, you could run it directly.

### Generate a Project With Copier

Decide a name for your new project's directory, you will use it below. For example, `my-awesome-project`.

Go to the directory that will be the parent of your project, and run the command with your project's name:

```bash
copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust
```

If you have `pipx` and you didn't install `copier`, you can run it directly:

```bash
pipx run copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust
```

**Note** the `--trust` option is necessary to be able to execute a [post-creation script](https://github.com/fastapi/full-stack-fastapi-template/blob/master/.copier/update_dotenv.py) that updates your `.env` files.

### Input Variables

Copier will ask you for some data, you might want to have at hand before generating the project.

But don't worry, you can just update any of that in the `.env` files afterwards.

The input variables, with their default values (some auto generated) are:

- `project_name`: (default: `"FastAPI Project"`) The name of the project, shown to API users (in .env).
- `stack_name`: (default: `"fastapi-project"`) The name of the stack used for Docker Compose labels and project name (no spaces, no periods) (in .env).
- `secret_key`: (default: `"changethis"`) The secret key for the project, used for security, stored in .env, you can generate one with the method above.
- `first_superuser`: (default: `"[email protected]"`) The email of the first superuser (in .env).
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env).
- `smtp_host`: (default: "") The SMTP server host to send emails, you can set it later in .env.
- `smtp_user`: (default: "") The SMTP server user to send emails, you can set it later in .env.
- `smtp_password`: (default: "") The SMTP server password to send emails, you can set it later in .env.
- `emails_from_email`: (default: `"[email protected]"`) The email account to send emails from, you can set it later in .env.
- `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.
- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.

## Backend Development

Backend docs: [backend/README.md](./backend/README.md).

## Frontend Development

Frontend docs: [frontend/README.md](./frontend/README.md).

## Deployment

Deployment docs: [deployment.md](./deployment.md).

## Development

General development docs: [development.md](./development.md).

This includes using Docker Compose, custom local domains, `.env` configurations, etc.

## Release Notes

Check the file [release-notes.md](./release-notes.md).

## License

The Full Stack FastAPI Template is licensed under the terms of the MIT license.
Loading