Skip to content

Managing a to-do list, without needing to host a server and maintaining it.

License

Notifications You must be signed in to change notification settings

michelonfelipe/serverless-to-do-list

Repository files navigation

Serverless to-do list

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

Setup

The base requirements are:

Installing global dependencies

To install serverless framework, run:

npm install -g serverless

NOTE: the version used on this project was 1.82.0.

Installing local dependencies

To install local dependencies, run:

npm install

AWS configuration

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.

Setting up the React app

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

Deploying

Lambdas

To deploy the lambas, run:

serverless deploy

React app

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.

Testing

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

Project architecture

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: Project Architecture

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.

License

MIT-LICENSE

About

Managing a to-do list, without needing to host a server and maintaining it.

Resources

License

Stars

Watchers

Forks