Giter VIP home page Giter VIP logo

serverless-to-do-list's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.