Giter Club home page Giter Club logo

mazenrecords-sst's Introduction

Mazen Records SST

Overview

Mazen Records SST is a Serverless Stack (SST) project that provides a full-stack solution for managing TV repair visits. This project leverages AWS services, including Cognito for JWT authentication, DynamoDB for storage, and Lambda for serverless execution. Additionally, it includes a frontend build of the Mazen Records' frontend repository, delivered via CloudFront.

What is SST (Serverless Stack)?

Serverless Stack (SST) is an open-source framework for building serverless applications. It simplifies the process of defining and deploying serverless infrastructure on AWS using infrastructure-as-code principles.

Features

Authentication with Cognito

  • Utilizes AWS Cognito for secure and scalable user authentication.
  • Enables the use of JWT (JSON Web Tokens) for authentication and authorization.

Data Storage with DynamoDB

  • Leverages AWS DynamoDB for a serverless, highly available, and scalable NoSQL database solution.

Serverless Execution with Lambda

  • Implements serverless functions using AWS Lambda for efficient and cost-effective execution of backend logic.

Frontend Delivery via CloudFront

  • Deploys the Mazen Records' frontend build through AWS CloudFront for fast and secure content delivery.

Installation

  1. Clone the repository:
 git clone [email protected]:noctisdark/mazenrecords-sst.git
  1. Navigate to the project directory:
cd mazenrecords-sst
  1. Initialize and update the frontend submodule
git submodule init && git submodule update
  1. Install dependencies:
pnpm install
  1. Connect to AWS CLI (Single Sign-On):
aws sso login --sso-session=your_login
  1. Deploy the SST stack in development mode:
pnpm sst dev
  1. Deploy the SST stack to a specific stage:
pnpm sst deploy --stage your_stage

Usage

Access the deployed frontend through the CloudFront URL provided after deployment.

Interact with the TV repair visit management system, including user authentication, data storage, and serverless execution.

Visits Table Add a Visit Checkout a Visit Autocomplete Brands
overview Visits checkout image

Updating Records

This application uses a specific data structure for record updates:

export type Visit = Deletable<{
  id: string;
  date: number;
  client: string;
  contact: string;
  brand: string;
  model: string;
  problem: string;
  fix: string;
  amount: number;
  updatedAt: number;
}>;

export type Deletable<T extends { id: string }> =
  | T
  | { id: string; deleted: true; updatedAt: number };

If a record is marked as deleted ({ deleted: true }), the frontend removes it from its IndexedDB. Otherwise, the record is inserted or updated based on the updatedAt timestamp, facilitating synchronization between the client (potentially offline) and the server.

License

This project is licensed under the MIT License.

mazenrecords-sst's People

Contributors

noctisdark avatar

Stargazers

 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.