Code Monkey home page Code Monkey logo

buggy-race-editor's People

Contributors

kuiperst avatar

buggy-race-editor's Issues

1-TEMPLATE Add a new template to the app

Some useful information — such as the cost of buggy components — is only
available on the race server. You can't access this information when you're
using your buggy editor offline.

Add a new page called /info that displays the cost information.
Now you (or any user of your buggy editor) can investigate buggy costs without
going to the race server.

1-TEMPLATE

3-MULTI Allow different buggies to be created

The default app only lets you save one buggy. You should be able to save
different buggies so you can switch between them.

Modify the app to create a new buggy and subsequently update it, and to provide
a way to switch between the different buggies you've created.

3-MULTI

0-GET Get the source code

The source code for the app you're going to be developing already exits: you
need to get your own copy of it to a place where you can edit it and run it.

Get the source code, ideally by using the VSCode workspace file we have prepared for you. It will clone your Github repository onto your personal directory in the CS Department's teaching server.

A requirement for the below steps is to install the main IDE (Integrated Development Environment) we will use for this module: VSCode. This is a modern, powerful and thorough IDE that will be a valuable asset in your toolbox! This is what needs to happen:

  • Go to the buggy race server and login.
  • Link your account to your Github personal account.
  • Fork the template for the buggy race editor from [our Github repository]({{ site.editor_url }}) to yours.
  • Download your VSCode workspace configuration file by clicking in the corresponding button. Store it somewhere safe.
  • Open it with VSCode. It might complain that some plugins and packages are missing. Do not despair, VSCode will kindly offer to install everything that is necessary.
  • You will be asked to input your college password a couple of times. Just type it every time it is requested. Wait for a bit.

After VSCodes finishes connecting you to our teaching server, it will be time to get the code from Github, to your personal home directory in the server. Do not worry, we have also automated this for you. To get a copy of your buggy race editor repo to the server, do:

  • go to the terminal tab in VSCode, located in the top panel. Then, click on run task and a list of tasks will appear. Choose the one starting with git clone https://github.com/ and wait.
  • The previous step cloned your remote Github repository to a local version which, in this case, lives in the teaching server!
  • If you click on Open file and you look in your home directory, you should find a folder with a name %BUGGY_EDITOR_REPO_NAME%.
  • Open that folder and compare its contents against those in the remote repo you previously forked, they are the same!
  • You might get asked for your college password a couple of times in the above step, this is normal.
  • If the %BUGGY_EDITOR_REPO_NAME% folder is not in your home directory, then probably something went wrong. Try to reproduce the above steps once more.

0-GET

3-ENV Switch between dev and production environments

Flask behaves differently when it is running in development ("dev") and
production environments, which you can switch using environment variables. Get
that working so you can do your coding in development mode, but work on your
racing buggy in production mode.

Make sure the configuration is correct and you're using the environment
variable FLASK_ENV correctly.

3-ENV

3-AUTOFILL Add auto-fill to the edit forms

After you've made your some choices on your buggy form, there are still lots of
items to fill in. It would be good to auto-populate empty settings with values
that create a complete, viable buggy.

Add a button that automatically fills the other entries. Maybe these are just
sensible default values. Or perhaps you can ask for a cost limit when the button
is pressed, and try to add items so that the buggy's total cost is within that
limit.

3-AUTOFILL

1-VALID Add basic data validation

If you enter "banana" for the number of wheels, you should get an error.

Add data validation: you app should check that the data input is the right kind
of thing (an integer) and reject it with a warning.

1-VALID

4-OWNER A buggy belongs to a user

Any user can edit any buggy. Only the buggy's creator should be able to edit
(or delete) it.

Associate buggies with a specific user and only grant access to buggies to the
logged-in user.

4-OWNER

5-ADMIN Add admin capabilities to superusers

At least one user should be able to change other users (and admin, or superuser).

Use something like the is_admin setting in the users table and add superuser
capability for manipulating buggies and users.

5-ADMIN

4-USERS Add users (and sessions) so you know who is editing a buggy

Anyone can access your app and edit a buggy: ultimately only the person who
created it should be able to. Add a login mechanism so you can tell the
difference between users.

Add usernames to distinguish between users, and a mechanism for starting and
ending a session (such as logging in and logging out).

4-USERS

3-TESTS Write some tests

You should be able to run automatic tests that confirm your app calculates the
cost correctly... as well as other things too.

You probably know your app works because you've been running it (and playing
with it) as you go along. But you should write some automated tests.

3-TESTS

2-COST Calculate and save the game cost of the buggy

The cost of the buggy (worked out using the game rules) affects whether it can
be entered in some races. Add the cost to the record.

Add a new integer column called total_cost to the buggies table, and store
the total cost there.

2-COST

5-RESET Password reset

A user who forgets their password can't log in.

There's no email address associated with a user, so to implement a reset
password option perhaps you'll need to add that to the user record, and find a
way to send an email from within Python. Or use a one-use token system (see
hints).

5-RESET

3-FLAG Display the pennant graphically

The user's choices for the colours and pattern of the buggy's pennant (flag) is
visual information but is probably displayed as text.

Show a graphical representation of the pennant in the browser.

3-FLAG

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.