Talk about Azure SQL + Prisma

Overview

Talk - Power Up Your BackEnd Applications with Serverless Architecture & Azure SQL

A demo related with the talk Power Up Your BackEnd Applications with Serverless Architecture & Azure SQL using:

  • Azure SQL
  • Prisma
  • Vue.Js
  • Azure Functions
  • Azure Static Web Apps

🚀 Resources Used

How to run the application locally?

Project: client

To execute locally this project you will need to follow the steps bellow:

  1. First you need to go to the folder: client and run the command:
> npm install
  1. After to install all the Node.Js packages, now you can execute the command:
> npm run serve
  1. Now, open your browser on http://localhost:8080/

  2. Inside the project you will see a file: src/Api.js. This file contains all the Back-End request information (local or Azure Functions). If you want to test the Front-End, just choose which url you want to test in the Back-End:

/**
 * file: src/services/Api.js
 * data: 01/03/2022
 * description: file responsible for initializing 'axios' and HTTP base url requests
 * author: Glaucia Lemos <twitter: @glaucia_lemos86>
 */

import axios from 'axios';

export default () => axios.create({
  // => Back-End (local) 'baseURL'-> will make communication btw Front-End with Back-End
  // baseURL: 'http://localhost:3001/api/v1',

  // ==> Back-End (azure functions)
  baseURL: 'http://localhost:7071/api',
});
Project: api
  1. First you need to go to the folder: api and run the command:
> npm install
  1. Include the Azure SQL Server connection string creating an .env file:
# Database connection string
DATABASE_URL="sqlserver://DB_SERVER_NAME.database.windows.net:1433;database=DB_NAME;user=DB_USER@DB_SERVER_NAME;password={PASSWORD};encrypt=true"

# Shadow database connection string for development
SHADOW_DATABASE_URL="sqlserver://DB_SERVER_NAME.database.windows.net:1433;database=DB_NAME;user=DB_USER@DB_SERVER_NAME;password={PASSWORD};encrypt=true"
  1. Now create a file called: local.settings.json (root of the project) and include this information below:
{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsStorage": ""
  },
  "Host": {
    "LocalHttpPort": 7071,
    "CORS": "*"
  }
}
  1. Now you can execute the command:
> npm run dev

You will see the message saying the application is running in the port: http://localhost:7071/api/

Objective HTTP Verb Route
CreateEmployee POST http://localhost:7071/api/employees
GetEmployees GET http://localhost:7071/api/employees
GetEmployee GET http://localhost:7071/api/{id}
UpdateEmployee PUT http://localhost:7071/api/{id}
DeleteEmployee DELETE http://localhost:7071/api/{id}

⭐️ Important Resources

Questions? Comments?

If you have any questions about the code developed, feel free to open an ISSUE HERE. We'll get back to you soon!

You might also like...

In this project, you can create optional rooms and people can talk in the rooms

In this project, you can create optional rooms and people can talk in the rooms

CodeTalk In this project, you can create optional rooms and people can talk in the rooms. Login and Registration page Login page welcomes us. If you d

Mar 12, 2022

Examples for Evolllution talk about omni api's

These are examples for the 2022 Evolution Conference. These are only intended for learning puposes so you can learn and develop your own tool set. P

Jun 3, 2022

Clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn from each other in real-time.

Clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn from each other in real-time.

Awesome Clubhouse The clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn f

Nov 9, 2022

Repository for the demos in the "Hello, Quarto!" talk

hello-quarto-demo Repository for the demos in the "Hello, Quarto!" talk Software RStudio: Version: Current release -- RStudio 2022.07.0+548 "Spotted W

Oct 12, 2022

Talk to anyone connected to your network, be it LAN or your hotspot. Doesn't require internet.

Talk to anyone connected to your network, be it LAN or your hotspot. Doesn't require internet.

Apophis CLI to talk to anyone connected to your network, be it LAN or your hotspot. Doesn't require internet. Installation Make sure you have NodeJS (

Oct 16, 2022

Code examples for my TypeScript Static Analysis Hidden Gems talk. 💎

Code examples for my TypeScript Static Analysis Hidden Gems talk. 💎

TypeScript Static Analysis Hidden Gems Code Code samples for the talk, formed from my template-typescript-node-package. ✨ 👉 Slides available here! 👈

Nov 2, 2022

An Azure blob storage executor module for Runnerty

An Azure blob storage executor module for Runnerty

Smart Processes Management Azure blob storage executor for Runnerty: Installation: To be described after packaging. Tested locally using: npm link exe

Oct 13, 2021

Our project for The Microsoft Azure Trial Hackathon on Dev.to

Our project for The Microsoft Azure Trial Hackathon on Dev.to

Moodflix your mood, our suggestions. 🎯 About Overview of our project We have started this project with the purpose of participating to the Microsoft

Dec 22, 2022

A cypress plugin for projects using @azure/msal-browser

A cypress plugin for projects using @azure/msal-browser

A cypress plugin for projects using @azure/msal-browser

Aug 11, 2022
Comments
  • Added DB readme and simplified local dev

    Added DB readme and simplified local dev

    • Added readme for creating databases
    • updated references to use prisma 3.11
    • removed docs on need to change manually api.js file, as vue proxy will take care of everything
    opened by yorek 0
Owner
Glaucia Lemos
Cloud Advocate in JavaScript @ Microsoft | Contributor & Member Nodejs & React Community | Open Source
Glaucia Lemos
Demo for my talk "Stream Away the Wait" – a talk about making excellent pending experiences.

?? Stream Away the Wait When implementing the design of a user interface, we often finish before remembering that not everyone's running the app's ser

Kent C. Dodds 25 Nov 1, 2022
Chat app using Azure Web PubSub, Static Web Apps and other Azure services

Chatr - Azure Web PubSub Sample App This is a demonstration & sample application designed to be a simple multi-user web based chat system. It provides

Ben Coleman 55 Dec 31, 2022
A cache for @azure/msal-node that uses Azure KeyVault as a store

@intility/msal-keyvault-cache A cache for @azure/msal-node that uses Azure KeyVault as a store. Usage Install with npm install @intility/msal-keyvault

Intility 10 Mar 17, 2022
Vamos a realizar un juego muy sencillo en TypeScript, posteriormente lo vamos a desplegar en Microsoft Azure con Servicio de Azure Static Web Apps.

Taller TypeScript Descripción Vamos a realizar un juego muy sencillo en TypeScript, posteriormente lo vamos a desplegar en Microsoft Azure con Servici

Manuel Ortiz 7 Oct 10, 2022
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
Prisma +2 generator to emit Yup schemas from your Prisma schema

Prisma Yup Generator Automatically generate Yup schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 31 Dec 24, 2022
Prisma 2+ generator to emit Joi schemas from your Prisma schema

Prisma Joi Generator Automatically generate Joi schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 26 Dec 24, 2022
Prisma +2 generator to emit a tRPC shield from your Prisma schema

Prisma tRPC Shield Generator Automatically generate a tRPC Shield from your Prisma Schema. Updates every time npx prisma generate runs. Table of Conte

Omar Dulaimi 27 Dec 24, 2022
Prisma 2+ generator to emit Zod schemas from your Prisma schema

Prisma Zod Generator Automatically generate Zod schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 212 Dec 27, 2022
This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io)

Alternative Prisma Data Proxy This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io). In order to deploy your project to

AijiUejima 60 Dec 28, 2022