Full-stack Reddit-style app with:
- Java/Spring Boot backend (REST API, JWT auth, JPA)
- Angular frontend (served as static assets in production)
- PostgreSQL in production (Heroku Postgres)
- SMTP for signup verification emails
- Java
21 - Spring Boot
3.2.5 - Spring Security + JWT (
jjwt) - Spring Data JPA + Hibernate
- PostgreSQL driver (runtime)
- OpenAPI/Swagger (
springdoc-openapi) - Maven Wrapper (
./mvnw)
- Angular
9.x - TypeScript
- Bootstrap + ng-bootstrap
- TinyMCE editor
- npm scripts (
npm start,npm run build -- --prod)
- Heroku (
Procfile,system.properties) - Profile:
prod
Browser
-> Angular app (frontend/src/app)
-> HTTP /api/* calls
-> Spring Controller
-> Service
-> Repository (JPA)
-> PostgreSQL
-> MailService
-> SMTP provider
humanfirst-MVP
├─ src/
│ └─ main/
│ ├─ java/com/programming/techie/humanfirst/
│ │ ├─ controller/ (REST endpoints)
│ │ ├─ service/ (business logic)
│ │ ├─ repository/ (DB access)
│ │ ├─ model/ (JPA entities)
│ │ ├─ dto/ (request/response payloads)
│ │ ├─ mapper/ (entity <-> dto)
│ │ ├─ security/ (JWT filter/provider)
│ │ └─ config/ (security/cors/datasource/bootstrap)
│ └─ resources/
│ ├─ application.properties
│ ├─ application-local.properties
│ ├─ application-prod.properties
│ ├─ templates/ (mail templates)
│ └─ static/ (built Angular files for deployment)
├─ frontend/
│ ├─ src/app/
│ │ ├─ auth/
│ │ ├─ home/
│ │ ├─ post/
│ │ ├─ subreddit/
│ │ └─ shared/
│ └─ package.json
├─ pom.xml
├─ Procfile
└─ system.properties
- Signup + account verification email
- Login/logout + JWT auth
- Create/view posts
- Create/list subreddits
- Comment and vote APIs
- Home feed filtering by domain:
alldiscussionsAI prospects
Base API paths:
/api/auth/api/posts/api/subreddit/api/comments/api/votes
Examples:
POST /api/auth/signupPOST /api/auth/loginGET /api/posts/GET /api/posts/by-subreddit/{id}POST /api/posts/GET /api/subreddit
OpenAPI docs:
/swagger-ui.html/v3/api-docs
From repo root:
export JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home
export PATH="$JAVA_HOME/bin:$PATH"
./mvnw spring-boot:runNotes:
- App reads DB connection from env vars via
DataSourceConfig. - For production-like local runs, set
DATABASE_URLorJDBC_DATABASE_URL.
cd frontend
npm install
npm startAngular dev URL: http://localhost:4200
Backend URL (default): http://localhost:8080
From repo root:
cd frontend
npm install
npm run build -- --prod
rsync -av --delete dist/humanfirst-mvp/ ../src/main/resources/static/Then package backend:
cd ..
./mvnw -DskipTests packageTypical flow:
git push origin main
git push heroku main
heroku logs --tail -a <your-app-name>Heroku runtime is defined by:
Procfilesystem.properties
Required config vars (typical):
DATABASE_URLMAIL_HOST,MAIL_PORT,MAIL_USERNAME,MAIL_PASSWORD,MAIL_FROMAPP_URL
# Backend package
./mvnw -DskipTests package
# Check git status quickly
git status -sb
# Tail Heroku logs
heroku logs --tail -a <your-app-name>