Simple Portfolio App is a basic example at how to use Serverless architecture for building a project.
This app took around 20 hours.
The following software will be necessary for running the app
- Docker
- Docker compose(Only if you are running this app on MacOS you need to install separately).
Note: Please make sure that you have enough space to install it, at least 2.5Gb.
Open a terminal at the root app folder and use one of the following options to start the app:
- Run the command
docker compose up -dwith which you'll be able to watch the output log. - Run the command
docker compose up(whitout-dflag).
Once you type the command, please wait for a while. The first time may take a few minutes.
Open a terminal at the root app folder and use one of the following options to start the app:
- Run the command
docker compose downas long as you started the app with the previous option1. - Run the keys combination
Ctrl + Cas long as you started the app with the previous options2.
Make sure you have the same/higher version of the following tools:
node@12.x.xnpm@6.x.x
If you want run the app avoiding to use docker, please follow the steps below at the root app folder:
npm install -g serverless@1.83.3: Install Serverless framework.npm install: Install all dependencies.serverless dynamodb install: Install DynamoDb serverless plugin.serverless plugin install --name serverless-s3-local: Install S3 serverless plugin.npm run build: Check if there are errors.npm start: Run the app.
Open a terminal at the root app folder and use the commands below:
npm installnpm test
Open the file /apidoc.html which is based on OpenApi3 to explore the API docs, then you can use any tools that you consider good enough for testing APIRest. Let me recommend you Postman(you can use the file ./postman_collection.json to import the requests and test them easily).