Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashirbadgudu/nodejs-aws-s3-with-mongodb-typescript
API for uploading images into S3 bucket with typescript and mongodb
https://github.com/ashirbadgudu/nodejs-aws-s3-with-mongodb-typescript
aws aws-s3 aws-sdk mongodb mongoose multer nodejs s3 typescript
Last synced: 2 days ago
JSON representation
API for uploading images into S3 bucket with typescript and mongodb
- Host: GitHub
- URL: https://github.com/ashirbadgudu/nodejs-aws-s3-with-mongodb-typescript
- Owner: AshirbadGudu
- Created: 2023-03-11T11:28:49.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T11:35:20.000Z (almost 2 years ago)
- Last Synced: 2024-11-20T11:07:15.168Z (2 months ago)
- Topics: aws, aws-s3, aws-sdk, mongodb, mongoose, multer, nodejs, s3, typescript
- Language: TypeScript
- Homepage:
- Size: 47.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS AWS S3 API With MongoDB & TypeScript
## Step By Step Process For Creating
### Create Project With `yarn`
```sh
yarn init -y
```### Create a `.gitignore` file
```sh
touch .gitignore
```### Add following content to `.gitignore`
```gitignore
# Node.js
node_modules/
npm-debug.log
yarn-error.log
*.env# TypeScript
*.js.map
*.tsbuildinfo
dist/
```### Add the `typescript` dependencies
```sh
yarn add -D typescript ts-node @types/node
```### Create `tsconfig.json` file
```sh
touch tsconfig.json
```### Add the following to `tsconfig.json`
```json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "./dist",
"sourceMap": true
},
"exclude": ["node_modules", "**/*.spec.ts"]
}
```### Add the scripts to the `package.json` file
```json
{
"scripts": {
"start": "node ./dist/index.js",
"dev": "nodemon --exec ts-node ./src/index.ts",
"build": "tsc"
}
}
```### Create a proper folder structure
> Create Folders
```sh
mkdir -p src/{configs,controllers,helpers,middleware,models,routes,types,validations}
```> Create `index.ts` files
```sh
touch src/index.ts
touch src/configs/index.ts
touch src/controllers/index.ts
touch src/helpers/index.ts
touch src/middleware/index.ts
touch src/models/index.ts
touch src/types/index.ts
touch src/validations/index.ts
```### Add required dependencies and dev dependencies
```sh
yarn add @aws-sdk/client-s3 @aws-sdk/s3-request-presigner cors dotenv express express-validator mongoose multer
yarn add -D @types/cors @types/express @types/multer
```