A starting place for a web project
JavaScript Python TypeScript HTML Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
src
.gitignore
BuildDockerFile
LICENSE
README.md
ServiceDockerFile
docker-compose.yaml
example.env
graph.gv.txt

README.md

Web Dev Skeleton - A starting place for a web project

I was tired to building scaffolding for every little project so I build this repo to jump start my other projects.

Instructions

Install Docker.

Copy example.env to .env.

Edit .env with appropriate settings.


docker-compose build
docker-compose up

Open 127.0.0.1:8080. A page should appear.

Open 127.0.0.1:15672 RabbitMQ admin window should appear

Description of Containers:

web-build

This uses the gulpfile.js to build:

  • TypeScript
  • SASS
  • mustache templates

web-static

This is commented out.

When building a production docker-compose consider including this to allow NGINX to serve up what was made in the web-build.

rabbitmq

An instance of RabbitMQ. In production you might config this a little differently.

rabbitmq_data

This acts as a single location for the rabbitmq instances to use for data

web-service - SYNC

This is the server application tier with a web entry point. It takes the requests from the client and processes them.

worker-service - ASYNC

A non-web application instance which takes serialized requests from rabbitmq and executes them.

data-cache

Redis for caching your data.

database-server:

MariaDB for datastorage

Getting started

docker-compose up

Web with a socket to the socket server

  • Client side look at the app_view_model and index.html
  • Server side look at my_test2

Client requests a route with a request object. Server processes a request and returns a response.

Web with Ajax

  • Client side look at the app_view_model and index.html commented out "Old way"
  • Server side look at my_test2

Process from Queue

Want to defer your request to have N listeners have a chance to process it?

Just wrap your request in a request to the queue route.

{
    data: {
        request:{
                "client_provided_user_id": skeleton.security.getUserManager().id_token(),
                data: {
                    "value":"woot"},
                route: skeleton.routing.server_routes.AppViewTest2
        }
    }
    route: skeleton.routing.server_routes.<YourQueueRouteHere>
}

Then the listener consumes it and processes it.