Uploadie
A nodejs express backend to upload images on Amazon S3 Bucket and shorten its URL
Technologies/Libraries Used
- Nodejs
- Typescript
- Express
- MongoDB
- AWS SDK
- S3 Bucket
- Bcrypt
Setup
- Nodejs and Typescript should be installed globally on system.
- Clone the project
- Create a .env file and paste the following content
DATABASE_NAME='MONGODB DATABASE NAME HERE'
DATABASE_URL='MONGODB DATABASE URL HERE'
AGENDA_DATABASE_URL= 'MONGODB AGENDA DATABASE URL HERE'
PORT = 'PORT NUMBER E.G. 4000'
ENV_NAME='testing/prod'
JWT_SECRET_TOKEN= 'SECRET HERE'
AWS_ACCESS_KEY =AWS ACCESS KEY HERE'
AWS_SECRET_KEY ='AWS SECRET KEY HERE'
- Run npm install to install all necessary packages required.
- Run npm run dev to start the app.
API Endpoints
- /user/login - Login the user
- /user/add - Registers a user
- /user/get-details - Get a user's detail
- /user/change - Change password
- /file/add - Adds an image file to the AWS S3 Bucket, shorten its url and return it
- /file/delete - Delete an image from MongoDB and AWS s3 bucket
- /file/all - Returns all images af an user
- /:urlId - takes an id and return the actual URL of the image