WebApp is built on Node.js, a server-side JavaScript runtime environment that enables the development of fast and scalable network applications..
workflow
- Users can create a new account with email address, password, first name, and last name.
account_createdis auto-set to the current timestamp upon successful user creation.- Users cannot set values for
account_createdandaccount_updated. Any provided values are ignored. Passwords are not returned in the response. - Email addresses serve as the username.
- Passwords are stored securely using BCrypt hashing with a salt.
- Users can update only their first name, last name, and password.
- The
account_updatedtimestamp is refreshed upon successful user updates. - Users can only alter their own account information.
- Users can retrieve all of their account details except for the password.
- Visual Studio Code (IDE)
- POSTMAN (for API testing)
- MySQL Database
- Node.js
- Digital Ocean (Hosting)
- Development Server:
npm start - Run Tests:
npx jest
- Health Check:
GET-http://localhost:3000/healthz/ - List Assignments:
GET-http://localhost:3000/v1/assignments/ - Create Assignment:
POST-http://localhost:3000/v1/assignments/ - View Assignment:
GET-http://localhost:3000/v1/assignments/{id} - Delete Assignment:
DELETE-http://localhost:3000/v1/assignments/{id} - Update Assignment:
PUT-http://localhost:3000/v1/assignments/{id}
200 OK- The request succeeded.201 Created- A new resource was created as a result.204 No Content- The request succeeded with no content to return.400 Bad Request- Invalid request syntax.401 Unauthorized- Authentication required.403 Forbidden- Valid request but the server refuses action.500 Internal Server Error- The server encountered an error.503 Service Unavailable- The server is currently unavailable.
- Clone or download and unzip the repository.
- Create the required files in your preferred IDE.
- Install dependencies and start the server using
npm start. - Use Postman to test the APIs.
- Monitor the database to reflect on the operations conducted via APIs.
- Ensure the returned status codes align with the requirements.
- Service Status:
http://localhost:8080/healthz/should return200 OK. - View Assignments:
http://localhost:8080/cloud/assignments/should return204 No Content.