A full stack solution to Caesar's Cipher built with an Angular 8 frontend and a Nest.js backend in node.js. Will take an input phrase and a specified offset ammount, and output the correctly encoded solution.
- Initialize node package manager
npm init -y
- Initialize & run Angular client app
npm install -g @angular/cli
ng new client
cd client
ng serve --open
- Initialize & run Nest server
npm install -g @nestjs/cli
nest new server
cd server
npm run start
- Add Jest to CLI for testing
npm install -g jest-cli
As a user I would like to be able to...
- enter a phrase (string) and a offset ammount (number) into a form
- submit that form to make an API call
- receive a correctly encoded string in return
- see error messages/visual feedback for invalid inputs/bad requests/etc..
- see my previous search queries even as the page reloads
- contain the logic for the Caesar's Cipher
- implement uniting testing (see..
./api/src/ciphers.controller.spec.ts
)
In addition to the Angular, Node, Nest, npm, and Jest documentation listed above, these resources were also used for additional learning/guidance:
- Codevolution Angular Forms Tutorial
- Academind Learn Nest.js from Scratch
- Nest Security Page (re: CORS issue)
- Medium dltlabs Unit testing with NestJS
- Jest Cheatsheet
In future iterations of this project I would like to...
- implement functionality that utilizes the other attributes of the
cipher
resource in the API (ie not just 'encoded') - implement functionality that utilizes the other HTTP requests (ie 'get', 'patch', 'delete')
- eg. add 'get' (index) and 'delete' routes (and adjust client to generate index view from this API - not localStorage) - so that user can delete a specific query, rather than only all of them
- eg. add 'get' (show) and 'patch' routes so that user can adjust the phrase/offset ammount for a specific previous query