Skip to content

✂eBarber API: This API makes the data that is required to provide the services available to be consumed by our front-end applications: eBarber web and eBarber mobile.

Notifications You must be signed in to change notification settings

stevescruz/ebarber_backend

Repository files navigation


eBarber API

eBarber allows you to join as a client or a barber! If you are a client pick your favorite barber and schedule an available appointment. If you are a barber disclose your available times. This API makes the data that is required to provide the services available to be consumed by our front-end applications: eBarber web and eBarber mobile.

Goal   |    Requirements   |    Technologies   |    How To Use   |    License

API Endpoint Request API Endpoint Response

Goal

The goal is to create a full project using Node.js, ReactJS, and React Native from start to finish, fulfilling all possible steps: preparing the development environment with Docker, configuring tools that help maintain code quality (EditorConfig, ESLint and Prettier), to applying DDD methodologies, automated testing with Jest, deploying, and all the coding in between.

eBarber API makes the data that is required to provide the services available to be consumed by our front-end applications: eBarber web and eBarber mobile.

NOTE: Check the eBarber web here.

Requirements

  • Project structure
    • Add ts-node-dev
    • Prepare EditorConfig
    • Configure ESLint
    • Set up Prettier
  • Database
    • Docker PostgreSQL container
    • TypeORM
    • Appointments table
    • Users table
    • Migrations
  • Create User
    • User Model
    • Password Cryptography
  • Authentication
    • JWT
    • Session
    • Authentication Middleware
  • Avatar Images
    • Upload Files
    • Save Files in Local Disk
    • Serve Static Files
  • Exception Handling
    • Error Class
    • Global Exception Handler (Middleware)
  • Domain-driven Design (DDD) Methodologies
    • Reorganized Project File Structure
    • Refactored code to comply with Liskov Substitution Principle
    • Refactored code to comply with Dependency Inversion
    • Applied Dependency Injection with TSyringe
    • Isolated Hash Provider
    • Isolated Storage Provider
  • Test-driven Development (TDD)
    • Jest
    • Coverage Reports
    • Unit Tests for every Service related to Users
    • Unit Tests for every Service related to Appointments
  • Password Recovery
    • Nodemailer to handle emails
    • Ethereal fake SMTP server for development environment
    • Email templates with Handlebars template engine
    • Send Password Recovery Email
    • Password Reset
  • Update User Profile
    • Refactor users test to comply with DRY principle
    • Update User Profile Service
    • Profile Controller and Routes
  • Appointments
    • Refactor appointments tests to comply with DRY principle
  • More steps coming soon...

Technologies

This project was developed with the following technologies:

How To Use

To clone and run this application, you need Git, Docker, Node.js v10.16 (or higher), and Yarn v1.13 (or higher) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/stevescruz/ebarber_backend.git

# Go into the repository
$ cd ebarber_backend

# Install dependencies
$ yarn install

# Create and run the docker container with the PostgreSQL database
$ docker run --name ebarber-postgres -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres

# Run the app
$ yarn dev:server

📝 License

This project is under the MIT license.


Get in touch with me!

About

✂eBarber API: This API makes the data that is required to provide the services available to be consumed by our front-end applications: eBarber web and eBarber mobile.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published