Managing a to-do list, without needing to host a server and paying maintaining it.
This app is based on serverless example aws-node-rest-api-with-dynamodb
The base requirements are:
To install serverless framework, run:
npm install -g serverless
NOTE: the version used on this project was 1.82.0.
To install local dependencies, run:
npm install
To run the app, you will need to configure both AWS access key and secret.
As written on serverless documentation, this app was built to use AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
variables.
To set up the react app, you need to enter it's directory, install it's dependencies, set the env vars, and run the build command, as the following:
# from the project root directory
cd src/todo-app
npm install
cp .env.sample .env
# after creating .env file, you need to fill every var before running the next command
npm run build
To deploy the lambas, run:
serverless deploy
To deploy the React app, run:
serverless client deploy
NOTE: Remember that you will need to re-build the app every time you make a change, and want to deploy it again.
To run lambdas tests, run:
sls invoke test
To run react app tests, enter the directory, start the server and run tests with cypress:
# from the project root directory
cd src/todo-app
npm start
# while the app is running, run this for testing on the command line:
npx cypress run
# while the app is running, run this for testing with the interface assistant:
npx cypress open
This project is a POC of running simple tasks on a serverless architecture, while trying to keep it running free or at an extremely low cost. This is an illustration of how it's designed today:
Users can use a globally shared todo list using the react app, as a frontend (stored on S3), or doing web request directly to the API Gateway. After that, a lambda is triggered (depending on the path that was requested), and do an action using the dynamoDB.