Giter VIP home page Giter VIP logo

stori's Introduction

This README provides comprehensive instructions for setting up and understanding the Stori Challenge project, tailored for a senior backender software engineer in Python. The project adheres to the MIT standard for open-source software.

Installation

Docker Instructions

To set up the project using Docker, follow these steps:

Build the Docker image and run the container:

docker build -t stori-challenge .
docker-compose up --force-recreate --build

Note: Execute all processes to ensure correct functionality.

Endpoints

The project includes the following endpoints:

Body:

{
    "email_recipient": "[email protected]"
}

Response:

{
    "http_message": "SUCCESS",
    "message": "Email sent successfully.",
    "summary_balance": {
        "total_balance": 50.24,
        "month_data": [
            [
                "July",
                3,
                50.5,
                -10.3
            ],
            [
                "August",
                2,
                10.0,
                -25.23
            ]
        ]
    }
}


This is going to send an email with the summary balance from the CSV file.

image

Amazon S3 Integration

The project includes features for uploading and downloading files to/from Amazon S3. Follow these steps to set it up:

Complete the Amazon S3 credentials in the .env file:

S3_AWS_REGION=
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET_NAME=

Edit the /setup/infrastructure/aws_s3.py file to match your project. Update methods:

put_file_in_s3(**args) (line 24)

download_file_from_s3(**args) (line 42)

Project Structure

The project's directory structure is organized as follows:

stori-challenge
├─ .gitignore
├─ docker-compose.yml
├─ Dockerfile
├─ gunicorn.conf.py
├─ manage.py
├─ readme.md
├─ requirements.txt
├─ setup
│  ├─ asgi.py
│  ├─ async_task.py
│  ├─ infrastructure
│  │  ├─ aws_logging.py
│  │  ├─ aws_s3.py
│  │  └─ celery.py
│  ├─ response_formatter.py
│  ├─ settings.py
│  ├─ urls.py
│  ├─ views.py
│  ├─ wsgi.py
│  └─ __init__.py
├─ start-container.sh
├─ stori
│  ├─ ...
├─ supervisord.conf
└─ temp
   ├─ stori_transaction_data.csv
   ├─ ...

Architecture Overview

The core stori Django app encompasses various components:

adapters.py: Interacts with external services and APIs.

admin.py: Configures Django admin for models.

apps.py: Manages app-specific configurations.

async_tasks.py: Contains asynchronous task functions.

domains.py: Holds domain models and business logic.

migrations: Manages Django database migrations.

models.py: Defines Django models.

serializer.py: Manages serialization and deserialization.

services.py: Manages business logic and services.

tests.py: Contains tests for the app.

urls.py: Manages URL routing for app views.

views.py: Defines views and their behavior.

The setup directory includes setup and configuration files:

asgi.py, wsgi.py: Django ASGI and WSGI configurations.

async_task.py: Configuration for asynchronous tasks, possibly using Celery.

infrastructure: Manages interactions with external infrastructure.

response_formatter.py: Used for formatting API responses.

settings.py: Django project settings.

urls.py, views.py: Main project URL routing and views.

Additional Files and Directories:

.arm.requirements: Requirements specifically for deployment.

.devcontainer: Configuration for Visual Studio Code (VSCode) development container.

.gitignore: Specifies ignored files and directories.

.vscode: VSCode configuration files.

docker-compose.yml: Docker Compose configuration.

Dockerfile: Instructions for building the Docker image.

gunicorn.conf.py: Gunicorn (WSGI server) configuration.

manage.py: Django management script.

readme.md: This file, offering project overview and instructions.

requirements.txt: List of Python dependencies.

start-container.sh: Script to launch the Docker container.

supervisord.conf: Supervisor (process control) configuration.

temp/.ignore: File to save S3 files temporarily. For this challenge csv files are saved in this directory.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the license terms.

stori's People

Contributors

jose-cabrera-fullstack 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.