What you will build
A portfolio project which can be used as a CV as well. Here you will be able to showcase some of your projects with pictures attached, list your acquired skills, bio etc.
What you will learn
- How to work with the Basic auth
- How to make HTTP requests to a RESTful API service
- How to upload images to an S3 AWS bucket using a presigned link
- How to work with OpenAPI specs
- How to make authenticated requests
Learning the available API endpoints for the project
It contains an openapi.yaml
file. You will need to open it using your IDE of choice, because it uses AWS Schema validation files from repository for requests description.
For VS Code I recommend using extension, when opened the yaml file you will be able to click
on the icon in the top right corner to see the preview (same as for markdown files).
For Intellij users you could use the plugin.
Recommended resources to read
Image upload process
Several API endpoints such as /profile
and /projects
can accept a link to an image. It can be any string in general.
In order to upload the image you will need to use the /image
endpoint. When submitted filename, it will return url
and uploadUrl
.
The first one is used as a link to pass to the aforementioned endpoints, the latter one is for the PUT request with the image (this will make the actual image upload).
After the image was uploaded you can make the request to save profile/projects with the newly uploaded image.
API excerpts
Profile
{
"name": "string",
"location": "string",
"contacts": [
{
"type": "string",
"value": "string"
}
],
"profileImg": "string"
}
Projects
[
{
"title": "string",
"description": "string",
"descriptionShort": "string",
"images": [
"string"
],
"links": [
{
"url": "string",
"type": "string"
}
]
}
]
Tech stack
The API is deployed to the AWS using Serverless framework. It will create:
- CloudFormation stack to create all required resources
- Lambda functions exposed under single API gateway
- DynamoDB database to store the data
- S3 bucket to store the deployed resources
- Access policies for the resources to work properly
This should fall into the AWS Free Tier limitations.
After 12 month of AWS Free Tier you will be chared for S3 Bucket resource, though the charge should be low you can always remove all created resources (see "Remove the service" section).
This is not a production ready project, so don't put in any sensitive data as it may be exposed.