This is a HackerNews prototype based on Apollo GraphQL Server + Prisma as ORM.
-
Node above version 18+
https://nodejs.org/en/download
-
Most recent stable version of Docker
https://docs.docker.com/desktop/install/windows-install/
- 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
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
-
Select the db address in .env.example
-
Run postgres on docker
docker compose up postgresdb -d
-
Setup project by running
yarn setup
-
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
- To view data in production from prisma access the cloud dashboard
- After every local change in
prisma.schemais necessary to run a migration
npx prisma migrate dev --name "init"- Available prisma Studio for local database administration by running
npx prisma studioon CLI
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!
- Fork the Project
- Create your Feature Branch
(git checkout -b feature/amazing-feature) - Commit your Changes
(git commit -m 'feat(amazing-feature): my feature is awesome') - Push to the Branch
(git push origin feature/amazing-feature) - Open a Pull Request
- Automatic schema generation and typescript types from "code first" approach provided by Nexus GraphQL
- Prisma as type-safe ORM
- Pre-configured GraphQL server from Apollo Server
- Typescript support from ts-node-dev
