-
Complete test driven development using testify
-
Migrations based DB setup using golang migrate
-
Redis with background processors for mail handling
-
PostgreSQL and Redis Dockerized at Alpine lightweight image
-
DB Mock being used to isolate dependencies [Mockgen]
-
SQLC generation
-
AWS
-
Cron Job for asset scheduled deletion [Hourly]
-
Graceful shutdown to prevent crashes
and many more...
Feel free to checkout the code.
Pointer wise explanation :- Requirements:
- User Authentication & Authorization:
-
Implemented an advanced safe and secured Paseto token based auth with tests in token package . Helps offer clear distinction between private and public tokens
- File Upload & Management:
- Used AWS SDK for Go to upload objects and retrieve location and metadatas
- Localised aws config for safe access key auth
- File Retrieval & Sharing:
- Location is stored in postgresql for further retrieval
- File Search:
- Has search function based on Coalace and sqlc args for a flexible search of file based on need
- Database Interaction:
- Used Postgresql and sqlc with mocks for file details handling and mapping
- Tests to keep DB operations in sync
- Background Job for File Deletion:
- Utilized cron job to run deleter function @hourley
- Testing: Complete app is test driven which is pretty evident
- Redis:
- Redis setup with Task processor and Distributor using Asynq for background workers
Clone the repo to your local
Start your Docker Engine
Install Docker dependency Images for Postgres and Redis Alpine Images [ If not installed already ]
make docker
make redis
Configure AWS IAM config details to access AWS Services .
- Install aws cli
- Create a S3 Bucket in AWS Console
- Create a IAM User role and attach policy to access S3 Buckets with the IAM role user
- Download and record the Access key ID and Secret Access key
- Now enter in the prompt when asked after
aws config
Launch the images
make launch
Start the server
make server