Skip to content

Michael-Seth/wave-tech-api

Repository files navigation

Wave Tech Assessment Backend

Table of Contents

Description

This is a NestJS API project that provides [provide a brief description of your project].

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js installed on your machine.
  • npm or Yarn package manager installed.

Installation

To clone and install the project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/your-repo.git
  2. Navigate to the project directory:

    cd your-repo
  3. Install dependencies:

    npm install

    or

    yarn

Environment Configuration

  1. Copy the .env.example file to create a new .env file:

    cp .env-example .env
  2. Update the .env file with the necessary configuration for your project, including the database connection details, JWT secret, etc.

Update the .env file with the necessary configuration for your project:

env Copy code

Database Configuration

DATABASE_TYPE=mysql DATABASE_URL= DATABASE_HOST=localhost DATABASE_PORT=3306 DATABASE_USERNAME=root DATABASE_PASSWORD= DATABASE_NAME=assessment DATABASE_SYNCHRONIZE=true

JWT Configuration

JWT_SECRET=Michael78 AUTH_JWT_TOKEN_EXPIRES_IN=7d

DATABASE_TYPE: The type of your database (mysql).

DATABASE_URL: The connection URL for your database (optional, if using a URL).

DATABASE_HOST: The hostname for your database server.

DATABASE_PORT: The port number for your database server.

DATABASE_USERNAME: The username for connecting to your database.

DATABASE_PASSWORD: The password for connecting to your database.

DATABASE_NAME: The name of your database.

DATABASE_SYNCHRONIZE: Set to true if you want TypeORM to auto-create or update the database schema.

JWT_SECRET: The secret key for JWT token generation.

AUTH_JWT_TOKEN_EXPIRES_IN: The expiration time for JWT access tokens.

Database Seeding

To seed data into the database, run the following command:

npm run seed

Running the Application

To start the application, use the following command:

npm run start

This will start the application at http://localhost:5000/api (or your specified port).

API Endpoints

  • POST /api/login: Login with the credentials below.

"email": [email protected]
"password": Michael007

Example: http://localhost:5000/api/login

  • GET /api/hospitals: Get a list of hospitals.

    Example: http://localhost:5000/api/hospitals

  • GET /api/users/:id: Get user details by ID.

    Example: http://localhost:5000/api/users/1

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. Feel free to modify and use it according to your needs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published