mukul-pathania / pollroombackend

Backend for my realtime voting website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

PollRoom

GitHub issues GitHub pull requests Website GitHub last commit GitHub Workflow Status (branch)

This repository contains the back-end of PollRoom.

The website is live at https://pollroom-six.vercel.app and code, description for the front-end can be found at https://github.com/mukul-pathania/pollroom.

I have built a simple express server using typescript with which the website communicates. Used Prisma backed by a PostgreSQL database to model my data.

Used passport-local and passport-google-oauth20 to authenticate users with their email or google accounts. Json web tokens(JWT) are provided on login which are used with further requests to authorize users.

Sendgrid powers the emails used for signing up users, resetting passwords etc.

Most important functionality of this project, that is, realtime communication is made possible by SocketIO.

This application is hosted on Heroku, which is deployed after running tests through a CI-CD pipeline using Github Actions.

Technologies used

Just to list the tech used:

  1. Typescript
  2. Express.js
  3. Prisma
  4. Passport.js
  5. Sendgrid
  6. SocketIO
  7. Github Actions

Development

You can clone this repository using git and install all the dependencies to start with development.

#Clone the repo first
git clone https://github.com/mukul-pathania/pollroombackend.git

#Install all the dependencies
yarn

Then create a file named .env with proper values for the keys defined in app/config/index.ts, after you have done this we can start the development server.

#Start the development server
yarn dev

The server should be up and running now.

You might also need to setup the fornt-end/client-side of this application for development, instructions for setting that up should be found here.

Testing

I have written some integration tests that tests the whole application with a real database. This setup is made possible by running the database on docker. You should have docker installed on your system and then testing the application is as simple as running:

yarn test

Star this repository if you learned anything from this.

About

Backend for my realtime voting website


Languages

Language:TypeScript 97.4%Language:JavaScript 2.6%