Giter VIP home page Giter VIP logo

finra-test's Introduction

finra-test

Simple REST service for storing files and associated metadata using Spring and MongoDB.

Execution

Starting

To start the service, simply issue the following command: docker-compose up.

This will start the MongoDB instance as well as build and run the Spring Boot service.

To start it in daemon mode, pass the option -d to the compose call.

Stopping

To stop the service, simply Ctrl-C or, if started in daemon mode, then issue the docker-compose down command.

API

Upload file

http://localhost:8080/upload http://localhost:8080/v1/upload

Expects multipart post where the file is parameter file and all other parameters are assumed to be metadata. Returns the ID generated for the file.

Retrieve file metadata

http://localhost:8080/metadata/{id} http://localhost:8080/v1/metadata/{id}

Given a file ID, it returns all metadata associated with the file.

Retrieve file

http://localhost:8080/file/{id} http://localhost:8080/v1/file/{id}

Given a file ID, it initiates a content stream of the file.

Retrieve IDs of files matching metadata

http://localhost:8080/search http://localhost:8080/v1/search

A get request where the query parameters are the search criteria matching the metadata. Returns a list of matching file IDs.

Configuration

All configuration is located in the application.properties file.

Available configuration options:

Property Default value Description
upload.location /var/cache/finra-test Location on disk where the files will be stored
metadata.database mongodb The type of database to connect to. Only mongodb is supported
spring.data.mongodb.host mongodb Hostname to use to connect to the mongodb instance
alert.new-item.poll-rate.mins 3600000 The rate in which it should poll for new items in minutes
alert.new-item.email The email address to send new item alerts
spring.mail.host Must be filled in for email to work
spring.mail.port Must be filled in for email to work
spring.mail.username Must be filled in for email to work
spring.mail.password Must be filled in for email to work
spring.mail.properties.mail.smtp.auth Must be filled in for email to work
spring.mail.properties.mail.smtp.starttls.enable Must be filled in for email to work

Testing

To run very basic unit tests, issue a ./gradlew test command.

To run a very basic end-to-end integration test, execute the command e2e/test.

finra-test's People

Contributors

hokiegeek avatar

Watchers

James Cloos avatar  avatar

finra-test's Issues

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.