git clone https://github.com/asaad2121/eMedicHub-API.git
cd eMedicHub-API
npm install
Copy the contents of /env.example
in the .env
file in the root directory
npm run dev
This uses nodemon
to auto-reload on changes.
Command | Description |
---|---|
npm run dev |
Start server with nodemon |
npm run format |
Format code with Prettier |
npm test |
Placeholder for running tests |
Before you start working on a new feature or fix, create a new branch:
git switch -c your-branch-name
This creates and switches you to a new branch.
git push -u origin your-branch-name
- Go to the repository on GitHub.
- You’ll see an option to "Compare & pull request" after pushing your branch.
- Add a meaningful title and description.
- Assign a reviewer (if needed), then click Create pull request.
Make sure your code is formatted and tested before creating a PR.
emedichub-api/
│
├── index.js # Entry point
├── routes/ # API route handlers
├── controllers/ # Logic for each route
├── middleware/ # Auth, error handling, etc.
├── models/ # DB models/schemas (if any)
├── .env # Environment variables
├── package.json
└── README.md
To format all code with Prettier:
npm run format
We have a script to reset (delete and recreate) all DynamoDB tables and seed initial data for local development and testing purposes.
Important:
This script must only be run in your local development environment. Running it on production or shared environments can result in data loss!
-
The reset script checks environment variable
ENVIRONMENT
to ensure it only runs when:ENVIRONMENT=dev
-
If these conditions are not met, the script will refuse to run.
npm run reset-db
---