README
MIT License
1 min read · 9 months ago

Real Time Voting API

GitHub

    APINode.jsWeb SocketsPrismaRedisPostgreSQLRocketseat

Project from NLW Expert with @Rocketseat where we built a real time voting app API using Web Sockets.

This app provides a platform where users can create and vote on polls and check their results in real time. For this, all poll’s data are stored with a PostgreSQL database. Thinking about performance and scalability, Redis is used to store the number of votes. With web sockets connection, it is possible use the real time feature.

Stack

  • Fastify;
  • Prisma ORM;
  • PostgreSQL;
  • Redis;
  • Typescript;
  • Zod;

Routes

POST Vote on poll

{BASE_URL}/:pollId/votes

GET Get poll

{BASE_URL}/poll/:poolId

POST Create poll

{BASE_URL}/poll

Body:
  Title: string
  Options: strings array