Giter Site home page Giter Site logo

kouroshksh / java-github-explorer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 277 KB

The Java GitHub Explorer is an Android mobile application designed to help users in discovering and exploring top projects on GitHub using Java.

License: MIT License

Java 100.00%
java maven mobile-app mongodb spring-boot

java-github-explorer's Introduction

Java GitHub Explorer

The GitHub Java Explorer is an Android mobile application designed to help users discover and explore top Java projects on GitHub. This app can be useful for Java developers and enthusiasts as there are many projects on GitHub, and narrowing them down by language and popularity can be a boring task. The app will simplify this by categorizing and presenting these projects in a way that is easy to navigate. By doing so, it helps the user to find projects of interest, either for learning, collaboration, or inspiration.


Objective and Scope of the Project

The objective of our app is to provide a user-friendly platform where users can seamlessly find and explore top Java projects based on the project’s number of stars. After finding the project, they can be redirected to GitHub’s official website by further clicking on the links. This app consists of a front-end coded in Android Framework, a back-end using Java Spring Framework, and a MongoDB database.

Main Targets

  • Display a list of top Java projects from GitHub
  • Offer filter, sort, and search functionalities by getting user-inputs
  • Display detailed project information (title, stars, date, description, image, etc.)
  • Redirect users to the official GitHub repository via a browser

Back-End

  • Retrieve project details
  • Store the data in a MongoDB database
  • User login/authentication for personalization and profiles

Front-End

  1. Log-in or Sign-up screen for entrance (for user profiles)
  2. Fetch a list of top Java projects via GitHub’s API
  3. Landing screen with a list of projects (scrollable)
  4. Filtered list of projects screen (based on tags defined by the user)
  5. Search results screen (queried by the user)
  6. Full description of the project screen (can redirect to GitHub)

java-github-explorer's People

Contributors

kouroshksh avatar miladbaf avatar

Watchers

 avatar

Forkers

miladbaf

java-github-explorer's Issues

DatabaseHandler Curly Brackets

the curly brackets in DatabaseHandler.java are not aligned properly, and some of the functions at the end are out of the scope of public DatabaseHanlder(). This needs to be fixed

Initialize Spring Boot

To Start the Project

  • Use Spring Initializr to start the project.
  • Select Maven Project, Java language, Spring Boot version.
  • Add dependencies like Spring Web, and Spring Data MongoDB.

Log-In

Create the log-in functionality. Will write more in the continuation of this issue.

Temp Data for Database

Insert some data into mongo for testing purposes. For now, the template is (with an example):

{
    "_id": ObjectId('...'),
    "repoName": "RandomRepo",
    "repoStars": 300,
    "creationDate": new Date("2022-10-09"),
    "description": "This project aims to ...",
}

Printing Random Repositories Modification

Issue

All other methods in the DatabaseHanlder.java file return a list of documents (i.e., repos) that will be later used by the printRepositories(List<Document>) function to be printed elegantly. However, this is not the case with getRandomRepositories(int num).

Fix

To make the code more robust and functional, modify this function to return a list of repositories like other functions so that its content would be neatly printed like the rest (currently, even the _id is being printed).

public List<Document> getRandomRepositories(int num) {
    // Aggregation pipeline for randomly selecting `num` number of documents
    List<Document> randomEntries = reposCollection.aggregate(
        Arrays.asList(
            Aggregates.sample(num)
        )
    ).into(new java.util.ArrayList<>());

    // Return the retrieved documents
    return randomEntries;
}

First Attempt

Task

Implement a basic back-and-forth interaction between the user and the app via the terminal. The user will be asked to either:

  1. log in
  2. sign up

Based on the user's choice:

  • they have to either enter the username and password and can enter or be rejected from entering the app (for now, it's a simple message in the terminal)
  • or create a new account

Structure

  1. User Class:

    • A class representing a user with attributes like username, password, etc.
    • Methods to handle user-related operations like creating, validating, and fetching user details.
  2. Database Handler:

    • A class responsible for interacting with the MongoDB database.
    • Methods to perform database operations like inserting a new user, querying users, etc.
  3. Main Class:

    • A class that contains the main method to interact with users via the terminal.

Steps to Implement

  1. User Class:

    • Create a User class with attributes like username, password, etc.
    • Include methods to create a new user, check if a user exists, and validate passwords.
  2. Database Handler:

    • Implement a class (DatabaseHandler, for instance) to handle interactions with MongoDB using appropriate libraries (like Spring Data MongoDB).
    • Include methods to insert a new user, query for users based on username, etc.
  3. Main Class:

    • Write the main method in a separate class (MainClass, for example).
    • In the main method, create instances of User and DatabaseHandler classes.
    • Use Scanner to get user input from the terminal and provide choices for sign-up or login.
    • Based on the user's choice, prompt for necessary inputs (username, password).
    • Use methods from the User class to handle user-related operations (sign-up, login) and methods from the DatabaseHandler class to interact with the database.

Code Skeleton

Here's a basic skeleton of how the classes might look:

// User Class
public class User {
    private String username;
    private String password;
    
    // Constructor, getters, setters, etc.

    public void createUser(String username, String password) {
        // Implementation to create a new user
    }

    public boolean userExists(String username) {
        // Check if user exists in the database
    }

    public boolean validatePassword(String username, String password) {
        // Validate user password
    }
}

// Database Handler Class
public class DatabaseHandler {
    // MongoDB connection and setup

    public void insertUser(User user) {
        // Insert a new user into the database
    }

    public User getUserByUsername(String username) {
        // Get user details by username from the database
    }
}

// Main Class
public class MainClass {
    public static void main(String[] args) {
        User user = new User();
        DatabaseHandler dbHandler = new DatabaseHandler();
        
        // Logic for user interaction, sign-up, and login process
    }
}

This structure provides a basic outline to implement user sign-up, login, and interaction with the database. It's essential to add MongoDB connection setup, handle exceptions, and implement user input validation as needed. Each class is responsible for a specific set of functionalities, ensuring a clean and maintainable codebase.

Sign-Up

Create the sign-up functionality. Will write more in the continuation of this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.