A full-stack microblogging application inspired by Twitter/X. Users can post short messages, follow each other, like and comment on posts, and manage their profile.
Live demo: coming soon
| Layer | Technology |
|---|---|
| Frontend | React 19, React Router, Vite |
| Backend | Java 21, Spring Boot 3, Spring Data JPA |
| Database | MariaDB (production), H2 (tests) |
| Auth | Session-based (HTTP-only cookies) with BCrypt password hashing |
| API Docs | OpenAPI / Swagger |
| Containerisation | Docker, Docker Compose |
- Register, log in, and log out
- Create posts (max 280 characters)
- Like and unlike posts (cannot like your own)
- Comment on posts, delete your own comments
- Follow and unfollow users
- Aggregated timeline of followed users' posts
- User search
- Edit your own profile (name, email, bio)
- View other users' public profiles and follower / following counts
- Dark / Light mode toggle
- Responsive design (mobile and desktop)
- Accessible: skip-to-content link, ARIA attributes, keyboard navigation, speech-to-text input (Chrome / Edge)
- Node.js 18+
- Java 21
- Docker & Docker Compose (easiest option)
docker-compose up --build- Frontend: http://localhost
- Backend API: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
Backend
cd relay-backend
# Copy .env.example to .env and fill in the values, then:
export DB_URL=jdbc:mariadb://localhost:3306/relay?createDatabaseIfNotExist=true
export DB_USERNAME=root
export DB_PASSWORD=yourpassword
./mvnw spring-boot:runFrontend
cd relay-frontend
npm install
npm run devApp runs at http://localhost:5173 — the Vite dev server proxies /api to the backend automatically.
Copy .env.example to .env and fill in the values before running.
| Variable | Description | Default |
|---|---|---|
DB_URL |
MariaDB JDBC connection string | jdbc:mariadb://localhost:3306/relay |
DB_USERNAME |
Database user | root |
DB_PASSWORD |
Database password | (none) |
COOKIE_SECURE |
Set true when running behind HTTPS |
false |
CORS_ALLOWED_ORIGINS |
Comma-separated allowed frontend origins | http://localhost |
VITE_API_URL |
Backend API base URL used by the frontend build | /api |
cd relay-backend
./mvnw test73 tests covering controllers, services, and authentication flows.
- Passwords hashed with BCrypt (work factor 12, unique salt per hash)
- Session cookies are
HttpOnly— not readable by JavaScript Secureflag enabled in production via theCOOKIE_SECUREenv var- No secrets committed to version control — all sensitive config via environment variables
Copyright © 2025 Malek Alsibai