Code Monkey home page Code Monkey logo

tkpage's Introduction

Summary

This is a very simple example of RESTful API based web application which was developed as a CMS for stand-alone blog. It allows blogger to share his photos, videos and thoughts with other users. And users can comment his entries and chat with each other. Blogger and users should be registered and authenticated to post content with this application.

Server side

The application can be separated into several layers such as:

  • Repository (persistence) layer
  • Service layer
  • Web layer

These layers are described below.

Repository (persistence) layer

The responsibility of this layer is the handling entities in the persistence context. All entities used in this project are represented on this picture:

alt tag

For implementing persistence context API (JPA) these technologies was involved:

  • ORM: Hibernate
  • Cache: EhCache
  • Connection pool: Apache Commons DBCP2

Service layer

This layer implements a business logic of the application.

Web layer

The gate to the outer world for the application. This layer is implemented with Spring MVC and Security framework. It's responsible for implementing application endpoint REST API. The description of this API is listed below:

USERS API
api/v1/resources/users – GET - first 10 users, POST - create a new user
api/v1/resources/users/{userId} – GET, PUT, DELETE a concrete user 
api/v1/resources/users?pageNumber={int}&pageSize={int} – GET paginated users
api/v1/resources/users/{userId}/comments –  get first 10 user comments
api/v1/resources/users/{userId}/comments?pageNumber={int}&pageSize={int} –  GET paginated user comments

BLOG ENTRY API
api/v1/resources/blogs – GET - first 10 blog entries POST - create a new blog entry
api/v1/resources/blogs/{blogId} – GET, PUT, DELETE a concrete blog
api/v1/resources/blogs?pageNumber={int}&pageSize={int} – GET paginated blog
api/v1/resources/blogs/{blogId}/comments – GET first 10 comments for blog, POST create a new blog comment
api/v1/resources/blogs/{blogId}/comments/{commentId} – GET, PUT, DELETE a concrete blog comment
api/v1/resources/blogs/{blogId}/comments?pageNumber={int}&pageSize={int} – GET paginated comments

BLOG COMMENTS API
api/v1/resources/comments – GET - first 10 comments for all blogs 
api/v1/resources/comments/{commentId} – GET, PUT, DELETE a concrete comment
api/v1/resources/comments?pageNumber={int}&pageSize={int} – GET paginated comment

STATIC INFO API
api/v1/resources/static/ - GET all static info, POST a new static info entry
api/v1/resources/static/{contentDescription} - GET, PUT, DELETE concrete static info
examples:
api/v1/resources/static/bio – about me
api/v1/resources/static/contacts – contacts

VIDEO ENTRIES API
api/v1/resources/video – GET first 10 videos, POST - create a new video entry
api/v1/resources/video/{videoId} – GET, PUT, DELETE concrete video
api/v1/resources/video?pageNumber={int}&pageSize={int} – GET paginated video entries

PHOTO ENTRIES API
api/v1/resources/photo – GET first 10 photos, POST - create a new photo entry
api/v1/resources/photo/{photoId} – GET, PUT, DELETE concrete photo
api/v1/resources/photo?pageNumber={int}&pageSize={int} – GET paginated photo

Client side

The client side is based on AngularJS framework with UI-Router (https://angular-ui.github.io/ui-router/site/) for site navigation.

tkpage's People

Contributors

rkondakov 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.