A full-stack TypeScript portfolio application featuring AI-powered tools, technical articles, and project showcases.
This repository powers luisfaria.dev — a portfolio built with Next.js, Node.js, GraphQL, MongoDB, and Redis. It goes beyond a static portfolio by integrating modern patterns: an authenticated AI assistant, atomic rate limiting, CI/CD pipelines, and a layered caching strategy.
Highlights for reviewers:
- Live site — browse projects, articles, and the AI chatbot
- From Groomzilla to Full-Stack Engineer — case study built on this stack
- Security Incident Report: Cryptominer Attack — led to the
feat/sec-authhardening milestone
Browser ─── Next.js (SSR/CSR) ─── Apollo Client ─── GraphQL API (:4000)
│
┌──────────────┼──────────────┐
│ │ │
MongoDB Redis External
(data) (cache/rate) APIs
├─ OpenAI
├─ Resend
└─ NASA
luisfaria/
├── _docs/ # Feature specs, release notes, articles
├── backend/ # Express, Apollo Server 5, Mongoose, Redis
├── frontend/ # Next.js 14+, React 19, Apollo Client, TailwindCSS 4, shadcn/ui
└── docker-compose.yml
| Concern | Approach |
|---|---|
| API | GraphQL with modular schema composition and resolver-level error handling |
| Auth | JWT in httpOnly cookies, role-based access (ADMIN / EDITOR / USER), GraphQL Shield |
| Rate Limiting | Redis + atomic Lua scripts — sliding window per user per feature |
| Caching | Multi-layer: Redis (server), Apollo Client cache (client) |
| Validation | Zod schemas for all GraphQL inputs |
| Error Handling | Shared error factories (createErrorHandler) with standardized codes |
| CI/CD | GitHub Actions with parallel test suites, Docker, minimal-downtime deploys |
| Layer | Technologies |
|---|---|
| Frontend | Next.js 14+, React 19, TypeScript, Apollo Client, TailwindCSS 4, shadcn/ui |
| Backend | Node.js, Express, Apollo Server 5, GraphQL, Mongoose |
| Data | MongoDB, Redis |
| Integrations | OpenAI (chatbot), Resend (email), NASA API (APOD) |
| Infrastructure | Docker, GitHub Actions, Vercel |
| Testing | Jest, React Testing Library, MongoDB Memory Server |
| Version | Feature | Description |
|---|---|---|
| v1.1 | Portfolio | Project showcase with highlights and filtering |
| v1.2 | Articles | Technical articles with categorization |
| v1.3 | Auth | JWT authentication with role-based access |
| v1.4 | Chatbot | AI assistant — 5 req/hr per user, conversation history |
| v1.13 | SEO | Meta tags, sitemap, robots.txt, social sharing |
| v1.15 | Markdown | Image support + code syntax highlighting |
| v2.0 | Goggins Mode | Motivational AI coach with rate limiting (deprecated) |
| v2.0.1 | Atomic Rate Limiting | Redis + Lua scripts for race-condition-free limits |
| v2.2 | Security Hardening | Auth improvements, QA regression tests, monitoring |
| v2.3 | Assistant UX | Guided prompts, clearer rate-limit feedback |
| v2.4 | APOD | NASA Astronomy Picture of the Day — cached, rate-limited, browsable |
| v2.5 | Error Infrastructure | Shared GraphQL error handling with standardized codes |
| v2.6 | CI/CD | GitHub Actions pipeline, Docker, minimal-downtime deployment |
| v2.7 | Sentry Integration | Error tracking with source maps and release management |
- Node.js 18+
- MongoDB (local or Atlas)
- Redis
# Clone
git clone https://github.com/lfariabr/luisfaria.dev.git
cd luisfaria.dev
# Install dependencies
cd backend && npm install && cd ..
cd frontend && npm install && cd ..
# Configure environment
cp backend/.env.example backend/.env
# Edit backend/.env with your keys (see Environment Variables below)
# Start development servers
cd backend && npm run dev # GraphQL API on :4000
cd frontend && npm run dev # Next.js on :3000Or with Docker:
docker-compose up --build| Variable | Service |
|---|---|
MONGODB_URI |
MongoDB connection string |
REDIS_URL |
Redis connection string |
JWT_SECRET |
Auth token signing |
OPENAI_API_KEY |
AI chatbot |
RESEND_API_KEY |
Transactional email |
NASA_API_KEY |
APOD feature |
DISCORD_WEBHOOK_URL |
Notifications |
NEXT_PUBLIC_GRAPHQL_URL |
Frontend → API (defaults to http://localhost:4000/graphql) |
Both suites run in CI with MongoDB 7 and Redis 7 service containers.
# Backend
cd backend
npm test # All tests
npm run test:coverage # With coverage
# Frontend
cd frontend
npm test # All tests
npm run test:coverage # With coverage
# Single test file
cd backend && npx jest path/to/test.ts
cd frontend && npx jest path/to/test.tsxBackend: Jest + ts-jest, MongoDB Memory Server, mocked external services (OpenAI, Resend, NASA) Frontend: Jest + React Testing Library + jsdom, Apollo Client mocks
This project is the source code for luisfaria.dev. Feel free to reference the architecture and patterns for your own projects.