GithubHelp home page GithubHelp logo

instagram-api-project's Introduction

Instagran API Project

Built With

  • Java 17
  • Maven 4.0.0
  • MySql Ver 8.0.32
  • Spring Boot 3.0.5
  • IntelliJ IDEA 2023.1 (Community Edition)

Data Flow

1. Model:

  • It consists of Admin ,User, Post ,AuthToken and other entity classes along with their data members and member functions
  • Used @Table and @Entity annotations inside the entity class.
  • Used Lombok to reduce boilerplate code for pojo class.By using Lombok annotations like @Data, @NoArgsConstructor, @AllArgsConstructor getters and setters for those object generate automatically.
  • Used @OneToOne, @OneToMany and @ManyToOne annotation to perform one to one mapping between Employee and Address.

2. Controller:

  • It consists of AdminController ,UserController, PostController and CommentController classes in which used the annotations like @RestController to annotate the class as Controller.
  • Used annotation @GetMapping , @PostMapping , @PutMapping , @DeleteMapping to map the HTTP web requests to the specific handler methods.

API Reference:


Admin's API References


  • Set Blue Tick on User Profile:
  http://localhost:8080/admin/user/{id}/{blueTick}

User's API References


  • Add User:
  http://localhost:8080/user
  • User SigUp:
  http://localhost:8080/user/signup
  • User SignIn:
  http://localhost:8080/user/signin
  • User SignOut:
  http://localhost:8080/user/sign-out
  • User Can Like:
  http://localhost:8080/user/like
  • User can follow other user:
  http://localhost:8080/user/follow/{myId}/{otherId}

Post's API References:


  • Create Post via User's authentication:
  http://localhost:8080/post/email/{userEmail}/token/{token}
  • Get all Posts:
  http://localhost:8080/post/
  • Can see post likes:
  http://localhost:8080/post/{postId}/likeCount

Comments's API References:


  • Can comment on post:
  http://localhost:8080/comment

3. Service:

  • It consists of AdminService, UserService, TokenService and PostService classes in which provide some business functionalities of every handler methods.
  • Used @Service annotation to indicate that a class belongs to the service layer.
  • Used @Transactional annotation to separate transaction management code from the code for business logic on the update and delete methods.

4. Repository:

  • It consists of AdminDao, UserDao ,TokenDao and PostDao interface classes that extends CrudRepository which is interface for generic inbuilt CRUD operations on a repository for a specific type. Usually represent the database access layer in an application.
  • Used Iterable for User and Post to manage the data of entity classes by performing CRUD operations.
  • Used @Repository annotation is used to indicate that the class provides the mechanism for storage, retrieval, search, update and delete operation on objects.
  • Used @Modifying annotation wrote named parameters query using @Query annotation to insert, update, or delete an entity.

Data Structure Used

Used Iterable<T> to store objects for entity classes.

Project Summary

  • In this project I performed CRUD operation like add,get,delete and update.
  • The aim of this project to create instagram-api application uses authentication tokens to secure user data and ensure that only authenticated users can access certain features.
  • Used interface CrudRepository class for generic CRUD inbuilt operations like save,saveAll,updateById, etc.
  • Used our own custom finder methods and wrote operations using custom queries.
  • Implemented authentication for User SignUp, SignIn and to create Post and manage their profile information
  • It allows users to sign up, sign in, and manage their profile information. Users can also create and view posts.

instagram-api-project's People

Contributors

sa1nick avatar

Watchers

 avatar

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.