- This is required for both local dev K8s cluster and DigitalOcean K8s cluster
Check ingress-nginx
documentation: https://kubernetes.github.io/ingress-nginx/
- This is required for both local dev k8s and DigitalOcean k8s
e.g. To create a secret token in k8s cluster that is used for stripe payment service:
kubectl create secret generic stripe-secret --from-literal STRIPE_KEY=[YOUR_STRIPE_SECRET_KEY]
And inside payment service k8s deployment config file (payments-depl.yaml):
- name: STRIPE_KEY
valueFrom:
secretKeyRef:
name: stripe-secret
key: STRIPE_KEY
And for the confirmation service:
kubectl create secret generic sendgrid-secret --from-literal SENDGRID_API_KEY=[YOUR_SENDGRID_API_KEY]
And inside confirmation service k8s deployment config file (confirmation-depl.yaml):
- name: SENDGRID_API_KEY
valueFrom:
secretKeyRef:
name: sendgrid-secret
key: SENDGRID_API_KEY
-
To redirect requests coming to: ticketing.dev => localhost
-
only for local development purposes
-
MacOS/Linux:
modify/etc/hosts
file to include127.0.0.1 ticketing.dev
-
Windows:
modifyC:\Windows\System32\Drivers\etc\hosts
file to include127.0.0.1 ticketing.dev
-
To skip the unskippable HTTPS warning in Chrome:
try type thisisunsafe
Install Skaffold Dev Tool: brew install skaffold
From root project directory: run skaffold dev
-
Want no backend session storage when using Microservices architecture - so stick with
JWT
. -
Want to use Server-Side Rendering and access user's auth information when HTML first gets rendered - so
store and transmit JWT within Cookies
, i.e. use cookies as a transport mechanism. -
Want to be able to revoke a user - so use
short-lived JWT
(e.g. expired in 15 minutes) withrefresh
mechanism.
Minimalistic ReactJS framework for rendering React app on the server. https://nextjs.org/
-
/
Show list of all tickets
-
/auth/signin
Show sign in form
-
/auth/signup
Show sign up form
-
/auth/signout
Sign out
-
/tickets/new
Form to create a new ticket
-
/tickets/:ticketId
Details about a specific ticket
-
/tickets/:orderId
Show info about an order and payment button
All the commonly used classes, interfaces and middlewares, etc. are extracted into a published NPM Module.
-
@ojticketing/common
: https://www.npmjs.com/package/@ojticketing/commonContains commonly used Middlewares and Error Classes for ticketing microservices
- NATS Streaming Server
- Leverage
mongoose-update-if-current
npm module to update mongodb documents' version.
- GET /api/users/currentUser
Get current user's information
- POST /api/users/signup
{ "email": "test@gmail.com", "password": "123456" }
User Sign up
- POST /api/users/signin
{ "email": "test@gmail.com", "password": "123456" }
User sign in
- POST /api/users/signout
{}
User sign out
- GET /api/tickets
Retrieve all tickets
- GET /api/tickets/:id
Retrieve ticket with specific ID
- POST /api/tickets
{ title: string, price: string }
Create a ticket
- PUT /api/tickets/:id
{ title: string, price: string }
Update a ticket
- GET /api/orders
Retrieve all active orders for the given user making the request
- GET /api/orders/:id
Get details about a specific order
- POST /api/orders
{ ticketId: string }
Create an order to purchase the specified ticket
- DELETE /api/orders/:id
Cancel the order
-
BullJS
UseBull.js
to manage job queues, with job delay option -
Redis
UseRedis
to store list of jobs
-
StripeJS
For handling payments -
POST /api/payments
{ token: string, orderId: string}
Create new charge/payment
-
BULLJS Use
Bull.js
to manage job queues -
Redis
UseRedis
to store list of jobs -
SENDGRID Email delivery service, used to send emails confirming purchase