Welcome to SlangAI, the official repository for the SLANGAI.CO application. SlangAI is a cutting-edge web app designed to revolutionize the way you interact with slang. Leveraging advanced AI technology powered by Gemini, SlangAI provides accurate and engaging translations, generating slang sentences, and exploring the etymology of various slangs. This app is perfect for developers, writers, linguists, and anyone fascinated by the ever-evolving world of slang.
You can find a short demo of the App below. Feel free to check it out yourself at https://slangai.co/.
SlangAI.Demo.Final.mp4
The demo is also uploaded on YouTube. Check it out!
SlangAI offers the Know the Section that instantly finds the full forms and meanings of a given slang.
This section offers users four new slang words daily, complete with their meanings and example sentences to illustrate their usage. The slang words are refreshed every day at 00:00 UTC.
This section enables the users to dive deep into the origins, evolution over time, and the cultural impact of a given slang.
In this section, the users can input a sentence that contains one or more slang terms and get it translated instantly to standard English.
This section randomly generates a sentence with slang and also provides its meaning for creative inspiration.
This app utilizes ShepherdJS to offer users a guided tour of its various functional sections, providing contextual information as soon as the webpage loads without any user intervention to start the tour.
The App also uses ShepherdJS in the Slang Etymology section to display the results to the user. Here, as soon as the user clicks any of the headers in the result panel i.e., Origin or Evolution or Cultural Impact, it opens a tour step that shows the brief description of the header.
The ShepherdJS Tour window has been modified with CSS to match the app brand colors and maintain the aesthetics.
If the user completes the tour fully, then the tour is not shown again. A value named tour_complete
is marked as TRUE
and is stored in the local storage with a validity of 1 hour. The tour is shown again only after this value has expired i.e., after an hour.
The App has its caching mechanism in place to retrieve the results faster and keep the API limits for Gemini under control.
Caching is in use for the following sections in the App.
The cached data is stored in the local storage and stays valid for a maximum of 24 hours.
The App has implemented robust error handling to enhance the user experience and deliver clearer logs to troubleshoot in case of any failures.
The app has a separate endpoint that serves as a health check update. When a user hits this endpoint, the server returns a 200 status if it is up and running.
The app has also used input validation to restrict misuse of the input forms and also has an animated loading screen to imply that the response is currently under processing.
- Clone the repository:
git clone https://github.com/Rutam21/slangai.git
- Navigate to the project directory:
cd slangai
- Install the dependencies:
npm install
- Create a
.env
file with all the variables and their correct values as mentioned in the.env.example
file.
- Start the development server:
npm start
- Open your browser and navigate to
http://localhost:3000
.
-
POST /getSlang
- Description: Provides the full form and meaning of the input slang.
- Request Body: JSON object with a
text
field. - Response: Slang Details.
-
GET /slangData
- Description: Fetches 4 slangs that are updated daily at 00:00 UTC.
- Response: JSON Array object with daily slangs, their meanings, and an expale sentence using them.
-
POST /getSlangEtymology
- Description: Provides the etymology of a given slang.
- Request Body: JSON object with a
text
field. - Response: Etymology of the slang containing its Origin, Evolution, and Cultural Impact.
-
POST /getSlangslator
- Description: Translates a given sentence with slangs to standard English.
- Request Body: JSON object with a
text
field. - Response: Standard English translation of the Slang Sentence.
-
GET /getSlangtence
- Description: Fetches a random slang sentence.
- Response: JSON object with
slangtence
andmeaning
.
-
GET /health
- Description: Server health check endpoint.
- Response: Server health status.
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using SlangAI! If you have any questions or feedback, feel free to open an issue or submit a pull request. Enjoy exploring and learning slang!