AI Dream Chat API

Share dreams, get AI-powered interpretations, and connect with dreamers worldwide

http://127.0.0.1:5000

Quick Start

The AI Dream Chat API is a RESTful service that enables users to share dreams, discuss them with others, and receive AI-powered interpretations. Most endpoints require JWT authentication.

Authentication Header

Authorization: Bearer <your_token_here>

🔐 Authentication

POST /signup No Auth

Sign Up

Creates a new user account.

Request Body:

{
  "username": "Princess",
  "email": "adebisiqueen321@gmail.com",
  "password": "Queen44zzi"
}

Success Response (201):

{
  "status": "success",
  "message": "Account created successfully",
  "user": {
    "id": 1,
    "username": "Princess",
    "email": "adebisiqueen321@gmail.com",
    "created_at": "2025-10-10T14:30:00Z"
  }
}
POST /login No Auth

Login

Authenticates a user and returns a JWT token.

Request Body:

{
  "email": "adebisiqueen32@gmail.com",
  "password": "Loveth55"
}

Success Response (200):

{
  "status": "success",
  "message": "Login successful",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": 1,
    "username": "Princess",
    "email": "adebisiqueen32@gmail.com"
  }
}
POST /forget-password No Auth

Forgot Password

Initiates password recovery process by sending a reset link.

Request Body:

{
  "email": "adebisiqueen@gmail.com"
}

📝 Posts Management

POST /post Auth Required

Create Post

Creates a new dream post.

Request Body:

{
  "title": "I had a dream a book was handed over to me",
  "content": "I think i might be a choosen one"
}

Success Response (201):

{
  "status": "success",
  "message": "Post created successfully",
  "post": {
    "id": 1,
    "title": "I had a dream a book was handed over to me",
    "content": "I think i might be a choosen one",
    "author_id": 1,
    "author_username": "Princess",
    "created_at": "2025-10-10T14:35:00Z",
    "comment_count": 0
  }
}
GET /view-posts-comment No Auth

View All Posts and Comments

Retrieves all posts along with their comments.

GET /post/{post_id} No Auth

View Single Post

Retrieves details of a specific post.

PUT /post/{post_id}/edit Auth Required

Edit Post

Updates an existing post. Only the post author can edit.

Comments

POST /add-comment/{post_id} Auth Required

Add Comment

Adds a comment to a specific post.

Request Body:

{
  "comment": "funny it usually means you are madly in love"
}
GET /post/{post_id}/comments No Auth

View Comments on a Post

Retrieves all comments for a specific post.

👥 Groups

POST /groups Auth Required

Create Group

Creates a new discussion group.

Request Body:

{
  "name": "The Seers"
}

Success Response (201):

{
  "status": "success",
  "message": "Group created successfully",
  "group": {
    "id": 1,
    "name": "The Seers",
    "invite_link": "c4b675d8-8104-4ed3-b8d8-c6e0d9169a9d",
    "creator_id": 1,
    "creator_username": "Princess",
    "created_at": "2025-10-10T15:30:00Z",
    "member_count": 1
  }
}
POST /join/{invite_link} Auth Required

Join Group

Join an existing group using an invite link.

DELETE /groups/{group_id} Auth Required

Delete Group

Deletes a group. Only the creator can delete.

DELETE /groups/{group_id}/remover/{user_id} Auth Required

Remove Member

Removes a member from a group. Creator only.

POST /groups/{group_id} Auth Required

Send Message in Group

Sends a message to a group chat.

Request Body:

{
  "content": "Hello everyone welcome as a member"
}
GET /groups/{group_id}/messages Auth Required

View Group Messages

Retrieves all messages from a group chat.

✨ Dream Interpretation

POST /interpret Auth Required

Interpret Dream

Uses AI to interpret the meaning of a dream with cultural context.

Request Body:

{
  "dream": "i had a dream i was given a book what does it mean in yoruba land"
}

Success Response (200):

{
  "status": "success",
  "interpretation": "In Yoruba culture, dreaming of receiving a book...",
  "cultural_context": "Yoruba",
  "dream_id": 1,
  "interpreted_at": "2025-10-10T16:15:00Z"
}

📊 Error Codes

Status Code Description
200 OK - Request successful
201 Created - Resource created successfully
400 Bad Request - Invalid input or missing fields
401 Unauthorized - Authentication required
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
500 Internal Server Error
503 Service Unavailable

⚡ Rate Limiting

💡 Best Practices