Welcome!
This repository contains the Uplift coding challenge. We believe in letting you work as freely as you want within the constraints of this setup. Our goals are to assess:
If you wish to work full-stack, please attempt both frontend and backend in separate Pull Requests. Submit a PR first with your most comfortable or desired choice, so we can offer you feedback sooner.
.env
file for environment variables. This file is used by
frontend and backend..github/workflows
The task is to build a simple card game. The designs are in Figma, you can see desktop and mobile pages. The fonts should be available in Google Fonts, but we also included them in assets if they ever take them down (has happened before). It doesn't have to be pixel perfect, but it should look nice.
The program should perform the following functions.
Requirements:
Please write tests.
Feel free to use any additional libraries.
If you have any issues with husky/commit hooks, you may remove the *.py section of "lint-staged" in package.json
yarn install
Then:
yarn start
Your browser will automatically open to http://localhost:3000 by Create React App. Changes should be reflected automatically.
See CRA documentation.
You are welcome to use Next.js instead, we just set up CRA for convenience.
TL;DR (but please, read on): backend version of the frontend card game. Use Django (v3+), graphene (v2+), and a SQL database (postgres, for migrations).
Session, auth or login are all optional, but clean implementations earn points.
Do NOT install additional python dependencies. (e.g. a library that implements a deck)
You can implement your own database architecture (models) and your own GraphQL schema. You do not have to copy the playground schema (mentioned below), although you can use it for inspiration.
You also don't need to implement authentication (although you are welcome to, if you prefer). You can fake it at the middleware level, or log in to the Django admin and send subsequent requests with the session information set by Django.
Feel free to use any additional libraries.
You can run a sample query at http://localhost:5000/graphql/
query {
me {
username
email
}
}
On MacOS, use brew to manage installation of supporting programs, as it keeps things tidy.
For backend, the recommended way is to use poetry and pyenv. All of the commands in this section are from the server
folder.
You may also work in docker, using the provided ./docker-assist
and docker-compose.yml
, but it's generally quicker to develop locally. See docker/Docker.server/Dockerfile
for the docker setup, and note that poetry is set up to export to requirements.txt
.
Install poetry. To manage python versions, we recommend installing pyenv
. See the poetry
documentation for details.
Then install Python dependencies:
cd server/
# try one of these
pyenv install 3.9.9 # or pyenv local 3.9.9
poetry env use ~/.pyenv/versions/3.9.9/bin/python
poetry install
# or
poetry install --python `which python3`
If you don't have it already, you'll also want to install Postgres. Version 10 or later should be fine.
If you have issues:
Copy example env vars to .env
. You might need to change DATABASE_URL
based on your environment.
cp ../.env.example ../.env
Create the uplifty
database:
createdb uplifty
Load the sample user data:
poetry run ./manage.py migrate
poetry run ./manage.py loaddata uplifty/fixtures/users.json
poetry run ./manage.py runserver 5000
Now you can go to http://localhost:5000, http://localhost:5000/graphql/, or http://localhost:5000/admin/ for the Django admin.
Log in to the admin with the sample test user from below and try the sample query from the challenge.
poetry add <package name> # this automatically adds it to pyproject.toml and poetry.lock
If you manually update pyproject.toml
, make sure you run poetry update
to update the lockfile.
Please run the tests, and lint your backend code. This helps us review code, as it's already consistent with this project.
yarn autoflake
yarn pytest:fresh
Or check out package.json
for other options.
.env
filesThe database is created with a sample test user:
Name | Value |
---|---|
Username | interview |
interview@uplift.agency | |
Password | uplifty |
You can change these in the Django admin if you wish.
If you are working with node instead of Django, we'd like you to do the same backend challenge with TypeScript and GraphQL.
There is a starter server you can use in node-server/
, and it runs CI using .github/workflows/backend_node.yml
. Please make sure the build passes.
This code is intended to be private. You are not allowed to share any of the base template code without Uplift's express permission. Please reach out to us before you share any of the code in this repository with others.
That said, we understand you may want to show others your work. If you're proud of your work on this exercise and want to share it with future companies or add to your portfolio, we kindly request you help us keep the codebase as private as possible. If it's easy for other candidates to find a good coding exercise submission, they will, and then we have to invest a bunch of time to change the requirements so that old examples cannot be used. Unfortunately we've had cases of applicants copying examples they found.
Here are some ideas to share this more privately. We would really appreciate if you followed them: