Coder Social home page Coder Social logo

christophermontero / spacelogix Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 295 KB

SpaceLogix is a cutting-edge logistics system that specializes in managing and optimizing space-related operations with the power of RESTful APIs.

License: Apache License 2.0

JavaScript 0.58% Shell 0.06% Dockerfile 0.19% TypeScript 99.16%

spacelogix's Introduction

SpaceLogix

Project description

SpaceLogix is a cutting-edge logistics system that specializes in managing and optimizing space-related operations with the power of RESTful APIs.

Architecture

Use cases

use case diagram

Deployment

deployment diagram

Features

For see full documentation, please visit SpaceLogix API docs

Requirements

  • Node.js version: 14.21.3
  • NestJS version: 8.0.0
  • Docker version: 24.0.7
  • Docker compose version: 2.21.0
  • Yarn version: 1.22.21

User guide

Endpoints

This API is composed for the following services:

Authorization

  • POST /api/v1/auth/signup
  • POST /api/v1/auth/signin
  • GET /api/v1/auth/signout

User

  • GET /api/v1/users/me
  • PATCH /api/v1/users

Product

  • POST /api/v1/products
  • DELETE /api/v1/products/:productId
  • PATCH /api/v1/products/:productId
  • GET /api/v1/products
  • GET /api/v1/products/:productId

Order

  • POST /api/v1/orders
  • GET /api/v1/orders/:orderId
  • GET /api/v1/orders
  • DELETE /api/v1/orders

MongoDB document schemas

User Schema

This object is a representation for product user:

{
  "_id": "65a02b00d4c97df504ad5edc",
  "name": "supplier1",
  "email": "[email protected]",
  "hashedPassword": "$2b$10$FRrxHESMToFtDj7USDR5Ke8Oletm7byHW5QcYDsHZBofeM44rIJpy",
  "phone": "98765432",
  "address": "fake st. 123",
  "city": "supplier1 city",
  "country": "supplier1 country",
  "role": "supplier",
  "createdAt": "2024-01-11T17:53:04.311Z",
  "updatedAt": "2024-01-11T17:53:04.311Z",
  "__v": 0
}

Product schema

This object is a representation for product schema:

{
  "_id": "65a02b39d4c97df504ad5ee3",
  "name": "product 1",
  "description": "product description",
  "price": 1000,
  "currency": "usd",
  "stock": 98,
  "supplier": {
    "name": "supplier1",
    "email": "[email protected]",
    "phone": "98765432",
    "address": "fake st. 123",
    "city": "supplier1 city",
    "country": "supplier1 country"
  },
  "createdAt": "2024-01-11T17:54:01.797Z",
  "updatedAt": "2024-01-11T17:55:16.065Z",
  "__v": 0
}

Order schema

This object is a representation of order schema:

{
  "_id": "65a02b84d4c97df504ad5eee",
  "products": [
    {
      "name": "product 1",
      "description": "description",
      "price": 1000,
      "currency": "usd",
      "quantity": 2,
      "supplier": {
        "name": "supplier1",
        "email": "[email protected]",
        "phone": "98765432",
        "address": "fake st. 123",
        "city": "supplier1 city",
        "country": "supplier1 country"
      },
      "_id": "65a02b84d4c97df504ad5eef"
    }
  ],
  "customer": {
    "name": "customer1",
    "email": "[email protected]",
    "phone": "98765432",
    "address": "fake st. 123",
    "city": "customer1 city",
    "country": "customer1 country"
  },
  "transporter": {
    "name": "transporter1",
    "email": "[email protected]",
    "phone": "98765432",
    "address": "fake st. 123",
    "city": "transporter1 city",
    "country": "transporter1 country"
  },
  "payment": {
    "paymentMethod": "credit",
    "cardNumber": "12345678",
    "expirationDate": "2025-12-31",
    "cvv": "123",
    "billingAddress": {
      "country": "billing country",
      "city": "billing city",
      "address": "fake st. 123",
      "zipCode": "billing zip code"
    },
    "totalAmount": 200,
    "currency": "usd"
  },
  "createdAt": "2024-01-11T17:55:16.079Z",
  "updatedAt": "2024-01-11T17:55:16.079Z",
  "__v": 0
}

Install guide

Below are the instructions to install and run the project in development mode.

git clone https://github.com/christophermontero/spacelogix.git
cd spacelogix

Make sure you have MongoDB running before start the project in development mode.

yarn start:dev

Run tests

For run unit tests use the following command.

yarn test

And for end to end tests, ensure have database running, then use the following command.

yarn test:e2e

Containers

This project supports Docker. To use the API with containers, follow these steps:

  1. Ensure you have Docker and Docker Compose installed on your system.

  2. Set the database connection in the app.module.ts file to: mongodb://mongodb:27017/spacelogixdb.

  3. Run the following commands:

docker compose -f docker.compose.yml -f docker-compose.dev.yml up -d

And for production run the following:

docker compose -f docker.compose.yml -f docker-compose.prod.yml up -d

For stop the containers run the following:

docker compose -f docker.compose.yml -f docker-compose.dev.yml stop

And for destroy the services use the following command:

docker compose -f docker.compose.yml -f docker-compose.dev.yml down

Comments

If you have any feedback, please reach out at [email protected]

License

This project is under Apache License.

Author

spacelogix's People

Contributors

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