Skip to content

Latest commit

 

History

History
142 lines (93 loc) · 3.25 KB

File metadata and controls

142 lines (93 loc) · 3.25 KB

Blast upload

Overview

This project was built to practice cloud computing concepts using AWS services. It follows object-oriented programming principles and applies software development best practices, focusing on scalability and code quality.


Tech Stack

  • Node.js
  • TypeScript
  • AWS SDK
  • EC2
  • S3
  • Redis
  • Docker
  • Express
  • Git
  • GitHub Actions
  • Husky
  • Prettier
  • ESLint
  • Zod
  • Jest
  • Supertest

Features

  • Upload a single file
  • Upload multiple files at once
  • Delete files
  • Get file metadata (name, size, etc.)
  • List all files
  • Filter files by type (e.g., PDF, JPEG)

API Endpoints

  • POST /api/v1/files/upload
    Upload a single file to S3.

  • POST /api/v1/files/multi-upload
    Upload multiple files at once to S3.

  • GET /api/v1/files/:id
    Get file metadata by ID.

  • GET /api/v1/files
    List all uploaded files.

  • DELETE /api/v1/files/:id
    Delete a file by ID.


Running Locally

  1. Make sure you have Node.js and Docker installed.
  2. Clone the repository:
    git clone https://github.com/hebertsanto/upload-s3.git
  3. Install the dependencies:
    npm install
  4. Create a .env file with your AWS S3 credentials.
    You can use .env.exemple as a reference.
  5. Start the server:
    npm run dev

Running with Docker

  1. Build the image:
    npm run docker:build
  2. The application Docker image will be created automatically.

Running Tests

  • Run integration tests:
    npm run tests:integration

  • Run unit tests:
    npm run tests:unit


CI/CD (GitHub Actions)

Lint

This pipeline ensures code style consistency and quality using ESLint and Prettier.

Build

Transpiles TypeScript to JavaScript and builds the Docker image of the project.


AWS S3 Console - Uploaded Files

Screenshot


AWS EC2 - Request Samples

File by ID

file-id

Health Check Route

health-route


Future Improvements

This project has room for improvement and evolution. Some next steps include:

  • Decouple external services (e.g., AWS SDK, Redis) using dependency inversion.
  • Add a domain layer following Domain-Driven Design (DDD) principles.
  • Refactor to a cleaner, layered architecture.
  • Improve unit and integration test coverage.

References


Conclusion

Through this project, I gained hands-on experience with Docker, deepened my understanding of cloud computing, and explored application deployment with AWS. To simulate a real-world high-traffic scenario, I also implemented caching with Redis. This is a project I plan to keep improving as I learn more.