This is a Reddit-like application built using App development with Gradle as the build system. The app provides key features inspired by the Reddit platform, allowing users to browse, interact with, and share content.
- User authentication and registration
- Subreddit browsing
- Post creation and viewing
- Commenting system
- Upvote/Downvote functionality
- User profiles
- Personalized feed
- IntelliJ IDEA (recommended)
- Java Development Kit (JDK) 11 or later
- Postman (for API testing)
- Language: Java
- IDE: IntelliJ IDEA
- Build Tool: Gradle
- Architecture: MVVM (Model-View-ViewModel)
- Database: Room Persistence Library
- Networking: Retrofit
- Dependency Injection: Dagger Hilt
- Image Loading: Glide
git clone https://github.com/CodeCshekhar/Reddit-App.git
cd Reddit-App
- Launch IntelliJ IDEA
- Select "Open" and navigate to the project directory
- Allow Gradle to sync and download dependencies
- Authenticate with the Reddit API.
- Fetch top posts from any subreddit.
- Submit posts to a subreddit.
- Save responses to a local file for reference.
- Run the app:
java -jar RedditApp.jar
- Gradle
- Firebase
- Lombok
- Material Theme UI
Ensure your build.gradle
files are configured correctly:
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.4.2'
}
}
plugins {
id 'com.android.application'
id 'dagger.hilt.android.plugin'
id 'com.google.gms.google-services'
}
dependencies {
// Android core dependencies
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
// Firebase
implementation 'com.google.firebase:firebase-auth:21.0.3'
implementation 'com.google.firebase:firebase-firestore:24.0.1'
// Networking
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
// Dependency Injection
implementation 'com.google.dagger:hilt-android:2.40.5'
annotationProcessor 'com.google.dagger:hilt-android-compiler:2.40.5'
}
- Download and install Postman from postman.com
- Import the API collection for this project
We've created a comprehensive Postman collection to test the following endpoints:
POST /auth/register
- User registrationPOST /auth/login
- User loginPOST /auth/logout
- User logout
GET /subreddits
- List all subredditsGET /subreddits/{id}
- Get specific subreddit detailsPOST /subreddits
- Create a new subreddit
GET /posts
- Retrieve postsGET /posts/{id}
- Get specific post detailsPOST /posts
- Create a new postPUT /posts/{id}
- Update a postDELETE /posts/{id}
- Delete a post- "Below is Sampled Fetched Post!!!!"
- Unit Tests: Located in
src/test/java
- Instrumentation Tests: Located in
src/androidTest/java
- API Tests: Managed through Postman collection
Run tests in IntelliJ IDEA:
- Right-click on test directories
- Select "Run Tests"
IntelliJ IDEA provides powerful debugging tools:
- Set breakpoints
- Use step-through debugging
- Examine variables and call stack
- Use the integrated debugger for Android apps
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/CodeCshekhar/Reddit-App