All Projects → masb0ymas → expresso

masb0ymas / expresso

Licence: MIT license
expresso ☕ ( expressjs, Sequelize, TypeScript )

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to expresso

youphonic
an online musical machine interface for building and sharing soundscapes and musical compositions
Stars: ✭ 28 (-74.77%)
Mutual labels:  expressjs, sequelize-orm
mean-ionic-ngrx
Monorepo as Microservices: Full MEAN stack with Angular 7, Ionic 4 and ReactiveX API (ngrx/Store + ngrx/Effects) + i18n/ngx-translate + Express NodeJS REST API servers micro-services + JWT Authentication + UnitTest/e2e exemple + Travis + DevOps scripts and many more...
Stars: ✭ 60 (-45.95%)
Mutual labels:  expressjs
express-mongo-jwt-boilerplate
Express Mongo JsonWebToken boilerplate
Stars: ✭ 100 (-9.91%)
Mutual labels:  expressjs
mern-stack-crud
MERN stack (MongoDB, Express, React and Node.js) create read update and delete (CRUD) web application example
Stars: ✭ 142 (+27.93%)
Mutual labels:  expressjs
express-json-validator-middleware
Express middleware for validating requests against JSON schema
Stars: ✭ 148 (+33.33%)
Mutual labels:  expressjs
typijs
The Angular CMS Framework for building fully-featured SPA sites powered by NodeJS and MongoDB with TypeScript
Stars: ✭ 141 (+27.03%)
Mutual labels:  expressjs
gBoards
Trello like Angular Application
Stars: ✭ 21 (-81.08%)
Mutual labels:  expressjs
auto-async-wrap
automatic async middleware wrapper for expressjs errorhandler.
Stars: ✭ 21 (-81.08%)
Mutual labels:  expressjs
MEAN-stack-authentication
MEAN stack authentication boilerplate with Angular 5 and Angular Material
Stars: ✭ 29 (-73.87%)
Mutual labels:  expressjs
MovieGo
A Website implemented using MERN (MongoDB, ExpressJS, ReactJS and NodeJS) stack, which allows users to sign-in/register and book movie tickets online.
Stars: ✭ 26 (-76.58%)
Mutual labels:  expressjs
infinite-wish-board
A platform for kids to make wishes at Make-A-Wish, GA.
Stars: ✭ 27 (-75.68%)
Mutual labels:  expressjs
nestjs-session
Idiomatic Session Module for NestJS. Built on top of `express-session` 😎
Stars: ✭ 150 (+35.14%)
Mutual labels:  expressjs
express-mvc-pattern
Example nodejs using express implementation design pattern using mvc architecture.
Stars: ✭ 52 (-53.15%)
Mutual labels:  expressjs
oors
Modular node.js framework for makers.
Stars: ✭ 25 (-77.48%)
Mutual labels:  expressjs
Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern
A complete example of a Node + Express.js rest api server
Stars: ✭ 45 (-59.46%)
Mutual labels:  expressjs
node-express-mongodb-reactjs-graphql
Node, Express, React.js, Graphql and MongoDB CRUD Web Application
Stars: ✭ 36 (-67.57%)
Mutual labels:  expressjs
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-84.68%)
Mutual labels:  expressjs
search-cities
No description or website provided.
Stars: ✭ 11 (-90.09%)
Mutual labels:  expressjs
passport-magic
Magic is a Passport.js strategy that enables passwordless authentication middleware for any Express.js based application.
Stars: ✭ 35 (-68.47%)
Mutual labels:  expressjs
commerce
🛒 e-commerce-platform
Stars: ✭ 54 (-51.35%)
Mutual labels:  expressjs

expresso with Sequelize

documentation maintenance License: MIT

Version Express Node Eslint TypeScript

Feature

Check Full Documentation

How to use

clone this repo with https / ssh / github cli

git clone https://github.com/masb0ymas/expresso.git

After cloning this repo, make sure you have duplicated the .env.example file to .env, don't let the .env.example file be deleted or renamed.

Install

yarn

Enabled Husky

npx husky install
yarn husky install

Generate Secret Key

yarn key:generate

Usage Development

yarn dev

Lint Check

yarn test:lint

Type Check

yarn test:types

