/star-wars-info

This project is a wrapper information site for the official [stars wars API](https://swapi.dev/), built using Apollo GraphQL server and React client.

Primary LanguageTypeScript

star-wars-info

This project is a wrapper information site for the official stars wars API, built using Apollo GraphQL server and React client.

Demo picture

Built With

  • React
  • Typescript
  • GraphQL
  • Nodejs
  • Prisma

Live site

Description

This project is a wrapper information site for the official stars wars API, built using Apollo GraphQL server and React client.

Run server locally

Clone this git repo.

Setting Up Local Database

  • Install and set up postgresql, if not already installed. You can visit this tutorial for information on how to install postgresql.

  • Create the database and take note of the credentials.

  • Create a file named .env in the server directory according to the .env-example file, and add the relevant database credentials.

  • To start the client, open the terminal and inside the project root folder type the following

cd client
yarn install
yarn start
  • Open another tab in the terminal(CTRL+SHIFT+T) and type the following to run server
cd server
yarn install
npx prisma migrate dev --name init
yarn server

Authors

👤 Marylene Sawyer

Acknowledgements

Deployment

Heroku

  • cd client && npm run build-deploy
  • cd server
  • Initialize git heroku repo accorging to instructions

Loading the schema to heroku database

  • heroku run npx prisma db push --preview-feature

Potential Future Improvements / Ambitions

  • Integrate with more API's
  • Review and refurbish the styling
  • Add more code testing
  • Add more information/pages such as the user profile page

Fly.io

  • Both the code for the static and non-static site reside in one folder for this project

  • Deploying static site:

  • Deploying non-static site:

    • Remove the Dockerfile for deploying the static site (you can just temporarily rename it to something else)
    • Follow instructions in the Fly.io documention
      • To make sure you're deploying the non-static and not the static site, run: flyctl deploy --app starwars-api, and vice-versa.

🤝 Contributing

Contributions, issues and feature requests are welcome!