Skip to content

Main #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Main #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
MONGO_DB_URI=
HOST=
PORT=
MONGODB_URI="mongodb+srv://vercel-admin-user-6849b06b315e9c2498977db5:[email protected]/myFirstDatabase?retryWrites=true&w=majority"
PORT=8080
29 changes: 0 additions & 29 deletions .github/workflows/node.js.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Vercel Preview Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches-ignore:
- master

jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 22

- run: npm ci

Deploy-Preview:
needs: [Test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Vercel CLI
run: npm install --global vercel

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}

- name: Deployment Succeeded Message
run: echo "✅ Deployment to Vercel Preview environment was successful! 🚀"
31 changes: 31 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Vercel Production Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches:
- master

jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Vercel CLI
run: npm install --global vercel

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deployment Succeeded Message
run: echo "✅ Deployment to Vercel Production environment was successful! 🚀"
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# dependencies
/node_modules

# Logs
npm-debug.log*

# misc
.env
.vercel
node_modules
.env
73 changes: 24 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,45 @@
<h1 align="center">Express Guestbook</h1>

<p align="center">
<a href="https://github.com/SafdarJamal/express-guestbook/actions?query=workflow%3A%22Node.js+CI%22">
<img src="https://github.com/SafdarJamal/express-guestbook/workflows/Node.js%20CI/badge.svg" alt="Node.js CI" />
<a href="https://github.com/fadhliphya/express-guestbook/actions">
<img src="https://github.com/fadhliphya/express-guestbook/workflows/CI/CD/badge.svg" alt="CI/CD Status" />
</a>
<a href="https://github.com/SafdarJamal/express-guestbook/releases">
<img src="https://img.shields.io/github/v/release/SafdarJamal/express-guestbook" alt="GitHub Release (latest by date)" />
<a href="https://github.com/fadhliphya/express-guestbook/releases">
<img src="https://img.shields.io/github/v/release/fadhliphya/express-guestbook" alt="GitHub Release" />
</a>
<a href="https://github.com/SafdarJamal/express-guestbook/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/SafdarJamal/express-guestbook" alt="License" />
<a href="https://github.com/fadhliphya/express-guestbook/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/fadhliphya/express-guestbook" alt="License" />
</a>
</p>

<p align="center">
A Node.js web application that allows visitors to leave a public comment without creating a user account.
A simple guestbook web app built with Node.js & Express.
Features automated CI/CD pipeline using GitHub Actions and auto-deployment to Vercel.
</p>

![Express Guestbook](https://user-images.githubusercontent.com/48409548/172023724-7631322c-9156-4c2e-9539-5371b76677fc.png)
---

## Tech Stack
## 🚀 Live Demo

🔗 [https://express-guestbook.vercel.app](https://express-guestbook.vercel.app)

---

## 🧰 Tech Stack

- [Node.js](https://nodejs.org)
- [Express](https://expressjs.com)
- [MongoDB](https://www.mongodb.com)
- [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)
- [EJS](https://ejs.co)
- [Bootstrap](https://getbootstrap.com)
- [Vercel](https://vercel.com)
- [GitHub Actions](https://github.com/features/actions)

## Development
---

To get a local copy of the code, clone it using git:
## 💻 Local Development

```
git clone https://github.com/SafdarJamal/express-guestbook.git
### Clone repository:
```bash
git clone https://github.com/fadhliphya/express-guestbook.git
cd express-guestbook
```

Install dependencies:

```
npm install
```

Now, you can start a local web server by running:

```
npm start
```

and then you can open http://localhost:8080 to view it in the browser.

#### Available npm Scripts

| Script | Description |
| ----------- | ------------------------------------------------------------- |
| npm install | Installs the dependencies in the local `node_modules` folder. |
| npm start | Runs the app in production mode. |
| npm run dev | Runs the app in development mode. |

## Contributing

Contributions, issues, and feature requests are welcome.

## Credits

Express Guestbook is built and maintained by [Safdar Jamal](https://safdarjamal.github.io).

## License

Express Guestbook is [MIT Licensed](https://github.com/SafdarJamal/express-guestbook/blob/master/LICENSE).
5 changes: 5 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}
Loading