Giter VIP home page Giter VIP logo

nodejs-typescript-aws-s3-file-storage's Introduction

File Storage on AWS S3

A Rest API to save, retrieve and delete files from AWS S3 cloud storage and save information on SQlite using Prisma ORM

Environment Variables

Duplicate the .env.example and make sure the file is called .env

Amazon AWS Settings

  • Sign Up to Amazon AWS using their 1-year free tier
  • On AWS, go to the IAM service
    • Create a new user
    • For "AWS credential type", make sure to select at least "Access key - Programmatic access"
    • In the Permissions screen, we need the "AmazonS3FullAccess" permissions. Either create a group to attach permissions and add your user or give your user this permissions directly
    • Copy both "Access key ID" and "Secret access key" to the corresponding keys in your .env file
  • Go to the S3 service and click to create a bucket
    • The name must be unique in all amazon aws
    • Select the region closest to you to reduce any network delays and TAKE note of that because after 1 year you will start being charged if you did not delete your things.
    • For this example, uncheck the checkbox "Block all public access" to allow public access to your bucket
    • Click on "Create Bucket"
    • Save the name of the bucket and region chosen in the .env file corresponding key

Insomnia Settings

  • Import insomnia-aws-s3.json into Insomnia

Installation

yarn

Prisma Configuration

The file data/prisma/schema.prisma is the place where you should define your all your table schemas

Create your tables using Prisma

Before running your app execute the following terminal command to generate your tables on SQLite.

yarn prisma migrate dev

This should be done regardless of the DB you are using.

Running the Application

yarn dev

Routes

nodejs-typescript-aws-s3-file-storage's People

Contributors

anderson-0 avatar

Watchers

 avatar

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.