- MySQL
- Maven (optional)
-
Clone the repository
-
Create a mysql database for the project (ex : resttest)
-
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" );
-
Import database using "dbScript.sql"
-
Navigate to src/main/resources/application.properties and edit the following configurations
- server.port (default is 8080)
- spring.datasource.url (as per the database)
- spring.datasource.username (mysql username)
- spring.datasource.password (mysql password)
- spring.mail.username (email account)
- spring.mail.password (email account password)
-
Navigate to src/main/java/io/github/nightwolf/restapi/security/SecurityConstants.java and edit the following constants :
- SECRET (The secret key to encrypt JWT token)
- EXPIRATION_TIME (Token expiration time - default 10 days)
- 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
- Execute using maven wrapper :
- Navigate to the source directory
- 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
| Email | Password | Role |
|:----------------------|:----------|:------|
| admin@nightwolf.com | admin | Admin |
| user@nightwolf.com | user | user |
Note : passwords are hashed using bcrypt encoding
- Implement repository search per client request
- Implement copy files from repository
- Implement stop downloading
- Implement automatically start/stop downloading in the given time frame
- Save added downloads in temp_download
- Fix setting download paths in a different property file
- Implement notifying after each download finishes
- Move the data to download table from temp_download after download finished
- Add repository check/clean scheduling
- Implement downloading to the proper directory based on the file type
- Test against incoming new download requests to the queue (while downloads has started)
- Test resuming paused downloads