Coder Social home page Coder Social logo

scrapi's Introduction

                               _ 
   ___________________ _____  (_)
  / ___/ ___/ ___/ __ `/ __ \/ / 
 (__  ) /__/ /  / /_/ / /_/ / /  
/____/\___/_/   \__,_/ .___/_/   
                    /_/          

A Scala flavored sample REST API with teeth.

Quickstart

Requirements

The following software components are required to be pre-installed in order to develop for this project:

Installing Dependencies

Here is one method of installing all the necessary dependencies on a Mac via Homebrew:

$ brew update
$ brew install scala
$ brew install sbt

# test #
$ scala -version
$ sbt --version

Running the server

Issue the following commands from a command shell to start the development web server:

$ cd path/to/scrapi
$ sbt run

# test #
$ curl http://localhost:8080/v1/user

NOTE: Running the sbt command may result in a OutOfMemoryError. To fix this, you can increase the memory allocated to the JVM by following these instructions to create a ~/.sbtconfig file.

Development Notes

Deploying the service

The deployment process produces a single java JAR file that can be executed from any machine that has the Java Runtime Environment v1.6 or higher.

Issue the following commands from a command shell to build a deployment package and run it:

$ sbt assembly
$ java -jar target/scala-2.10/scrapi-assembly-0.1.0.jar

Running the test suite

Issue the following commands from a command shell to run the test suite:

$ sbt test

Developing in Eclipse

Scala code can be developed in Eclipse via the Scala IDE Plugin. You can visit their home page for the most up to date installation instructions, but it follows the same process for installing other Eclipse plugins:

  1. Open Eclipse and from the top menu, select Help > Install New Software...
  2. In the Install dialog, type in the address for the software site for the Scala IDE
  1. Select the Scala IDE for Eclipse option and click Finish

Eclipse specific project files are not saved in this repository, but can be generated on demand with the following commands:

$ cd path/to/scrapi
$ sbt eclipse

Once this is done, open up Eclipse and perform the following steps:

  1. Select your default workspace
  2. From the top menu, select File > Import...
  3. From the Import dialog, select General > Existing projects into Workspace
  4. In the Import Projects dialog, ensure the Select root directory option is selected and browse to the location where the source files exist on your harddrive
  5. Ensure the Copy projects into workspace option is NOT selected and then click Finish

REST API

USER resource

Technology Stack

  • Scala : The primary development language of this project.
  • Spray : Suite of Scala libraries built on top of Akka for building REST/HTTP services.
  • Slick : Modern database query and access library for Scala.
  • Scala Migrations : Scala library for managing upgrades and rollbacks to database schemas.
  • ScalaTest : Scala library for writing automated tests.
  • Log4j 2 : Java library for logging.
  • SBT : Build tool for Scala and Java projects similar to Maven and Ant.
  • Derby : Java-based embedded SQL database engine for unit testing.

scrapi's People

Contributors

naasir avatar

Stargazers

 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.