Giter Club home page Giter Club logo

interview-fcrm's Introduction

This is a Repository for the Fans-CRM Technical interview performed by Bryan Asega on using the
Nest.js framework, MySQL, and JWT authentication.
The steps performed are as follows:

Environment Setup

  1. Install Node.js
  2. Set up development environment in Visual Studio Code (VSCode)

Project Initialization

  1. Initialize a new Nest.js project using the Nest CLI:

    npm install -g @nestjs/cli nest new nestjs-rest-api

  2. Navigate to the newly created project directory and start the Nest.js server:

    cd nestjs-rest-api npm run start

Install Dependencies

  1. Install Sequelize ORM and MySQL dialect for Sequelize:

    npm install --save @nestjs/sequelize sequelize mysql2

  2. Install JWT module for authentication:

    npm install --save @nestjs/jwt passport passport-jwt

Configuration

  1. Set up MySQL database connection in the config directory.
  2. Configure Sequelize to connect to MySQL database in the config directory.

Create User Module

  1. Generating a new module for users:

    nest generate module user

  2. Generate a user controller and service:

    nest generate controller user nest generate service user

Defining User Entity

  1. Define a user entity using Sequelize model in the user directory.
  2. Define attributes : id, name, email, email

### Implementing Authentication
  1. Create an authentication module with JWT token generation and validation.
  2. Implementing the JWT strategy using Passport.js.

### Implementing REST Endpoints
  1. Defining a POST endpoint to add a user (/api/v1/add-user).
  2. Defining a GET endpoint to get a user by ID (/api/v1/get-user/:id).
  3. Implementing corresponding controller method to handle requests and interact with database.

### Test the Application
  1. Performing unit tests for services, controllers, and authentication logic.
  2. Using curl; testing REST API endpoints.

Runing Application

  1. Starting Nest.js server:

    npm run start:dev


### Future Development steps
  1. Deploy the application to a production server.
  2. Monitor and maintain the application ensuring its reliability and performance.

interview-fcrm's People

Contributors

asega-bryan07 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.