Giter Club home page Giter Club logo

emporion's Introduction

Emporion API

The Emporion API is a transactional backend designed to handle various operations related to users, products, and orders.

Design Principles

The API is designed with the following principles in mind:

  1. RESTful: The API follows the principles of Representational State Transfer (REST). It uses standard HTTP methods like GET, POST, PUT, DELETE to perform operations on the resources.

  2. Resource-Oriented: Each entity like a user, product, or order is considered a resource and has a corresponding endpoint.

  3. Stateless: Each request from the client to the server must contain all the information needed to understand and process the request.

  4. Client-Server Architecture: The client and the server are separate entities that communicate over HTTP. This separation allows the client and server to be developed and deployed independently.

  5. Layered System: The architecture is composed of multiple layers, each with specific responsibilities. This separation of concerns aids in maintainability and scalability.

API Endpoints

Here are some of the main endpoints provided by the API:

  • GET /users/{id}: Fetches the details of a user with the given ID.
  • POST /register: Registers a new user.
  • POST /login: Authenticates a user and returns a token.
  • GET /products: Fetches a list of all products.
  • POST /cart/checkout: Processes a user's cart and places an order.

Diagram

sequenceDiagram
    participant U as User
    participant S as API Server
    participant P as Postgres DB

    U->>S: GET /users/{id}
    U->>S: POST /register
    U->>S: POST /login
    U->>S: GET /products
    U->>S: POST /cart/checkout
    S->>P: SELECT * FROM users WHERE id = $1
Loading

Database

The API uses a Postgres database to store and retrieve data. The database schema is designed to efficiently support the API operations.

Testing

The API includes unit tests to ensure the correctness of the code. The tests are located in the service directory, with each service having its own test file.

emporion's People

Contributors

tibrezus 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.