Skip to content

CrystallizeAPI/node-js-ts-frontend-and-service-api-project-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BEFORE TO USE, DO THIS RIGHT AFTER YOU CLONE

  • the Frontend folder is empty, you decide the framework you want for your Frontend, on our side we like them all, with a preference for Remix Run those days.

  • Replace service-api.domain.name and frontend.domain.name by the domains you want for your local development

    • in this file (README.md)
    • in the provisioning/dev/Caddyfile
    • in the Makefile
    • add the domains in your /etc/hosts (as mentioned in the provided documentation below)

That's it:! Then you can run

make install
make serve
  • Remove this section from this file (README.md)

Project [NAME]

This repository handles:

  • the Frontend using [FRONTEND FRAMEWORK]
  • the Service API using Koa

Requirements

  • Docker
  • Volta.sh (that will bring good version of Node)
  • Caddy Server v2
  • mkcert for https with local domains

You need this install on your computer to leverage the Makefile automation

Domains

We want to respect as much a possible the Twelve-Factor App, especially https://12factor.net/dev-prod-parity

It means we want HTTPS locally and custom domains locally as well.

Add an entry in your /etc/hosts

127.0.0.1 service-api.domain.name frontend.domain.name

All the automation are prepared to work with service-api.domain.name and frontend.domain.name

Installation

make install

This will:

  • install the Certificate Authority using mkcert
  • generate the certificates for the domains
  • npm install the front-end folder and service-api folder

Run the project

make serve

This will:

  • run the front-end and service-api projects on HTTP
  • run the Caddy proxy on HTTPS
  • run the Docker Network

you can stop non stopped services with make stop

Gotchas

  • Frontend run in HTTP on 42080
  • Service API run in HTTP on 42081
  • Caddy enables HTTPS on top of them all
  • Mailcatcher is on the side up via Docker

About

Starter Kit for Frontend (of your choice) and Service API with Node, TypeScript and more

Resources

License

Stars

Watchers

Forks