Micro Restaurants is a multi-restaurant management system developed using the Microservice Skeleton which uses the
- Typescript - for development.
- Sequelize JS - for database and modeling
- Hapi/Joi - for requests validation and model verification
- Axios - for inter-communications and object requests
- ExpressJs - for handling the http-calls, routing and controlling.
click here to learn more about Microservice skeleteon
The frontend of this system is based on Svelte.
- Frontend - Admin panel for the multi-restaurant management. [SVELTE]
- Restaurant Front - Ordering and Restaurant listings for the customers [SVELTE]
- Customers API - for handling all the customers calls.
- Orders API - for handling all the Orders and Orderitems calls.
- Restaurants API - for handling all the Restaurants, Menus and MenuItems calls.
- Users API - for handling all the Users and Authentication calls.
All the requests are called upon the restaurant-reverse-proxy which handles all the routing between the microservices. it can be found on ./deployment/docker/
. I have used Nginx as a reverse proxy and the configuration can be found on ./deployment/docker/nginx.conf
for serving the static content I have used Nginx http server. both of the svelte parts are build and then packaged into the docker container. so before running the docker_build
command you must run the npm run build
in both of the svelte apps. so it would generate the distributable for the docker.
https://hub.docker.com/repository/docker/adamhingoro/restaurant-reverseproxy https://hub.docker.com/repository/docker/adamhingoro/microservice-restaurant-front https://hub.docker.com/repository/docker/adamhingoro/microservicefrontend https://hub.docker.com/repository/docker/adamhingoro/restaurant-microservice-users-api https://hub.docker.com/repository/docker/adamhingoro/restaurant-microservice-restaurants-api https://hub.docker.com/repository/docker/adamhingoro/restaurant-microservice-orders-api https://hub.docker.com/repository/docker/adamhingoro/restaurant-microservice-customers-api
-
run
./install
and if you find any security issues or if you want to udpate the packages then you can run./update
. -
configure the envoriment variables for docker in
./deployment/docker/docker-compose-build.yaml
you can set different database for each service or you can use one database for all of the services. make sure to use sameJWT_SECRET
because the user token will be verified on all of the services. -
run the files
./docker_build
and then./docker_run
use the directory ./deployment/k8s/
before loading any files to the kubernetes make sure to configure the envoriment variables in env-secret.yaml
and env-configmap.yaml
once you deploy the application you can access the frontend : http://[your-reverse-proxy-address]:8100/admin/ for admin and http://[your-reverse-proxy-address]:8100/front/ for ordering and viewing the menu.
email : adam@gmail.com
password : computer
you can change this in file microservice-users-api/src/index.ts
All the API's services have configured chai
and mocha
. currently there are no tests availible but in future we will have tests for each service.
All the tests can be found on [API's-services]/src/tests/
directory.
this application is completely containerized and tested kubernetes deployments on GCD, AWS and okteto.
All the k8s configurations can be found in ./deployments/k8s/
Before deployment please configure your local kubernetes as per platform and set the envoriment credentails in env-configmaps
then simply run
chmod +x ./kubectl_deploy # execute permission
./kubectl_deploy
JUST IN CASE IF ANYTHING GOES WRONG
chmod +x ./kubectl_rest # execute permission
./kubectl_rest
this will delete all the configuration in your kubernetes cluster - please use this with cautious.
Kubernetes CI/CD using travis and okteto. click here to read on how I setup the complete CI/CD pipeline with just few easy steps.
All the services follow the restful structure as shown in the diagram below to keep things understandable and manageable however we did created some other endpoints which are required for the business logic.
It handles all the customer data and it verifies the data with the orders service. Please do check the detailed information about this service. READ MORE
It handles all the users data and its relation to the restaurant. It also handles the authentication and generates a JSON-WEB-TOKEN for the frontend. the token is signed with a secret which is shared amoung all the services. by using shared token all services are able to verify the user without hitting the users micro-service ever again. READ MORE
It handles all the restaurants, their menus and menuItems. It is like a catalog service for the restaurants. this service has a lot of endpoints and it does use object-requester to fetch the user. READ MORE
It handles all the orders and their items. this service also uses the object-requester to fetch the menuitems for prices. currently the order procedure is little rough and it has few loop-holes which I am planning to fix in the future. READ MORE
Please I highly encourage you to submit any issue, bug or feature-request. I will try my full-best to make it posible.
If you really think this is a good project. please dont just think. Let people know that this is the good project. :D