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.
You can create a new suggestion by filling out the form on the home page
Opening the suggestion page shows a discussion forum below the suggestion. Users can type into the available text field to add to the discussion
- Download Node.js https://nodejs.org/en/download
- download the source code
ex.
git clone [email protected]:swordensen/suggestion_box.git
- Navigate to the
server
directory ex.cd server
- Install dependencies
npm install
- Start Server
npm start
- Open a new terminal and navigate to client directory
cd client
- Install dependencies
npm install
- Start Vite server
npm run dev
- Open browser to http://localhost:5173
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
-
Install Docker
-
Clone the repository on to your prod server
foo@bar:~$ git clone [email protected]:swordensen/suggestion_box.git
-
Run
foo@bar:~$ docker compose up
---
Entity Relationship Diagram
---
erDiagram
USER ||--o{ SUGGESTION : hasMany
USER ||--o{ COMMENT : hasMany
SUGGESTION ||--o{ COMMENT : hasMany
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
- 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.