SyntaxSphere is a Django-based project that provides user authentication, including GitHub OAuth, and post management functionalities. This document outlines the available API endpoints and the required data for each endpoint.
/signup/
POST
{
"username": "string",
"email": "string",
"password": "string",
"first_name": "string",
"last_name": "string"
}
{
"refresh": "string",
"access": "string"
}
/signin/
POST
{
"username": "string",
"password": "string"
}
{
"refresh": "string",
"access": "string"
}
/signout/
POST
{
"refresh": "string"
}
HTTP 205 Reset Content
on success, HTTP 400 Bad Request
on failure.URL: /accounts/github/login/
Method: GET
Description: Redirect to GitHub for authentication.
Response: Redirects to GitHub login page.
URL: /accounts/github/login/callback/
Method: GET
Description: GitHub callback URL.
Response: Redirects to the application with the authentication result.
/posts/
GET
[
{
"id": "uuid",
"title": "string",
"url": "string",
"user_id": "string",
"posted_at": "datetime",
"like_count": "integer"
},
...
]
/posts/
POST
{
"title": "string",
"url": "string"
}
{
"id": "uuid",
"title": "string",
"url": "string",
"user_id": "string",
"posted_at": "datetime",
"like_count": "integer"
}
/posts/<uuid:id>/
GET
{
"id": "uuid",
"title": "string",
"url": "string",
"user_id": "string",
"posted_at": "datetime",
"like_count": "integer"
}
/posts/<uuid:id>/
DELETE
HTTP 204 No Content
on success./posts/<uuid:pk>/like/
POST
{
"id": "uuid",
"user_id": "string",
"post_id": "string"
}
/posts/<uuid:pk>/comments/
GET
[
{
"id": "uuid",
"user_id": "string",
"post_id": "string",
"comment": "string",
"posted_at": "datetime"
},
...
]
/posts/<uuid:pk>/comments/
POST
{
"comment": "string"
}
{
"id": "uuid",
"user_id": "string",
"post_id": "string",
"comment": "string",
"posted_at": "datetime"
}
git clone https://github.com/ahmeddelattarr/SyntaxSphere.git
cd SyntaxSphere
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
cd client
npm install
npm start
MIT License
© 2024 Ahmed elattar