Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hoaxify

First attempt to use TDD (Test Driven Development) in Node.js.

Hoaxify is a backend application built with Node.js and Express, demonstrating the implementation of TDD principles. It uses SQLite for the database and Sequelize as the ORM.

Technologies Used

  • Node.js: Runtime environment.
  • Express: Web framework for Node.js.
  • Sequelize: Promise-based Node.js ORM.
  • SQLite: Self-contained, serverless, zero-configuration, transactional SQL database engine.
  • Jest: JavaScript Testing Framework.
  • Bcrypt: Library to help hash passwords.

Getting Started

Prerequisites

  • Node.js installed on your machine.

Installation

  1. Clone the repository:
    git clone <repository_url>
  2. Navigate to the project directory:
    cd hoaxify
  3. Install dependencies:
    npm install

Running the Application

To start the server in development mode with nodemon:

npm start

The server runs on http://localhost:3000 (or the configured port).

Testing

This project uses Jest for testing. To run the tests:

npm test

This runs jest in watch mode.

API Reference

User Registration

Files: src/user/UserRouter.js, src/user/UserService.js

  • URL: /api/v1/users
  • Method: POST
  • Description: Registers a new user.
  • Request Body:
    {
      "username": "user1",
      "email": "user1@mail.com",
      "password": "Password1"
    }
  • Success Response:
    • Code: 200 OK
    • Content:
      {
        "message": "User created"
      }

Project Structure

hoaxify/
├── src/
│   ├── config/         # Database configuration
│   ├── user/           # User module (Model, Router, Service)
│   └── app.js          # Express app setup
├── _test_/             # Tests directory
├── index.js            # Entry point
├── package.json        # Dependencies and scripts
└── readMe.md           # Project documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages