Skip to content

joachim-vogt/census-api

Repository files navigation

Census API

**This is a full CRUD featured REST API for admins to manage participant data - built with Express, Sequelize, MySQL, and deployed using DigitalOcean on Aiven.io and Render.com

Technologies used

  • NodeJS/Express
  • Sequelize ORM
  • MySQL hosted on aiven.io
  • render.com
  • dotenv for enviroment configuration
  • winston for logging
  • Postman for endpoint testing

Features

  • Basic Authentication with bcrypt and admin seeding during database initialization.
  • FULL CRUD for Participant with its Home and Work relationships.
  • Sequelize query validation + custom built error handling.
  • MVC structure and service layers
  • Logging with winston and native JS
  • Cloud database

Available Endpoints with JSON responses

  • GET:
    • /participants | Find all participants
    • /participants/details | Find all names and emails
    • /participants/:email | Find spesific participant by email
    • /participants/work/:email | Find work info by email
    • /participants/home/:email | Find home info by email
  • POST:
    • /participants/add | Add new participants
  • PUT:
    • /participants/:email | Update a participant by email
  • DELETE:
    • /participants/:email | Delete a participant and assosicated Work and Home by email

Security

  • Admin authentication with Basic Authentication using bcrypt hash comparison
  • Secrets and configuration in enviroment variables
  • Cascade deletion with foreign key setup in Sequelize

Deployment

Setup instructions in local terminal

git clone https://github.com/joachim-vogt/census-api.git cd census-api npm install cp .env.example .env npm start

Link to hosted app: https://census-api-mzqm.onrender.com/

Author

Joachim Vogt - Built as backend development project for Noroff Tech School

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors