# My Portfolio

Personal portfolio built with Next.js, React, TypeScript, and Tailwind CSS.

## What It Includes

- Hero dev-card, live-count stat, and work-experience timeline
- Projects (served from our DB) with a `/projects` page and homepage teaser
- Luna section, DB-driven affiliates, and the SHSF Code Activity graph
- Admin CMS at `/admin` for projects, work experience, and affiliates

## Data layer

Content (projects, work experience, affiliates) lives in **Postgres** and is
managed through Prisma + our own Next.js API routes:

- Public reads: `GET /api/projects`, `/api/experience`, `/api/affiliates`
- Admin writes: `POST/PUT/DELETE /api/admin/{projects,experience,affiliates}/…`
  (cookie session issued by `POST /api/admin/login`)
- `/api/profile-image` serves the avatar (cached in memory)
- Only the **Code Activity** widget still uses the external SHSF API.

### Environment

Copy `.env.example` to `.env` and set:

| Var | Purpose |
| --- | --- |
| `DATABASE_URL` | Postgres connection string |
| `ADMIN_PASSWORD` | Password for the `/admin` login |
| `SESSION_SECRET` | Long random string used to sign the admin session cookie |
| `PROFILE_IMAGE_URL` | (optional) override for the avatar source |

## Development

Install dependencies and generate the Prisma client:

```bash
pnpm install
pnpm prisma generate
```

Apply the schema to your database:

```bash
pnpm prisma migrate dev
```

Run the development server:

```bash
pnpm dev
```

Open [http://localhost:5173](http://localhost:5173) in your browser.

## Production Build

Create a production build:

```bash
pnpm build
```

Start the production server locally:

```bash
pnpm start
```

## Docker

This project includes a standalone Docker image setup.

Build the image:

```bash
docker build -t my-portfolio:latest .
```

Run with Docker Compose:

```bash
docker compose up --build
```

The app will be available on port `6756` via `docker-compose.yml`.

## Notes

- `next.config.ts` uses `output: "standalone"` so the Docker image can ship a minimal runtime.
- `pnpm build` runs `prisma generate` before `next build`.
- The activity graph on the home page is loaded from a remote SVG source.
- The container needs the same env vars (`DATABASE_URL`, `ADMIN_PASSWORD`, `SESSION_SECRET`) at runtime.
