Skip to content

tarikware/portfolio-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio API

REST API backend for Tarik Yumbul's developer portfolio. Built with Spring Boot, it serves all portfolio data — profile info, work experience, education, skills, projects, and certifications — from a PostgreSQL database through a clean, versioned API.

Tech Stack

Layer Technology
Language Java 21
Framework Spring Boot 3.5
Persistence Spring Data JPA · Hibernate
Database PostgreSQL
Security Spring Security (stateless, public)
Mapping MapStruct 1.6
Boilerplate Lombok
Build Maven
Container Docker (Eclipse Temurin 21)

API Endpoints

All endpoints are read-only and publicly accessible under /api/v1.

Method Endpoint Description
GET /api/v1/portfolio Aggregated portfolio (single request for full page load)
GET /api/v1/profile Personal profile info
GET /api/v1/experiences Work experience entries
GET /api/v1/educations Education history
GET /api/v1/skills Skills grouped by category
GET /api/v1/projects Project showcase
GET /api/v1/certifications Professional certifications

Project Structure

portfolio-api/
├── src/main/java/com/tarik/yumbul/portfolio/
│   ├── controller/        # REST controller
│   ├── service/           # Business logic
│   ├── repository/        # Spring Data JPA repositories
│   ├── entity/            # JPA entities
│   ├── dto/               # Data Transfer Objects
│   ├── mapper/            # MapStruct entity ↔ DTO mappers
│   ├── config/            # CORS & Security configuration
│   └── exception/         # Global exception handling (RFC 7807)
├── src/main/resources/
│   ├── application.yaml        # Base config
│   ├── application-dev.yaml    # Dev profile (local Postgres)
│   ├── application-prod.yaml   # Prod profile (env-driven)
│   ├── schema.sql              # Database schema
│   └── data.sql                # Seed data
├── Dockerfile
└── pom.xml

Getting Started

Prerequisites

  • Java 21 (or later)
  • Maven 3.9+
  • PostgreSQL 15+ running locally (or via Docker)

1. Set up the database

Create a PostgreSQL database named portfolio_db:

CREATE DATABASE portfolio_db;

2. Run in development mode

The dev profile connects to localhost:5432/portfolio_db with postgres/postgres credentials by default.

./mvnw spring-boot:run

The API will be available at http://localhost:8080/api/v1.

3. Run in production mode

Set the following environment variables and activate the prod profile:

export SPRING_PROFILES_ACTIVE=prod
export DATABASE_URL=jdbc:postgresql://<host>:<port>/<db>
export DATABASE_USERNAME=<username>
export DATABASE_PASSWORD=<password>
export CORS_ALLOWED_ORIGINS=https://tarikyumbul.vercel.app
./mvnw spring-boot:run

4. Run with Docker

docker build -t portfolio-api .
docker run -p 8080:8080 \
  -e SPRING_PROFILES_ACTIVE=prod \
  -e DATABASE_URL=jdbc:postgresql://host:5432/portfolio_db \
  -e DATABASE_USERNAME=postgres \
  -e DATABASE_PASSWORD=secret \
  -e CORS_ALLOWED_ORIGINS=https://tarikyumbul.vercel.app \
  portfolio-api

Environment Variables

Variable Required Description
SPRING_PROFILES_ACTIVE No dev (default) or prod
DATABASE_URL Prod JDBC connection string
DATABASE_USERNAME Prod Database user
DATABASE_PASSWORD Prod Database password
CORS_ALLOWED_ORIGINS Prod Comma-separated allowed origin patterns

About

Tarik Yumbul Developer Portfolio REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors