Skip to content

Jeswindany/echo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Echo - Console Based Social Media App

Echo is a simple console-based social media application built using Core Java, JDBC, and PostgreSQL.
It allows users to register, log in, create posts, comment, like, follow others, and manage their profiles securely.
It also includes an Admin Role with moderation features to manage users, posts, and comments.


🚀 Features

🔹 Start Menu

  • Register – Create a new account with username, email, and password
    • Regex validation for inputs
    • Password hashing using SHA-256
    • Duplicate check for username and email
  • Login – Secure login with hashed password verification
  • Exit – Exit the application

👤 User Features

🔹 After Login Menu

  • View Profile – Display user details
  • Create a Post – Add a new text post
  • View My Posts – Show only your posts
  • View All Posts – Display posts from all users
  • View Followee Posts – Show posts from users you follow
  • Search Posts – Search posts by keyword
  • View My Comments – List all your comments
  • Follow / Unfollow Users – Manage following list
  • Delete Account – Remove your account and related data
  • Logout – Return to start menu

🔹 Post Options

  • Edit Post – Modify your own posts
  • Delete Post – Remove your own posts
  • Like / Unlike Post – Toggle like for any post
  • View / Add Comments – See and add comments to a post
  • Go Back – Return to previous menu

🔹 Comment Options

  • Edit Comment – Modify your own comment
  • Delete Comment – Remove your own comment
  • Go Back – Return to previous menu

🛡️ Admin Role Features

The Admin account provides system-wide moderation and management features:

  • View All Posts – Access every post in the system
  • Delete Any Post – Remove inappropriate or duplicate posts
  • Delete Any Comment – Remove unwanted comments
  • Delete Any User – Permanently delete user accounts

Admin features are only available to users with the admin role.


🧩 Tech Stack

  • Language: Java (JDK 11 or above)
  • Database: PostgreSQL (v17 or above)
  • Driver: PostgreSQL JDBC Driver (postgresql-42.7.8.jar)

⚙️ Setup Instructions

1️⃣ Prerequisites

Make sure you have:

  • JDK 11 or later
  • PostgreSQL 17 or later
  • PostgreSQL JDBC Driver (postgresql-42.7.8.jar)

2️⃣ Database Setup

  1. Open psql or pgAdmin
  2. Create the database and user manually:
CREATE DATABASE echo_db;
CREATE ROLE echo_user LOGIN PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE echo_db TO echo_user;
  1. Run "Database initialization.sql" to create necessary tables according to users, posts, comments, follows, likes.

3️⃣ Application Configuration

Edit the resources/application.properties file:

db.url = jdbc:postgresql://localhost:5432/echo_db
db.username = echo_user
db.password = 12345678

4️⃣ Add the JDBC Driver

Download the PostgreSQL JDBC driver from 🔗 https://jdbc.postgresql.org/download/

Then add it to your project:

Right click project → Open Module Settings → Libraries → Add → Select the driver jar


🔐 Security & Validation

  • Passwords are hashed using SHA-256 before saving to the database
  • Input validation using regular expressions for username, email, and password
  • Duplicate checks for existing usernames and emails
  • Only post/comment authors or admins can delete content
  • JDBC PreparedStatements used to prevent SQL Injection
  • Graceful exception handling for invalid inputs

About

A simple Java based social media application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages