Skip to content

Commit

Permalink
sifting to version 1.1.2 is cool.
Browse files Browse the repository at this point in the history
- `style.css` file is shifted to `public/style.css`
- `nets` file is shifted to `netface`
- github `readme` file is shifted to `docs` folder.
- `.gitignore` has been added.
  • Loading branch information
OurCodeBase committed Oct 1, 2024
1 parent 2be9e3d commit c73772a
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 131 deletions.
7 changes: 7 additions & 0 deletions docs/changelogs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelogs
You can check most latest changlogs at [commits](https://github.com/OurCodeBase/gen3-express/commits/main/) or [versions](https://github.com/OurCodeBase/gen3-express/releases) sections in github.

## Changelogs 1.1.2
boilerplate has been optimised, enhanced and documented.
- `style.css` file is shifted to `public/style.css`
- `nets` file is shifted to `netface`
- github `readme` file is shifted to `docs` folder.
- `.gitignore` has been added.

## Changelogs 1.1.1
generator published at npmjs.
- docs updated
Expand Down
86 changes: 0 additions & 86 deletions docs/documentation.md

This file was deleted.

5 changes: 1 addition & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hero:
actions:
- theme: brand
text: Get Started
link: /documentation
link: /readme
- theme: alt
text: View on GitHub
link: https://github.com/OurCodeBase/gen3-express
Expand All @@ -29,7 +29,4 @@ features:
- icon:
title: Cross Platform
details: You can use this tool on any platform like Linux, MacOS, Windows (WSL) and also on Android (Termux).
- icon: 🥙
title: NPX Usable
details: You don't neet to install a separate tool to generate express apps. You can just simply use npx to fetch files and dependencies temporarily.
---
30 changes: 20 additions & 10 deletions README.md → docs/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Gen3 Express
A gen3 tool to generate express app boilerplate.

> [!IMPORTANT]
> ### 1.1.2 is released
> boilerplate has been optimised, enhanced and documented.
> - `style.css` file is shifted to `public/style.css`
> - `nets` file is shifted to `netface`
> - github `readme` file is shifted to `docs` folder.
> - `.gitignore` has been added.

## Acknowledgements
You need to know atleast basics about these things.
- [NodeJS](https://nodejs.org/docs/latest/api/)
Expand Down Expand Up @@ -52,17 +61,18 @@ To know about the product or project structure read about files included in this

```bash
.
├── app.js # this core file handles express functions and server.
├── package.json # package file handles dependencies, and details about the product.
├── public # this folder contains public data like fonts, css and multimedia.
│   ├── fonts
│   │   └── sans.woff
│   └── style.css
├── sync.js # this file is needed to configure hot reloadings in ejs and static files.
├── app.js
├── package.json
├── public
│   ├── css
│   │   └── style.css
│   └── fonts
│   └── sans.woff
├── sync.js # configuration for hot reloadings in ejs and static files.
├── utils
│   └── nets.js # this file provides functions to display available ip addresses on your network.
└── views # this folder contains ejs or html files to render contents.
└── home.ejs # this file is the landing page of the product.
│   └── netface.js # contains functions to show available ipv4 addresses.
└── views
└── home.ejs
```

## Roadmap
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# env variables
.env.local
.env.development.local
.env.test.local
.env.production.local

# error and debug files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
16 changes: 11 additions & 5 deletions template/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const express = require('express')

const app = express()
const PORT = 3000
const port = 3000

app.set('view engine', 'ejs')
app.use(express.static('public'))
Expand All @@ -17,8 +17,14 @@ app.use('/colors', express.static(

app.get('/', (req, res) => res.render('home'))

app.listen(PORT, () => {
const nets = require('./utils/nets')
console.log('Server has been started on...');
nets.showAvailableNetworks(PORT)
app.listen(port, () => {
/**
* The above code is exclusivly for dev purpose.
* You can replace this function.
*/
const netface = require('./utils/netface')
const linkfaces = netface.ipv4s()
linkfaces.forEach((face) => {
console.info(`http://${face}:${port}`)
})
})
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"ejs": "^3.1.10",
"express": "^4.19.2",
"express": "^4.20.0",
"material-dynamic-colors": "^1.1.2"
},
"devDependencies": {
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions template/utils/netface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const os = require('os')

/**
* This contains all available ipv4 ip address.
* @returns {Object[]} netfaces - All ipv4 ip address.
* */
const ipv4s = () => {
const netfaces = []
const interfaces = os.networkInterfaces()
for (const key of Object.keys(interfaces)) {
for (const interface of interfaces[key]) {
if (interface.family == 'IPv4'){
netfaces.push(interface.address)
}
}
}
return netfaces
}

module.exports = { ipv4s }
22 changes: 0 additions & 22 deletions template/utils/nets.js

This file was deleted.

2 changes: 1 addition & 1 deletion template/views/home.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link href="/style.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<h1>Hello World!</h1>
Expand Down

0 comments on commit c73772a

Please sign in to comment.