Express + TypeScript + Boilerplate for Web / API App
Hey There! π
π€Ύ that βοΈ button if you like this boilerplate.
A boilerplate for Node.js App.
process.env
- DotEnv package is used..env
file).Handler
& NativeEvent
.Log.info('Your message should go here!')
. Other options for logging are Log.warn
, Log.error
& Log.custom
.Note: I am mentioning only files/folders which you need to configure if required
βββ dist
βββ public
βββ src
β βββ controllers
β β βββ Api
β β β βββ Auth
β β β β βββ Login.ts
β β β β βββ RefreshToken.ts
β β β β βββ Register.ts
β β β βββ Home.ts
β β βββ Auth
β β β βββ Login.ts
β β β βββ Logout.ts
β β β βββ Register.ts
β β β βββ Social.ts
β β βββ Account.ts
β β βββ Home.ts
β βββ exception
β β βββ Handler.ts
β β βββ NativeEvent.ts
β βββ interfaces
β β βββ models
β β β βββ user.ts
β β βββ vendors
β β βββ index.ts
β β βββ INext.ts
β β βββ IRequest.ts
β β βββ IResponse.ts
β βββ middlewares
β β βββ CORS.ts
β β βββ CsrfToken.ts
β β βββ Http.ts
β β βββ Kernel.ts
β β βββ Log.ts
β β βββ Statics.ts
β β βββ StatusMonitor.ts
β β βββ View.ts
β βββ models
β β βββ User.ts
β βββ providers
β β βββ App.ts
β β βββ Cache.ts
β β βββ Database.ts
β β βββ Express.ts
β β βββ Locals.ts
β β βββ Passport.ts
β β βββ Queue.ts
β β βββ Routes.ts
β βββ routes
β β βββ Api.ts
β β βββ Web.ts
β βββ services
β β βββ strategies
β β βββ Google.ts
β β βββ Local.ts
β β βββ Twitter.ts
β βββ index.ts
βββ views
β βββ includes
β βββ modals
β βββ pages
β βββ partials
β βββ static
β β βββ css/*.css
β β βββ js/*.js
β βββ layout.pug
βββ .env
βββ .gitignore
βββ nodemon.json
βββ package.json
βββ README.md
βββ tsconfig.json
βββ tslint.json
Below mentioned are the steps to install, configure & run in your platform/distributions.
# Clone the repo.
git clone https://github.com/GeekyAnts/express-typescript.git;
# Goto the cloned project folder.
cd nodets;
# Without Docker
# Note: It is assumed here that you have MongoDB running in the background and that you have created the database.
# Install NPM dependencies.
# Note: You can review the list of dependencies from the below link.
# https://github.com/faizahmedfarooqui/nodets/network/dependencies
npm install;
# Edit your DotEnv file using any editor of your choice.
# Please Note: You should add all the configurations details
# or else default values will be used!
vim .env;
# Run the app
npm run dev;
# With Docker
# Note: It is assumed here that you have Docker running in the background.
# Run the app in docker as a foreground process
docker-compose up
# Run the app in docker as a background process
docker-compose up -d
# Web Routes:
+--------+-------------------------+
Method | URI
+--------+-------------------------+
GET | /
GET | /signup
POST | /signup
GET | /login
POST | /login
GET | /logout
GET | /account
GET | /auth/google
GET | /auth/google/callback
GET | /auth/twitter
GET | /auth/twitter/callback
GET | /status-monitor
+--------+-------------------------+
# API Routes:
+--------+-------------------------+
Method | URI
+--------+-------------------------+
POST | /api
POST | /api/auth/login
POST | /api/auth/register
POST | /api/auth/refresh-token
+--------+-------------------------+
Note: This page has sub-sections, like about-us, contact-us & portfolio
Note: LogIn with Providers
Note: SignUp with Providers
Note: In case the requested URI does not exist, app shows this page
Note: In case an error is generated, so instead of plain errors we can show the under maintenance page.