TemplrJS is a comprehensive web application development framework designed for swift deployment. Ideally suited for edge computing scenarios, it harnesses the power of Vue.js, Nuxt.js, Tailwind CSS, and DuckDB to provide developers with an efficient and streamlined experience.
-
Unified Binary: The entire application is packaged inside a singular Go-based binary, ensuring seamless execution.
-
Embedded Database Support: Comes integrated with DuckDB. It defaults to an in-memory database, offering flexibility in using an existing database file or creating a new one based on configurations.
-
Client-Only NuxtJS Design: The default web application follows a client-only NuxtJS architecture, eliminating the need for server-side rendering (SSR).
-
Optimized for All Devices: Tailored for both mobile and web platforms, every page is designed with a mobile-first approach, guaranteeing optimal mobile responsiveness.
- Go: https://golang.org/doc/install
- Node.js: https://nodejs.org/en/download/ (Not applicable)
- Npm: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm (Not applicable)
- Clone the repository:
git clone https://github.com/username/project.git
- Navigate to the project directory:
cd project
- Install Go dependencies:
go mod download
- Install Node.js dependencies:
yarn install
- Create a copy of
.env.sample
and name it.env
:cp .env.sample .env
- Open the
.env
file in a text editor and set theAPI_BASE_URL
variable tohttp:https://localhost:<port>
where<port>
is the port number that the Go server will run on.
- Open a terminal and navigate to the root directory of the project.
- Run
go run .
to start the Go server. - Once the Go server is running, open another terminal and navigate to the
/web
directory of the project. - Run
npm run dev
to start the development server for the web project. - Open a web browser and navigate to
http:https://localhost:3000
to view the web application.
- Go: https://golang.org/doc/install
- Node.js: https://nodejs.org/en/download/
- Npm: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- Clone the repository:
git clone https://github.com/username/project.git
- Navigate to the project directory:
cd project
- Install Go dependencies:
go mod download
- Navigate to the web directory:
cd web
and Install Node.js dependencies:npm i
- Create a copy of
.env.sample
and name it.env
:cp .env.sample .env
- Open the
.env
file in a text editor and set theAPI_BASE_URL
variable to empty. - Run
npm run generate
to build the web project. - Navigate to the root directory of the project and run
sh move_dist.sh
to move the generated static files to the appropriate location. - Run
go build -o server.templrjs -v .
to build the Go binary.
Step # 4 thru 8 is not applicable as the static website generation and embeding is removed instead kept
senthilsweb.com
pre-built static site as reference.
- Copy the following files to the production linux server:
- Go binary
server.templrjs
templrjs.duckdb
(if you are using duckdb) (Not applicable)templrjs.duckdb.wal
(if you are using duckdb) (Not applicable)config.yml
docker-compose.yml
(if you are using Traefik for reverse proxy)rules.yml
(if you are using Traefik for reverse proxy)
- Go binary
- Run the Go binary to start the production server.
./server.templrjs -p 8080
- If you are using Traefik for reverse proxy,
- Create
letsencrypt
folder in the root where the binary is kept - Make sure the go server
templrjs
is running on port8080
- Run
docker-compose up -d
to start the Traefik container.
- Create