Giter Site home page Giter Site logo

quad-dash-api's Introduction

📉Quad Dash API

Backend provided to e-commerce companies Dashboard.

With this API companies can: Register, to receive your commerce infos.

🔦 Services behaviour

  • Auth: Send an email > Grab auth link code > user authentication
  • Dashboard data info: Get revenue info, profile info, ecommerce metrics, change product status

📃Requirements

  • Bun
  • Node
  • Docker + Docker compose

⬜ Stack

  • Elysia -> Minimalist Server Framework optimized for Bun
  • Drizzle ORM -> Runtime Agnostic ORM
  • @paralleldrive/cuid2 -> To create unique ids
  • Docker -> Container to run Postgres
  • Postgres -> Database

⚙️Tech info

More information after conclusion

This project was created using bun init in bun v1.1.17. Bun is a fast all-in-one JavaScript runtime.

  • Node must be present to execute migrations
  • Bun supports await as top level with these options inside tsconfig.json > compilerOptions:
    {
    "target": "ESNext",
    "module": "ESNext",
    }
    

Relations

  • These code block only works for Drizzle to manage db relations
export const usersRelations = relations(users, ({ one, many }) => {
  return {
    managedCompany: one(companies, {
      fields: [users.id],
      references: [companies.managerId],
      relationName: 'managed_Company',
    }),
    orders: many(orders),
  }
})

Testing API

🔨Getting Started

  • Install deps
bun install
  • Run migrations
bun generate
bun migrate
  • Create some seeds to tests:
bun seed
  • Run project
bun dev

⚠️ Tech Pendencies

  • Move bun to Container (Can't actually, because drizzle studio is not working properly on Docker, it ports cant exposed easily)
    • Image: FROM oven/bun:latest
  • Create unit tests 🧪
  • Create services documentation (i.e: Swagger) 📄
  • Set email service to receive auth link

📈 Project Improvements

  • Create service to Register products
  • Certified that only Admins que retrieve metrics data
  • Create feature to send real email

quad-dash-api's People

Contributors

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