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.
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
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. π€
# 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).
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
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 toen
.
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"
}
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
- English (
en
) - 500 motivational reasons - Germany (
de
) - 500 motivational reasons - Italian (
it
) - 500 motivational reasons - Arabic (
ar
) - 460 motivational reasons
- 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)
Want to help make StayStrong better? Here are some ways to contribute:
- Create a new JSON file in the
reasons/
directory (e.g.,fr.json
for French) - Add an array of motivational reasons in that language
- Run
npm run compile-lang
to update the combined language file - Update the
supportedLangs
documentation
- Edit the appropriate language file in the
reasons/
directory - Add new motivational messages to the JSON array
- Run
npm run compile-lang
to update the combined language file - Ensure all messages are positive, supportive, and appropriate
- Submit bug fixes
- Improve error handling
- Add new features (while keeping the API simple)
- Improve documentation
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
If you are in immediate danger or having thoughts of self-harm, please reach out for professional help immediately.
- International Association for Suicide Prevention: https://www.iasp.info/resources/Crisis_Centres/
- Crisis Text Line: Text HOME to 741741 (US, UK, Canada)
- 988 Suicide & Crisis Lifeline: 988 or https://988lifeline.org/
- Crisis Text Line: Text HOME to 741741
- Samaritans: 116 123 (free) or https://www.samaritans.org/
- Crisis Text Line UK: Text SHOUT to 85258
- Telefono Amico Italia: 02 2327 2327 or https://www.telefonoamico.it/
- Samaritans Onlus: 06 77208977 or http://www.samaritansonlus.org/
- 7 Cups: Free emotional support - https://www.7cups.com/
- BetterHelp: Professional online therapy - https://www.betterhelp.com/
- Mental Health America: https://www.mhanational.org/
Remember: Seeking help is a sign of strength, not weakness. You matter, and there are people who want to help you through this. π
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!
This project is open source. Feel free to use it, modify it, and share it to help spread positivity in the world.
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'])