Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🌟 Simple API serving motivational reasons to help people through difficult moments. 500+ messages in multiple languages.

Notifications You must be signed in to change notification settings

Ale1x/staystrong

Repository files navigation

StayStrong πŸ’ͺ

A simple API that provides motivational reasons to help people through difficult moments. When life gets tough, sometimes we just need a gentle reminder of our worth and strength.

🌟 What it does

StayStrong serves random motivational messages in multiple languages to remind you that:

  • You are loved and valued
  • You have overcome challenges before
  • Tomorrow can be better than today
  • You deserve happiness and peace
  • You are stronger than you think

πŸ’­ Why?

This project was born from personal struggle. I've been going through difficult times, dealing with challenges that sometimes made me forget my own worth and strength. During those dark moments, I realized how powerful a few simple words of encouragement can be.

I created StayStrong not just for myself, but for everyone who, like me, sometimes needs a gentle reminder that they matter, that they're stronger than they think, and that better days are ahead.

Sometimes we all need someone to tell us:

  • "You are not alone"
  • "You have value"
  • "You can get through this"
  • "You are loved"

If you're reading this and you're struggling too, know that you're not alone. This little API is my way of sending you a virtual hug and a reminder that you matter. We're in this together. πŸ€—

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/Ale1x/staystrong.git
cd staystrong

# Install dependencies
npm install

# Compile language files
npm run compile-lang

# Start the server
npm start

The server will start on port 3000 (or the port specified in the PORT environment variable).

Docker Deployment

You can also run StayStrong using Docker for easy deployment:

Using the pre-built image:

# Pull and run the Docker image
docker run -p 3000:3000 ghcr.io/ale1x/staystrong:latest

Building locally:

# Build the Docker image
docker build -t staystrong .

# Run the container
docker run -p 3000:3000 staystrong

Using Docker Compose:

# Start the application with Docker Compose
docker compose up -d

# Stop the application
docker compose down

The Docker setup includes:

  • Production-ready Node.js environment
  • Health checks for container monitoring
  • Environment variable support
  • Optimized multi-stage build for smaller image size
  • Pre-built image available at ghcr.io/ale1x/staystrong

πŸ“– API Usage

Get a Random Motivational Reason

Endpoint: GET /reasons

Query Parameters:

  • lang (optional): Language code (en for English, it for Italian, de for German, ar for Arabic (more to come)). Defaults to en.

Example Requests:

# Get a reason in English (default)
curl http://localhost:3000/reasons

# Get a reason in Italian
curl http://localhost:3000/reasons?lang=it

# Get a reason in German
curl http://localhost:3000/reasons?lang=de

# Get a reason in Arabic
curl http://localhost:3000/reasons?lang=ar

# Get a reason in English (explicit)
curl http://localhost:3000/reasons?lang=en

Example Response:

{
  "reason": "You are stronger than any storm that may cross you.",
  "lang": "en"
}

Rate Limiting

The API implements rate limiting to ensure fair usage:

  • Limit: 100 requests per minute per IP address
  • Response when exceeded: HTTP 429 with error message

🌍 Supported Languages

  • English (en) - 500 motivational reasons
  • Germany (de) - 500 motivational reasons
  • Italian (it) - 500 motivational reasons
  • Arabic (ar) - 460 motivational reasons

πŸ› οΈ Technical Details

  • Framework: Express.js (^5.1.0)
  • Rate Limiting: express-rate-limit (^7.5.0)
  • Response Format: JSON
  • Content-Type: application/json
  • CORS: Not configured (add if needed for browser clients)

πŸ“ Contributing

Want to help make StayStrong better? Here are some ways to contribute:

Adding New Languages

  1. Create a new JSON file in the reasons/ directory (e.g., fr.json for French)
  2. Add an array of motivational reasons in that language
  3. Run npm run compile-lang to update the combined language file
  4. Update the supportedLangs documentation

Adding More Reasons

  1. Edit the appropriate language file in the reasons/ directory
  2. Add new motivational messages to the JSON array
  3. Run npm run compile-lang to update the combined language file
  4. Ensure all messages are positive, supportive, and appropriate

Code Improvements

  • Submit bug fixes
  • Improve error handling
  • Add new features (while keeping the API simple)
  • Improve documentation

🀝 Philosophy

StayStrong believes that sometimes the smallest gestures can make the biggest difference. A few words of encouragement at the right moment can change someone's entire day, or even their life.

This project aims to be:

  • Simple: Easy to use and integrate
  • Positive: All content focuses on hope and strength
  • Accessible: Available in multiple languages
  • Free: Always available for anyone who needs it

πŸ†˜ Crisis Resources

If you are in immediate danger or having thoughts of self-harm, please reach out for professional help immediately.

International

United States

United Kingdom

Italy

Online Resources

Remember: Seeking help is a sign of strength, not weakness. You matter, and there are people who want to help you through this. πŸ’œ

πŸ™ Contributors

Thanks to everyone who has contributed to making StayStrong better:

  • @isaac0yen - Contributed to architecture improvements and code optimization
  • @LeCyreaxYT - Added German translation
  • @lock-pay - Added French translation

Want to join our contributors? Check out the Contributing section above!

πŸ“„ License

This project is open source. Feel free to use it, modify it, and share it to help spread positivity in the world.

πŸ’‘ Examples

Integration Examples

JavaScript/Fetch:

fetch('https://your-domain.com/reasons?lang=en')
  .then(response => response.json())
  .then(data => console.log(data.reason));

Python:

import requests

response = requests.get('https://your-domain.com/reasons?lang=it')
data = response.json()
print(data['reason'])

About

🌟 Simple API serving motivational reasons to help people through difficult moments. 500+ messages in multiple languages.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors 6