- Install npm in your computer, if you have node installed then most likely you have npm.
- Run
npm install
inside both thebackend
andbackend
folders. - In a terminal window, navigate to the backend directory and run
npm run dev
orrun start
. Please note that running the app in dev mode will cause the server to reload on code changes and lose all created in memory data. - Open another terminal window and navigate to the frontend directory and run
npm start
- Navigate to
http://localhost:4200/
in your browser. - You can also run the jasmine tests using
npm test
and run the eslint on all files usingnpm run lint
- Install docker on your machine.
- Build the docker containers of the application frontend and backend using the command
docker compose -f docker-compose-build.yaml build --parallel
- Start the application using
docker compose up
- Navigate to
http://localhost:8080/
in your browser.
In this section, I would like to propose an architecture to deploy the announcements' app. The architecture is still not implemented due to time limitation of the task. I have opted to use AWS Amplify service as an infrastructure bootstrapper of AWS resources for the following reasons:
- Amplify makes it easy to compose our architecture serverless components such as s3 buckets (including the necessary permissions and website hosting setup), and API gateway that connects to a lambda hosting a express server application.
- I opted for an opensearch based as a source of truth. Opensearch allows extremely fast search text data such as the announcements contents. I have built the backend to be able to implement other storage options via the storage adapter and easily inject the new storage type without changing the business logic code in the API endpoints.
- As a limitation of Amplify, opensearch domains cannot be created with Amplify cli with the current service setup, However, the domain can be created as a custom resource in amplify with the help of CDK or CloudFormation and integrated into amplify backend configuration to make the lambda function aware of that domain.
- With Amplify we get a CI/CD pipeline out of the box. It can be configured to run the backend jasmine tests, as well as Cypress E2E tests (e2e tests are not implemented yet).
- The architecture is highly available and scalable with proper configurations of the opensearch domain (Availability Zones, instance type, and number of nodes).