- Clone:
git clone [email protected]:fractionalapp/voting.git cd voting
- Install dependencies
yarn install
- Run schema migrations
yarn migrate
- Start server and frontend
yarn start
- Open
http://localhost:3000
The purpose of this challenge is to qualify how well you can implement a simple feature end-to-end. You should try to get the look and feel of the feature to be as close to the designs provided, but feel free to expand on this as you see fit. We provided a codebase that resembles our internal infrastructure (outside of SQLite). You're free to use this as a starter or build with whatever makes you comfortable. The goal of the assignment is to see how well you can take a product spec from definition to execution.
Implement a simple vote tracking tool where:
- An editor may:
- Change the voting options (click edit, change, save)
- Submit a vote (click vote, select, vote)
- View current votes (click card)
- View the voting progress / summary
- A participant may:
- Submit a vote (click vote, select, vote)
- View current votes (click card)
- View the voting progress / summary
Notes:
- In the sample code the user id is encoded in the page route
localhost:3000/{user_id}for simplicity. - The provided file structure provides a good starting point, but feel free to change this to something you are more comfortable with.
- Install any modules that would be helpful.
- Try not to spend more than a day.
- (part 1) Implement your solution in a copy of this repo (please don't create a public fork with your solution) and either add it to a private repo or bundle it in a zip file.
- (part 2) Update this README with any instructions we should be aware of to run this project properly.
- Send links to all of the above to any existing email thread or to [email protected]
We use Knex and Objection to manage the Sqlite database. To make changes to the db schema you'll want to:
- Generate a migration file
yarn --cwd packages/backend knex migrate:make give_it_a_name
- Define the migration changes
Go to the file that was created in
step 1to add or alter a table - Run migration changes
yarn migrate
packages/backend: contains a basic Node.js app using Fastify, Objection, and Graphqlsrc/controllers: contains our data controllerssrc/graphql: contains the GraphQL schema and codegenerated typessrc/models: contains all Sqlite data models (using Objection)src/resolvers.ts: contains the GraphQL resolvers
packages/frontend: contains a basic Next.js app using Vanilla Extractcomponents/: contains our stateless React components.pages/: contains the app's routes (the file path/name represents the route)
/(home page)- Just a link to 2 user vote pages
/[id](user vote page)- A page to display the voting UI for a single user (user id in route)
- This page is where most of the work will be focused.