Skip to content

thinktapper/DinderIsServed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dinder Is Served 🍽️

The backend for Dinder πŸ«ƒ

RESTful API Server

Screenshots β€’ How It's Made β€’ Usage β€’ Optimizations β€’ Summary β€’ Author


πŸš€ Live project: Dinder Is Served

Screenshots

Show Images

πŸ§‘β€πŸ”¬ How It's Made

Designed and built from scratch using the Node.js runtime & Express.js for handling routes and creating Dinder's API endpoints. Users are able to create accounts and log in, update profile information and create location-based feasts containing restaurants tailored to their occasion. Real-time establishment data is sourced from Google Maps and are stored alongside user votes in a PostgreSQL database. I also created authentication middleware to protect the API using JWTs, and authorization middleware to prevent voter fraud. The web service and hosted DB are both deployed on Render.

Built With:

  • Node
  • Prisma
  • Express
  • TypeScript
  • PostgreSQL
  • GoogleMaps

Database Schema:

πŸ—οΈ Usage

  1. Clone the repository

    git clone https://github.com/thinktapper/DinderIsServed.git

  2. Install the necessary packages

    Go to the main directory and install the necessary packages

    cd DinderIsServed/
    npm i
  3. Add credentials

    A .env file will need to be added to the project root with the following variables:

    DATABASE_URL="postgresql://<username>:<password>@localhost:5432/<database>?schema=public"
    SECRET="<your-jwt-secret>"
    GOOGLE_API="<your-google-maps-api-key>"
  4. Create the database

     npx prisma migrate dev --name init
  5. Run the server

     npm run dev

    The server will be running on localhost:3000

πŸ‹οΈβ€β™‚οΈ Optimizations

With time, I plan to add the following features:

  • Implement rate limiting to prevent brute force attacks
  • Resolve security vulnerabilities in dependencies
  • Add feature for users to create groups of friends/family members called Herds
  • Create sharable links for inviting other users (registered or not) to join Herds
  • Add a feature so users can add restaurants to their favorites
  • Add a feature so users can filter restaurants by various criteria
    • Add options for that criteria in the feast creation form & persist in the database
  • Add more detailed documentation for the API endpoints.

See the open issues for a full list of proposed features (and known issues).

πŸ“ Summary

This project was a great way to learn more about the backend and how to create a Node + Express REST API server in TypeScript. I learned a lot about authentication & authorization by rolling my own auth middleware, and about how to deploy a secure API.

Key takeaways:

  • Strengthened skills needed to plan, scope, research, and deploy an API.
  • Learned how to use JWTs to authenticate users and protect routes.
  • Practiced creating middleware to protect voting integrity amongst users.
  • Practiced using Prisma to generate relational database models and interact with the DB.
  • Learned how to create a seed script to populate the database with mock data.
  • Learned how to use the Google Maps API to fetch real-time restaurant data.
  • Learned how to set up continuous deployment with CI.
  • Gained experience debugging and troubleshooting TypeScript and ESLint build errors and deployment issues.

πŸ‘¨β€πŸ’» Author

MadeByTapper LinkedIn

Andrew Tapper - @thinktapper - [email protected]

Frontend | Client app: https://github.com/thinktapper/DinderRN

Parent Project: https://github.com/thinktapper/dinder

License

GNU License

Distributed under the GNU GPLv3. See LICENSE for more information.