This is a simple Flask API application with endpoints to create, retrieve, and update user profiles.
- Python 3.6+
- Flask 2.0.1
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the dependencies:
pip install -r requirements.txt
-
Start the Flask application:
python app/app.py
-
The application will be running at
http://127.0.0.1:5000/
.
- URL:
/users
- Method:
POST
- Request Body:
{ "id": 1, "name": "John Doe", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" }
- Response:
{ "id": 1, "name": "John Doe", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" }
- URL:
/users
- Method:
GET
- Response:
{ "1": { "name": "John Doe", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" } }
- URL:
/users/{userId}
- Method:
GET
- Response:
{ "name": "John Doe", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" }
- URL:
/users/{userId}
- Method:
PUT
- Request Body:
{ "name": "John Smith" }
- Response:
{ "name": "John Smith", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" }
- URL:
/example_user
- Method:
GET
- Response:
{ "id": 1, "name": "John Doe", "bio": "A software developer with 10 years of experience.", "skills": ["Python", "Flask", "JavaScript"], "profile_picture": "http://example.com/profile.jpg", "github_gitlab": "http://github.com/johndoe" }
Swagger UI is available at http://127.0.0.1:5000/swagger
.