Giter Club home page Giter Club logo

fullstack's Introduction

Fullstack Collection App

This repo is designed to provide space to code a fullstack app. It contains node modules and folders for databases, routes, API requests and React components that'll use React Query. Let's get going!

Setup

0. Cloning and installation

  • Clone this repo, navigate to it, install packages, and start the server with npm run dev

    Tip

    You may also want to start a new branch

    cd my-fullstack-collection
    npm i
    git checkout -b <branchname>
    npm run dev
More about using npm vs npx
  • When running knex, run npm run knex <command>, e.g. npm run knex migrate:latest rather than using npx

Requirements

1. Choosing your data set

  • First, decide what you would like to keep a collection of. This could be a repo for keeping track of movies, books, gifs, cars, rocks, anything you fancy, but keep it simple!

    More about your collection

    Note: the aim is to have some simple data. If you think you might need more than one database table, or have lots of details you want to store, how could you simplify the information you're keeping track of? Leave more complex data until later in the project. For example, I want to keep track of books that I want to read, ones that I have read, and ones that I own. To start with though, let's keep track of the books themselves. My data might look like:

    id title author
    1 Ready Player One Ernest Cline
    2 Throwing Rocks at the Google Bus Douglas Rushkoff

Our first job is getting something showing on the front end from our database. Here's a list of steps in case they are useful. You can build in any order you like though ;)

Back end

2. Building the database

  • Design a database to store a list of your things (e.g. books)
  • Build the migrations and seed data

3. Building the API

  • Build an API (back end route) to get the information from your database
  • Test your API with Insomnia

Front end

4. Setting the stage

  • Build a React component with static html

5. Building the API client

  • Build an API client in the front end to request the information from your routes

6. Querying Data

  • Write a query with the useQuery hook to fetch the collection data from the API
  • Display the collection data you queried in a component (you may want to create a new component for this)

7. Create Data

  • (Optional) Create a new component for your new collection item form
  • Mutate data with the useMutation hook to create a new collection item via the API

8. Delete Data

  • Mutate data with the useMutation hook to delete an exisiting collection item via the API (you may want to add this to your collection display component)

9. Update Data

  • (Optional) Create a new component for your update collection item form
  • Mutate data with the useMutation hook to update an exisiting collection item via the API

Stretch

More about stretch challenges
  • Forms can be tough to build accessibly. First ensure all parts of your form can be reached and used with keyboard-only navigation. Then test your form page with the WAVE browser extension, and fix any accessibility issues it detects
  • Is there any complex data you chose to not include earlier or any way you could expand this dataset?
    • You might have some other information (e.g. unread books vs. read books) that should be included in your database design, and this may require adjusting your database design
  • Could you add an external API (maybe an inspirational quote in the footer?)
  • If you haven't already, CSS!

Provide feedback on this repo

fullstack's People

Contributors

tominne avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

beansplusplus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.