Skip to content

swordensen/suggestion_box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Project: Suggestion Box - Michael Sorensen

This coding project is designed to showcase my ability to create full-stack applications. I spent roughly 8 hours on this project spread over 2 days.

How it works

Create a suggestion

You can create a new suggestion by filling out the form on the home page

Video

Contribute to a discussion

Opening the suggestion page shows a discussion forum below the suggestion. Users can type into the available text field to add to the discussion

Video

Getting Started

🔨 Building From Source 🔨

  1. Download Node.js https://nodejs.org/en/download
  2. download the source code ex. git clone [email protected]:swordensen/suggestion_box.git
  3. Navigate to the server directory ex. cd server
  4. Install dependencies npm install
  5. Start Server npm start
  6. Open a new terminal and navigate to client directory cd client
  7. Install dependencies npm install
  8. Start Vite server npm run dev
  9. Open browser to http://localhost:5173

🐋 Building With Docker 🐋

I built this app on my windows machine. If you run into any errors using the above steps please try running the app using docker

  1. Install Docker

  2. Clone the repository on to your prod server

    foo@bar:~$ git clone [email protected]:swordensen/suggestion_box.git
  3. Run

    foo@bar:~$ docker compose up

Database Relationship Diagram

---
Entity Relationship Diagram
---
erDiagram
    USER ||--o{ SUGGESTION : hasMany
    USER ||--o{ COMMENT : hasMany
    SUGGESTION ||--o{ COMMENT : hasMany
Loading

How would I improve this application given more time

Note

This is by no means a complete list

  • Better error handling/ type validation
    • I added some error handling and type validation but, I know this can be improved
  • More tests
    • I have some unit tests on the server side of the app but, coverage is like 5%. And there are no tests on the client side
  • Use State on client
    • Because this app is so small, I elected to just use context hooks to manage state. If I had more time I would likely migrate state to zustand.
  • Implement authentication
    • The app does not handle authentication at all. Authentication is currently mocked by custom middleware on the server

Notes to share with reviewer

  • The app automatically generates a mock user and assigns it to all requests
  • The app automatically seeds the database with 3 random users, 3 random suggestions per user and 3 random comments per suggestion per user
  • A lot of my time was spent diagnosing an issue where node was having trouble finding bindings for sqlite3 Similar StackOverflow Post. After an hour of removing potential root causes I discovered the issue only occurred when installing sqlite with pnpm. I ended up just using npm to resolve the issue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published