Skip to content

ChrisLegaxy/express-ts-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express TS Auth 🙌🎇🎆

MongoDB, Express, Node JS

This application was built by following the best practices and also written in TypeScript

Description

This was built using Express JS Framework, written in TypeScript following OOP concepts

Storing Configuration: Stores into process.env using DOTENV

Database: Uses MongoDB object modeling with Mongoose

Routing: Uses express router

Form Validation: Uses express validator

Token: Uses JWT

Contents

Global requisites

App Structure

│   index.ts
│
├───controllers
│   └───api
│       └───auth
│               Login.ts
│               Register.ts
│
├───interfaces
│   └───models
│           User.ts
│
├───middlewares
│   │   CORS.ts
│   │   Http.ts
│   │   Kernel.ts
│   │
│   └───validators
│           Login.ts
│           Register.ts
│
├───models
│       User.ts
│
├───providers
│       App.ts
│       Database.ts
│       Express.ts
│       Locals.ts
│       Routes.ts
│
└───routes
    │   default.ts
    │
    └───api
            index.ts

Install, Configure & Run

# Clone Repo
$ git clone https://github.com/ChrisLegaxy/MENN-auth-api.git

# Go into the directory
$ cd MENN-auth-api

# Install dependencies
$ npm install

# Edit .env file based on yours
$ vim .env

# Run in development mode
$ npm run dev

Routes

# API Routes:

+--------+-------------------------+
  Method | URI
+--------+-------------------------+
  POST   | /api/auth/login
  POST   | /api/auth/register
+--------+-------------------------+

Author

Vansen Hengmeanrith (Chris) 😎

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Releases

No releases published

Packages

No packages published