Type Check Watch mode

yarn test:types-watch

Build

by default build codebase with SWC, if you want to build with TypeScript, run this command : yarn build:ts

yarn build

Using Sequelize

Using sequelize with development mode, you can set the database configuration in .env, like this :

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=example_database
DB_USERNAME=example_user
DB_PASSWORD=example_password
DB_SYNC=
DB_TIMEZONE=+07:00

then after that you can adjust the database config in DB_DATABASE, DB_USERNAME, DB_PASSWORD. now you can run this command :

yarn db:reset

Usage Production

yarn serve:production

Usage PM2 for Cluster Process

pm2 start ecosystem.config.js --env=production

Config Nginx for Limiter / Node JS

server {
	listen 80;
	listen [::]:80;

	server_name yourdomain.com;
	client_max_body_size 2000M;
	location / {
	proxy_pass http://127.0.0.1:7000;
	proxy_http_version 1.1;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection 'upgrade';
	proxy_set_header Host $host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-Proto $scheme;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_cache_bypass $http_upgrade;
	}
}

Run loadtest

npm install -g loadtest

Then run the app that you want to test with node app.js. We’ll start by testing the version that doesn’t use clustering.

With the app running, open another Terminal and run the following load test:

loadtest http://localhost:8000/v1/user -n 1000 -c 100

-n = network / requests

-c = concurrency

--rps = request per second

Read documentation loadtest

Result loadtest:

if you want to try 1000 requests you have to increase RATE_LIMIT=1000, by default 100 requests

Requests: 0 (0%), requests per second: 0, mean latency: 0 ms

Target URL:          http://localhost:8000/v1/user
Max requests:        1000
Concurrency level:   100
Agent:               none

Completed requests:  1000
Total errors:        0
Total time:          1.7057602980000002 s
Requests per second: 586
Mean latency:        162.8 ms

Percentage of the requests served within a certain time
  50%      136 ms
  90%      261 ms
  95%      337 ms
  99%      390 ms
 100%      419 ms (longest request)

Run tests

yarn test

Run with Docker

before the first docker build, we first check IPv4 private so that we can access the Database outside the docker container.

Adjust the config in .env like this:

...

DB_CONNECTION=mysql
DB_HOST=172.26.9.187 # example IPv4 private
DB_PORT=3306
DB_DATABASE=example
DB_USERNAME=your_username
DB_PASSWORD=your_password
DB_SYNC=
DB_TIMEZONE=+07:00

...

REDIS_HOST=172.26.9.187 # example IPv4 private
REDIS_PASSWORD=your_password
REDIS_PORT=6379

Building image docker

docker build . -t <your username>/expresso

Your image will now be listed by Docker:

$ docker images

# Example
REPOSITORY                      TAG        ID              CREATED
node                            16         3b66eb585643    5 days ago
<your username>/expresso        latest     d64d3505b0d2    1 minute ago

Run Image

docker run -p 7000:8000 -d <your username>/expresso

Print the output of your app:

# Get container ID
$ docker ps

# Print app output
$ docker logs <container id>

# Example
Running on http://localhost:8080

If you need to go inside the container you can use the exec command:

# Enter the container
$ docker exec -it <container id> /bin/bash

Release your version app

if you want to release the app version, you can use the following command :

yarn release

SMTP Basic

I use topol.io to create email templates, and it's free and can export to html format

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=465
MAIL_AUTH_TYPE=
[email protected]
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=

SMTP with Mailgun API

MAILGUN_API_KEY=your_api_key_mailgun
MAILGUN_DOMAIN=your_domain

SMTP Google Oauth Email ( Gmail )

MAIL_DRIVER=gmail
MAIL_HOST=
MAIL_PORT=
MAIL_AUTH_TYPE=OAuth2
[email protected]
MAIL_PASSWORD=
MAIL_ENCRYPTION=

OAUTH_CLIENT_ID=your_client_id
OAUTH_CLIENT_SECRET=your_client_secret
OAUTH_REDIRECT_URL=https://developers.google.com/oauthplayground
OAUTH_REFRESH_TOKEN=your_refresh_token

Setup Google Oauth

Author

👤 masb0ymas (Resume)

Github Twitter Linkedin

Support Me

ko-fi

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].