This is a NestJS API project that provides [provide a brief description of your project].
Before you begin, ensure you have met the following requirements:
To clone and install the project, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git
-
Navigate to the project directory:
cd your-repo
-
Install dependencies:
npm install
or
yarn
-
Copy the
.env.example
file to create a new.env
file:cp .env-example .env
-
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_TYPE=mysql DATABASE_URL= DATABASE_HOST=localhost DATABASE_PORT=3306 DATABASE_USERNAME=root DATABASE_PASSWORD= DATABASE_NAME=assessment DATABASE_SYNCHRONIZE=true
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.
To seed data into the database, run the following command:
npm run seed
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).
- 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
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. Feel free to modify and use it according to your needs.