An open API service indexing awesome lists of open source software.

https://github.com/tberey/node-typescript-blank-website-template

A fresh blank Node server, written in TypeScript, that is setup and ready to go with the required dependencies and infrastructure already setup for your convenience, to create any full stack wesbite.
https://github.com/tberey/node-typescript-blank-website-template

dynamic ejs express node node-js nodejs scalability scalable server starter starter-project starter-template template template-project templates typescript

Last synced: 5 months ago
JSON representation

A fresh blank Node server, written in TypeScript, that is setup and ready to go with the required dependencies and infrastructure already setup for your convenience, to create any full stack wesbite.

Awesome Lists containing this project

README

          




Logo




AnyWesbite

A Blank Website Template,
to start something new in TypeScript and Node.




Documentation »


Demo
·
Report
·
Request

Contents



  1. About



  2. Get Started



  3. Usage


  4. Full Setup Instructions

  5. Changelog

  6. Contributing

  7. Contact

  8. Acknowledgements




## About This Project
A fresh blank Node server, written in TypeScript, that is setup and ready to go with the required dependencies and infrastructure already setup for your convenience, to create any full stack wesbite. Can be started right out of the box, to immediately begin devlopment hassle free with clear concise logging, with no configuation or setup time needed. Also includes a ready-to-go front end, that uses a simple but robust grid system that is highly customizable and dynamic, scaling to all devices or screen sizes. Index test page already setup with the basic amenities like a menu, header and footer included. This template is set up and intended for TypeScript, making use of strict typesetting, precompiling, and presented in an object-oriented approach.

*This template is completely unrestricted, and free for anyone to use, unlimited, with no credit or acknowledgements needed. There are no signs of any ownership, or personal data, in this codebase. See the LICENSE file for more info.*


