Giter VIP home page Giter VIP logo

jungle-test's Introduction

Technical Assignment Completion

This application allows you to upload and store images tied to a specific user. It was built using clean architecture and SOLID principles for future scalability.

  • Folder "cmd" contains the main entry point of the application.
  • Folder "config" contains environment variables necessary for the application to function.
  • Folder "internal" contains the "app" folder which has the file that starts all the necessary dependencies for the application to function. Migrations are also located here.
    • Folder "controller" contains everything for receiving data from the internet, including middleware for basic authorization, handlers, routers, and entities for requests and responses.
    • Folder "database" contains the file for working with the database.
    • All entities are located in the "entity" folder.
    • The services are located in the "service" folder.
  • In the "migrations" folder, there are SQL schemas of entities
  • The 'pkg' folder contains files with external dependencies for implementing clean architecture. They are replaced with interfaces and structures that implement them, allowing for easy substitution at any time

Test Routes

  • To run the project, utilize the docker-compose file located in the ".docker" folder.
  • For testing purposes, you can make use of the Postman collection in the ".postman" folder.

Endpoints

  1. Register user. A test user is automatically added to the database {"username":"TEST USER", "password": " 1234567890"}, but if you want to create your own, I have added a corresponding endpoint.

  2. Login user

  3. Upload Image

  4. Get all images

створити сервіс у якому

  • POST /login {"username": "test", "password": 123456} Response: {"token": "jwt string"} юзер зможе залогінитись( припустимо що юзер уже є в бд, і для цього треба буде ствоирит запис в бд вручну) та отримати jwt токен який живе 12 годин. усі логіни зберігати в табличці users [id, username, password_hash]
  • POST /upload-picture - завантажити фото, та зберегти її у файл, а урл зберегти в базу даних в табличку images [id, user_id, image_path, image_url]
  • GET /images - отримати масив усіх своїх картинок

/upload-picture /images

має мати middleware який буде перевіряти чи валідний токен той який юзер отримав при авторизації. Токен має передатись в хедері Authorization: Bearer {jwt token here}

jungle-test's People

Contributors

bogdanstaziyev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.