Coder Social home page Coder Social logo

realworld-ktor's Introduction

realworld-ktor

image test Coverage

Ktor codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Ktor including CRUD operations, authentication, routing, pagination, and more. We've gone to great lengths to adhere to the Ktor community styleguides & best practices. For more information on how to this works with other frontends/backends, head over to the RealWorld repo!!

It works with...

As above logo shows, it works mainly with four kotlin based frameworks/libraries. That is ..

  • Ktor - web server(netty)
  • Exposed - kotlin native orm
  • Koin - for dependency injection
  • Kotest - kotlin native test (supports property test)

This is my first project with above frameworks. I think there exists small amount of reference to find out the Best Practice to create web server in ktor. I will try my best to find out my own "Best Practice" in this project.

Good Points

  • Cleanup /build.gradle.kts with buildSrc
  • Password with PasswordDelegate
    • it is my first time to apply what is called delegate property. It could probably get better... but I'm really satisfied with that
  • Test
    • kotest is super awesome!
    • It provides nice dsl for assertions & property testing.
    • It also supports integration with a lot of other projects - ktor/koin/konform!
    • IDE/plugin support is quite bad for now. It think will be better soon.
  • Kotlin Experimental Features!

Questions

  • I think that ktor/exposed support light weight server. So, I wonder is it worth enough to consist on DI or clean architecture pattern that I used to studied in the Spring Framework. Well that must be case by case. In this case I ommited lots of those values and focus on framwork/library usages

Current Test with postman - with script provided @here

image

Endpoints - See Details @here

Done (Main/Test)

  • Authentication
  • Registration
  • Get Current User
  • Update User

Done (Main), no test code yet

  • Get Profile
  • Follow user
  • Unfollow user
  • List Articles
  • Get Article - no test yet
  • Create Article
  • Update Article
  • Delete Article
  • Add Comments to an Article
  • Get Comments from an Article
  • Delete Comment
  • Favorite Article
  • Unfavorite Article
  • Get Tags

Not Yet

  • Feed Articles (a.k.a. filter)

Getting started

./gradlew build
./gradlew run

realworld-ktor's People

Contributors

ndy2 avatar github-actions[bot] 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.