### Tech Stack
* [Typescript](https://www.typescriptlang.org/) - Write in TypeScript (or JS). Compiles down to JavaScript.
* [NodeJS](https://nodejs.org/en/) - Node Runtime Environment.
* [ExpressJS](https://expressjs.com/) - Server & Router Infrastructure Framework.
* [Express-Session](http://expressjs.com/en/resources/middleware/session.html) - Session cache middleware.
* [Express-CORS](https://expressjs.com/en/resources/middleware/cors.html) - CORS cross origin browser protection.
* [EJS](https://ejs.co/) - Serves Client Views.
* [ESLint](https://eslint.org/) - Code Parsing, Styling & Error Checking.
* [Mocha-Chai](https://mochajs.org/) - Testing with Mocha Framework, using the Chai Library.
* [Nodemon](https://nodemon.io/) - Restart Application without Compiling, on a Change to Watched Files.
* [Rimraf](https://www.npmjs.com/package/rimraf) - Directory Cleaner Tool.
* [Dotenv](https://www.npmjs.com/package/dotenv) - Project Secrets Stored in a Local .env File.
* [SimpleTxtLogger](https://www.npmjs.com/package/simple-txt-logger) - Logging tool.
* [@types/*](https://www.npmjs.com/package/@types/node) - Various JS->TS Typesetting modules, to import types and make full use of TypeScript features with an imported module.


*- See [Full Instructions](#setup-instructions) to create this template yourself, without any of extra modules you do not want/need.*




## Get Started
For help or guidance in downloading and running the application, see the following subsections.


#### Prerequisites
[You must have npm (node package manager) and Nodejs installed on your system!](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

1. Update npm:
```sh
npm install npm@latest -g
```

#### Installation
1. Clone/Download:
```sh
git clone https://github.com/tberey/node-typescript-blank-website-template.git
```
2. Install:
```sh
npm install
```
3. Start:
```sh
npm run start
```




## Usage

| Endpoint | Action/Desc. | Full URI (when hosted locally, on port 3000) |
|:---|:---|:---|
|

  • GET "/"
| Homepage:
The client-side landing page. |
  • "`http://localhost:3000/`"
|


### Screenshots

Logging Sample

![Screenshot#1](https://github.com/tberey/node-typescript-blank-website-template/blob/main/screenshots/screenshot-logging.png?raw=true)

Website Screenshot 1

![Screenshot#1](https://github.com/tberey/node-typescript-blank-website-template/blob/main/screenshots/screenshot-1.png?raw=true)

Website Screenshot 2

![Screenshot#1](https://github.com/tberey/node-typescript-blank-website-template/blob/main/screenshots/screenshot-2.png?raw=true)

Website Screenshot 3

![Screenshot#1](https://github.com/tberey/node-typescript-blank-website-template/blob/main/screenshots/screenshot-3.png?raw=true)

Website Screenshot 4

![Screenshot#1](https://github.com/tberey/node-typescript-blank-website-template/blob/main/screenshots/screenshot-4.png?raw=true)




## Setup Instructions
The following steps are complete instructions to create this template, but without any of the extra modules, and begin a brand new project in Nodejs with TypeScript from a blank slate. The commands are shell commands, to be carried out in a terminal, console or other shell environment.

1. Create a new local directory and change current directory to new one:
```sh
mkdir && cd
```
2. Initialize a new package.json file:
```sh
npm init -y
```
3. Install TypeScript dependencies:
```sh
npm i --save-dev typescript ts-node
```
4. Initialize a new tsconfig.json file:
```sh
npx tsc --init
```
5. Some basic parameters to use in the tsconfig.json file. [My settings for this file can be found here](https://github.com/tberey/node-typescript-blank-website-template/blob/master/tsconfig.json). You can adjust this further with your own preferences, if needed.
```sh
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"declaration": true,
"sourceMap": true,
"outDir": "build",
"rootDir": "./",
"strict": true,
"esModuleInterop": true
}
}
```
6. Create main.ts, the entry point into the application:
```sh
echo "console.info('Hello, World');" > main.ts
```
7. Some basic information and scripts, for the package.json file:
```sh
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "build/main.js",
"types": "build/main.d.ts"
"scripts": {
"setup": "npm update && npm install",
"build": "tsc",
"start": "node build/main.js",
"start:src": "ts-node main.ts"
}
}
```
8. Install, compile and start application (it won't do much yet, but you're off to a running start now):
```sh
npm run setup
npm run build
npm run start
```
^ '`npm run setup`' will install and update the project and it's dependencies, then '`npm run build`' will compile the project into JavaScript, and finally '`npm run start`' will run the project.




## Roadmap
Below is the refined and confirmed roadmap, that has been planned for completion. See [open issues](https://github.com/tberey/node-typescript-blank-website-template/issues) and also the [project board](https://github.com/tberey/node-typescript-blank-website-template/projects), for any other proposed features or known issues, which may not be listed below.

| Feature/Task/Bugfix | Details | Version (if released) | Notes |
|:---|:---|:---|:---|
| Bug#1 | Bug details... | 0.0.1 | example |
| Feature#4 | Feature details... | | example |




## Changelog

| Version | Date | Changes |
|:---|:---|:---|
| 1.0.0 | 2023-12-04 |


  • Initial Commit.

  • Add initial directory structure and files.

  • Add Screenshots directory, and images.

  • Create and format README.md

|




## Contributing
Contributions are welcomed and, of course, **greatly appreciated**.

1. Fork the Project.
2. Create your Feature Branch (`git checkout -b feature/Feature`)
3. Commit your Changes (`git commit -m 'Add some Feature'`)
4. Push to the Branch (`git push origin feature/Feature`)
5. Open a Pull Request.




### Contact

Tom Berey; Project Manager, Lead Developer, Principal Tester & Customer Services;
tomberey1@gmail.com;

* [Issues & Requests.](https://github.com/tberey/typescript-node-fresh-start-template/issues)
* [My Other Projects.](https://github.com/tberey?tab=repositories)
* [Personal Website.](https://tberey.github.io/)
* [Linked In.](https://uk.linkedin.com/in/thomas-berey)




### Acknowledgements

* [Me](https://github.com/tberey)