Go to file
2025-03-11 13:27:14 +07:00
config 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
migrations 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
models 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
modules Moved auth logic to service 2025-03-11 13:09:44 +07:00
public 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
routers 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
src-frontend 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
views 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
.babelrc 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
.env.example 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
.gitignore 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
app.js Moved auth logic to service 2025-03-11 13:09:44 +07:00
package.json 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
README.md README.md update 2025-03-11 13:27:14 +07:00
vite.config.js 🚀 Let's ride! 2025-03-11 12:57:45 +07:00
yarn.lock 🚀 Let's ride! 2025-03-11 12:57:45 +07:00

WebService Boilerplate

A boilerplate for a web service using NodeJS and Express.

Installation

Install dependencies with yarn

yarn

Rename .env.example to .env and configure the environment variables.

cp .env.example .env

Migrate the database with yarn sequelize db:migrate

yarn sequelize db:migrate

Usage

Build the project with yarn build

yarn build

Start the server with yarn start

yarn start

Development

Run yarn dev to start a development server.

yarn dev

Sequelize CLI

You can use the Sequelize CLI to manage your database.

Environment Variables

The following environment variables are required:

Variable Description
DB_USERNAME The username for the database
DB_PASSWORD The password for the database
DB_NAME The name of the database
DB_HOSTNAME The hostname of the database
DB_PORT The port of the database
DB_DIALECT The dialect of the database
DB_LOGGING Whether to log the queries to the console (true or false)
DEV_DB_USERNAME The username for the development database
DEV_DB_PASSWORD The password for the development database
DEV_DB_NAME The name of the development database
DEV_DB_HOST The hostname of the development database
DEV_DB_PORT The port of the development database
DEV_DB_DIALECT The dialect of the development database
DEV_DB_LOGGING Whether to log the queries to the console (true or false)
JWT_SECRET The secret for the JWT token
VITE_API_URL The URL of the API

Useful information

You can use /api/v1/auth/generatePasswordHash?password=123456 to generate a password hash for development purposes