https://github.com/yashokuu/aura-alpha
Aura is a Flask-based API that allows users to upload and retrieve random memes. Users can upload memes with a title and image (via URL or file upload). The API includes token-based authentication for secure access, ensuring that only authorized users can upload and retrieve memes.
https://github.com/yashokuu/aura-alpha
api api-demo flask flask-api meme-generator python
Last synced: 4 months ago
JSON representation
Aura is a Flask-based API that allows users to upload and retrieve random memes. Users can upload memes with a title and image (via URL or file upload). The API includes token-based authentication for secure access, ensuring that only authorized users can upload and retrieve memes.
- Host: GitHub
- URL: https://github.com/yashokuu/aura-alpha
- Owner: yashokuu
- License: other
- Created: 2024-09-19T08:39:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-25T05:39:26.000Z (5 months ago)
- Last Synced: 2025-02-12T16:33:22.646Z (4 months ago)
- Topics: api, api-demo, flask, flask-api, meme-generator, python
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Aura - Meme API
## Description
**Aura** is a Flask-based API that allows users to upload and retrieve random memes. Users can upload memes with a title and image (via URL or file upload). The API includes token-based authentication for secure access, ensuring that only authorized users can upload and retrieve memes.
## Features
- **Upload Memes**: Upload memes using a title and image URL or file.
- **Random Meme**: Retrieve a random meme from the collection.
- **Token-Based Authentication**: Secure API access using tokens.
- **Token Generation**: Easily generate tokens to access the API.## Endpoints
### 1. Generate Token
**Endpoint**: `/generate_token`
**Method**: `GET`
**Description**: Generates a new token for accessing the API.**Response**:
```json
{
"token": "your-generated-token"
}
```### 2. Upload Meme
**Endpoint**: `/api/upload?token=YOUR_TOKEN`
**Method**: `POST`
**Description**: Upload a meme by providing a title and an image (via URL or file).**Form Data**:
- `title`: The title of the meme.
- `img`: The meme image URL or file.**Example**:
```bash
curl -X POST -F 'title=Funny Meme' -F 'img=https://example.com/meme.png' "http://localhost:5000/api/upload?token=YOUR_TOKEN"
```### 3. Get Random Meme
**Endpoint**: `/api/meme?token=YOUR_TOKEN`
**Method**: `GET`
**Description**: Retrieves a random meme in JSON format.**Response**:
```json
{
"title": "Funny Meme",
"img": "https://example.com/meme.png"
}
```## How to Run the Project
1. Clone the repository:
```bash
git clone https://github.com/siyam-yas/aura-alpha.git
```2. Navigate to the project directory:
```bash
cd aura-meme-api
```3. Create a virtual environment and activate it:
```bash
python -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windows
```4. Install the required dependencies:
```bash
pip install -r requirements.txt
```5. Run the Flask app:
```bash
python api.py
```6. Access the app at `http://localhost:5000`.
## Technologies Used
- Flask
- Python
- JSON for data storage## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.