Template for some of my web projects, using a Next/React frontend and Node(TS)/Python services.
Search and replace any instance of STARDUST, which is the brand/name placeholder for this template.
- Future, ...: ...
- Jun 30, 2021: Created this template for my own use
See frontend/ for the structure
Load this root folder in WebStorm/PHPStorm, configure NPM on the frontend folder, run by executing the "next dev" npm script.
See frontend-build.sh and see how it creates a docker container, runs it to build the solution, instantiates it and copies out the files from the build.
This is a Node.JS application written in TypeScript; you can use your favorite IDE to Load and run it, or run it from the command line.
See backend-build.sh and see how it creates a docker container that listens on a given port.
Using IntelliJ, install the TypeScript plugin, right click on the main .ts file and create a debug run configuration.
Don't do it! There's no need, it pollutes the folders, etc. However, if you want to do it, here are the steps:
- Install the required code dependencies (axios, json2csv, redis, yargs) by running:
cd service-node npm install
- Set any environment variable - for instance HTTP ports to listen to, or which ML model to use...
# Note that <VALUE> should be replaced with the value we're talking about export SOME_VARIABLE="<VALUE>"
- Either: use the downloaded 'ts-node' executable to transpile TS -> JS and Run in node directly:
./node_modules/.bin/ts-node src/index.ts
- Or: compile TypeScript to JavaScript and run it with
Node.JS
, for instance:npm run tsc node src/index.js
If there's any example usage, show it here.
TBA