GithubHelp home page GithubHelp logo

skinnydoo / ktor-realworld-sample Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 259 KB

A Ktor ❤️ based backend implementation of the RealWorld API Spec written in a functional style

Home Page: https://realworld-docs.netlify.app/docs/intro

Kotlin 99.50% Shell 0.50%
realworld realworld-backend ktor-server functional-programming realworld-application kotlin arrow-kt arrow arrow-functions functional-programming-examples graphql-server graphql-kotlin repository-pattern ktor

ktor-realworld-sample's Introduction

Ktor RealWorld Sample App

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

This codebase was created to familiarize myself with Ktor, as well as the graphql-kotlin library. It includes CRUD operations, authentication, routing, pagination, and more.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

Also, for the GraphQL implementation switch to the graphql branch.

Overview

What tools & frameworks are we using?

Architecture Overview

The application uses a package-by-feature structure with the following packages:

  1. common: contains technical configuration classes (e.g. for DI, database connection, connection pooling, logging, etc)
  2. users: contains user related routes, domain models, entities and business logic
  3. articles: contains article related routes, domain models, types and business logic
  4. profiles: contains user profiles routes, domain models and business logic

Getting started

Prerequisites

MySQL

If you have a local MySQL database running on your computer - you are all set. If you don't have MySQL installed, you can do it now by installing from: https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/ and set it up with user name and password

Make sure to create a database named realworld in your MySQL instance.

Run application with IntelliJ

Clone and open ktor-realworld-sample with IntelliJ IDE. Choose Run / Edit Configuration menu to create new launch configuration. On the left side click [+] and select Kotlin. Name it RealWorld Server (or pick other name) and fill up some essential fields:

  • Main class: io.skinnydoo.RealWorldAppKt
  • Environment variables: JWT_SECRET=your-secret-here=;DB_USERNAME=root;DB_PWD=your-db-user-password
  • Use classpath or module: ktor-realworld-sample.main

You should be able to run/debug your app now.

License & Credits

Credits have to go out to Thinkster with their awesome RealWorld

This project is licensed under the MIT license.

Disclaimer

This source and the whole package comes without warranty. It may or may not harm your computer. Please use with care. Any damage cannot be related back to the author.

ktor-realworld-sample's People

Contributors

skinnydoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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