This is a server for an employee directory application built with Node.js, Express, and AWS services.
-
Clone the repository:
git clone https://github.com/Mr-Dipak/Employee-Directory-Web-Application-AWS cd employee-directory-application -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory and add the following environment variables:NODE_ENV=development PORT=8081 AWS_PROFILE=default PHOTOS_BUCKET=<your-s3-bucket-name> DEFAULT_AWS_REGION=<your-aws-region> SHOW_WARNINGS=1 SHOW_ADMIN_TOOLS=0
-
Update the
constants.jsfile in theapi/commondirectory if needed:exports.NODE_ENV = process.env.NODE_ENV || 'production'; exports.PORT = process.env.PORT || 80; exports.AWS_PROFILE = process.env.AWS_PROFILE || 'default'; exports.PHOTOS_BUCKET = process.env.PHOTOS_BUCKET || ''; exports.DEFAULT_AWS_REGION = process.env.DEFAULT_AWS_REGION || ''; exports.SHOW_WARNINGS = process.env.SHOW_WARNINGS || 1; exports.SHOW_ADMIN_TOOLS = process.env.SHOW_ADMIN_TOOLS || 0; exports.TABLE_NAME = 'Employees';
-
Start the server:
npm run start
-
For development mode:
npm run start:dev
GET /api/employees- Get all employeesGET /api/employees/images- Get all employee imagesPOST /api/employees/create- Create a new DynamoDB table for employeesPOST /api/employees/employee-photo- Get an employee photoPOST /api/employees/get-upload-url- Get a signed URL for uploading an employee photoPUT /api/employees/add- Add a new employeePUT /api/employees/update- Update an existing employeeDELETE /api/employees/delete/:id- Delete an employee by ID
GET /api/settings- Get application settingsGET /api/settings/info- Get AWS instance informationPOST /api/settings/stress- Stress test the serverPOST /api/settings/cpu- Get CPU usagePOST /api/settings/set-bucket- Set the S3 bucket name
This project is licensed under the MIT License.