Skip to content

jefersoneiji/hackernews-graphql-back-end

Repository files navigation

Hackernews GraphQL Back-End

This is a HackerNews prototype based on Apollo GraphQL Server + Prisma as ORM.

hackernews-graphql-back-end

Prerequisites

  • Node above version 18+

      https://nodejs.org/en/download
  • Most recent stable version of Docker

      https://docs.docker.com/desktop/install/windows-install/

Features

  • User operations: create account and login
  • Post as link
  • Vote/unvote links
  • Query several links at a time or one
  • Filter, sort and paginate links

Installing

Warning: For windows users use bash instead of powershell or cmd

  • Clone this project

      git clone https://github.com/codeLearnerrr/hackernews-graphql-back-end.git
  1. Select the db address in .env.example

  2. Run postgres on docker

      docker compose up postgresdb -d
  3. Setup project by running

    yarn setup

Docker

  • To run all docker compose services

    docker compse up -d
  • To delete this project fully from the computer execute

    docker compose down --volumes --rmi all

Project Notes

  • To view data in production from prisma access the cloud dashboard
  • After every local change in prisma.schema is necessary to run a migration
npx prisma migrate dev --name "init"
  • Available prisma Studio for local database administration by running
npx prisma studio

on CLI

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit your Changes (git commit -m 'feat(amazing-feature): my feature is awesome')
  4. Push to the Branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Acknowledgments

About

Hackernews GraphQL based back-end, built on top of Apollo Server

Topics

Resources

License

Stars

Watchers

Forks

Contributors