Skip to content

Api for uploading images using AWS cloud services, among them are S3 for data storage and EC2 to run the application in the cloud, concepts with dockerization of the application and good practices in software development were also used

Notifications You must be signed in to change notification settings

hebertzin/blast-upload

Repository files navigation

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.

About

Api for uploading images using AWS cloud services, among them are S3 for data storage and EC2 to run the application in the cloud, concepts with dockerization of the application and good practices in software development were also used

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages