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.
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.
- Utilizes AWS Cognito for secure and scalable user authentication.
- Enables the use of JWT (JSON Web Tokens) for authentication and authorization.
- Leverages AWS DynamoDB for a serverless, highly available, and scalable NoSQL database solution.
- Implements serverless functions using AWS Lambda for efficient and cost-effective execution of backend logic.
- Deploys the Mazen Records' frontend build through AWS CloudFront for fast and secure content delivery.
- Clone the repository:
git clone [email protected]:noctisdark/mazenrecords-sst.git
- Navigate to the project directory:
cd mazenrecords-sst
- Initialize and update the frontend submodule
git submodule init && git submodule update
- Install dependencies:
pnpm install
- Connect to AWS CLI (Single Sign-On):
aws sso login --sso-session=your_login
- Deploy the SST stack in development mode:
pnpm sst dev
- Deploy the SST stack to a specific stage:
pnpm sst deploy --stage your_stage
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 |
---|---|---|---|
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.
This project is licensed under the MIT License.