No description
| .vscode | ||
| npm-scripts | ||
| public | ||
| src | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Finalytix website static
Uses a static html utilizing Bootstrap template Agency and minimal frontend Javascript to send a message which gets forwarded as mail to info@finalytix.de.
Getting Started
## build the typescript sources to /dist
npm run build
## run the development server locally with nodemon
npm run dev
## run the server for production setup
npm run start
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying public/index.html and corresponding frontend script public/js/scripts.js.
Furhter adjustments on the api server will auto-deploy through nodemon.
Todos
- initialize git flow (terminal tool) and change to develop (protect main branch?)
- connect nodemailer to finalytix mail-service
- progress made but tackled some smtp related issues
- add nodeinstpector to
npm run devsetup to debug server code - test and enhance Dockerfile & docker compose usage
- add sanitizer to all uploaded data (/users/create, /contact, etc) to prevent INJECTIONS
- extract auth-routes in separate authentication-api using a
common-lib - extract auth-middleware in separate common library
common-libto keep it resuable (NPM or Gitlab pkg ?)- see: https://stackoverflow.com/a/27015550
- add userDB to store new contact as user
- add invoiceDB to store contact messages
- add blacklist with 24h auto-removal based on ip to avoid spam / DDOS (Treafik or common-lib ?)
- add logging with proper log-level (winston?) and compatible with graylog
- add frontend bundler like vite, rollup or webpack with proper tree-shaking
- add testing setup with nyc, mocha, supertest, nock?
Further topics
- check upgrade auf next.js ?
- rebuild frontend with reactjs + tailwind
Testing the api routes
## example to create a message request
curl --header "Content-Type: application/json" \
--request POST \
--data '{"name":"xyz","phone":"123", "email": "abc@ork.io", "message": "Aaaargh!"}' \
http://localhost:3000/api/contact
## example to create a user
curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"xyz","email":"abc@ork.io"}' \
http://localhost:3000/api/user/create