Skip to content

Latest commit

 

History

History
124 lines (85 loc) · 3.88 KB

README.md

File metadata and controls

124 lines (85 loc) · 3.88 KB

Fitnessist Webservice

Documentation

Prerequesite

If you don't want to use the Docker. You have to install

  1. NodeJS ^18.x
  2. PostgreSQL ^12.x

Installation

Without Docker

  1. Clone the repository:

    $ git clone https://github.com/Fitnessist/backend-service.git 
    $ cd clean-rest-typescript-boilerplate
  2. Install the dependencies:

    $ npm install
  3. Rename the .env.example file to .env:

    $ mv .env.example .env
  4. Open the .env file and fill in the necessary environment variables with your configuration.

  5. Run the migrations

    $ npm run migrate

With Docker

  1. Clone the repository:

    $ git clone https://github.com/Fitnessist/backend-service.git 
    $ cd clean-rest-typescript-boilerplate
  2. Rename the .env.example file to .env

    $ mv .env.example .env
  3. Open the .env file and fill in the necessary environment variables with your configuration.

  4. Build and run the Docker containers:

    $ docker-compose up -d

    This will start the server and the PostgreSQL database container.

  5. Access the container

    $ docker exec -it app bash
  6. Run migration

    $ npm run migrate

Usage

Without Docker

  1. Start the server:

    $ npm start

    This will start the server and make it accessible at http://localhost:8000. You can then make API requests using tools like curl or Postman.

With Docker

  1. Build and run the Docker container:

    $ docker-compose up -d

    This will start the server and the PostgreSQL database container. The server will be accessible at http://localhost:8000. You can then make API requests using tools like curl or Postman.

Make sure to choose the appropriate installation method (with or without Docker) based on your preference and requirements. Customize the instructions as needed to match the specific configurations and commands used in your project.

Testing

$ npm test

This will run the test suite and display the results in the console.

Technologies and Libraries

  • TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
  • Express.js: A fast and minimalist web framework for Node.js.
  • Node.js: A JavaScript runtime built on Chrome's V8 JavaScript engine.
  • PostgreSQL: A powerful, open-source relational database system.
  • bcrypt: A library for hashing passwords.
  • jsonwebtoken: A library for generating and verifying JSON Web Tokens (JWT).
  • winston: A versatile logging library for Node.js.
  • fastest-validator: A library for data validation.
  • uuid: A library for generating universally unique identifiers (UUIDs).
  • module-alias: A library for creating aliases for directories.

Feel free to customize this template to fit your specific project requirements. Make sure to include all the necessary information that will help users understand and interact with your project.