Coder Social home page Coder Social logo

rest-api's Introduction

banner

NightWolf Download Manager RESTful API

Dependencies

  1. MySQL
  2. Maven (optional)

Configuration

  1. Clone the repository

  2. Create a mysql database for the project (ex : resttest)

  3. Open "dbScript.sql" and edit the default_paths in the following insert queries as the downloads will be mapped to these paths :

    Note : Provide absolute paths in your system for the default download paths

        INSERT INTO download_type (file_type, default_path) VALUES (
          "documents",
          "C:\\Users\\abc\\Desktop\\Downloads\\Documents"
        ),
        (
          "images",
          "C:\\Users\\abc\\Desktop\\Downloads\\Pictures"
        ),
        (
          "audios",
          "C:\\Users\\abc\\Desktop\\Downloads\\Audios"
        ),
        (
          "videos",
          "C:\\Users\\abc\\Desktop\\Downloads\\Videos"
        ),
        (
          "programs",
          "C:\\Users\\abc\\Desktop\\Downloads\\Programs"
        ),
        (
          "other",
          "C:\\Users\\abc\\Desktop\\Downloads\\Other"
        );
  4. Import database using "dbScript.sql"

  5. Navigate to src/main/resources/application.properties and edit the following configurations

    1. server.port (default is 8080)
    2. spring.datasource.url (as per the database)
    3. spring.datasource.username (mysql username)
    4. spring.datasource.password (mysql password)
    5. spring.mail.username (email account)
    6. spring.mail.password (email account password)
  6. Navigate to src/main/java/io/github/nightwolf/restapi/security/SecurityConstants.java and edit the following constants :

    1. SECRET (The secret key to encrypt JWT token)
    2. EXPIRATION_TIME (Token expiration time - default 10 days)
    3. FILE_DOWNLOAD_PATH (downloads will be saved in this path - give an absolute path)

Note : These configurations will be changed as the development goes on, thus not final

Executing the project

  • Execute using maven wrapper :
  1. Navigate to the source directory
  2. Open terminal/cmd and run the project using: ./mvnw spring-boot:run
  • Or build it from source using maven and execute the package jar file

Default user credentials :

| Email                 | Password  | Role  |
|:----------------------|:----------|:------|
| [email protected]   | admin     | Admin |
| [email protected]    | user      | user  |

Note : passwords are hashed using bcrypt encoding

TODO :

  1. Implement repository search per client request alt alt
  2. Implement copy files from repository alt alt
  3. Implement stop downloading alt alt
  4. Implement automatically start/stop downloading in the given time frame alt alt
  5. Save added downloads in temp_download alt alt
  6. Fix setting download paths in a different property file alt alt
  7. Implement notifying after each download finishes alt alt
  8. Move the data to download table from temp_download after download finished alt alt
  9. Add repository check/clean scheduling alt alt
  10. Implement downloading to the proper directory based on the file type alt alt
  11. Test against incoming new download requests to the queue (while downloads has started) alt alt
  12. Test resuming paused downloads alt alt

rest-api's People

Contributors

oshan96 avatar

Watchers

James Cloos 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.