Giter Club home page Giter Club logo

attendance's Introduction

Attendance

Full-stack attendance-taking app in Rust and ClojureScript.

Requirements

This app requires Linux and an HTML5-enabled web browser. Cross-compiling hsn't been attempted yet, but it should also work with Windows. It was written to be used with Chrome, and developed between Chrome and Firefox - I haven't tested it with anything else yet.

If you want to interact with the code you will also need git, make, rust, a Java 8+ JRE, and boot, which can be obtained by running make deps. The fastest way to obtain a Rust installation is via rustup.

Usage

Download the latest release and decompress it. Run the executable attendance-server (e.g. cd attendance-v0.3.1/ && ./attendance-server) and point your browser to localhost:3000 (or click the URL shown if your terminal emulator is fancy). Rocket.toml can be used to set the target port and other config options.

Example roster.csv input:

A,7,Name One,Name Two,Name Three,,,,
B,9,Name Four,Name Five,Name Six,,,,
CE,4,Name Two,,,,,,

Trailing commas result from our use of MS Excel to export the roster, and are ignored.

Example extra.csv input:

Name One,1-4
Name Two,4-6

Larger mock rosters that more closely approximate real world use are available at static/data/mock_roster.csv and mock_extra.csv. These can be loaded via the Load Mock Roster button to play around with.

Caveats

The app currently cannot handle name collisions, and it's not a high priority as we currently have none in real world use.

The extra hours are only used for the generated report - any name with a time block that goes over 4 (e.g. 4-6, not 1-4) will be added to the corresponding Extended Day class. Core hour kids are currently discarded.

It's also pretty specific to one setup for now. More config options on the way (hopefully).

Development

Clone or download this repository. Use make run to build the frontend and compile and launch the server, with hot reloading of the frontend. Someday, maybe the backend too!

make test will build a release bundle at attendance-v0.3.1/, and create a .zip and a .tar.xz of the bundle at the project root. It will then run the test suite, currently just for the backend.

Use make bundle to put together the release bundle, and/or make release to produce the compressed archives from that bundle. make clean is also available to clear up build artifacts and old archives, and is called first by make test.

Libraries

Backend:

Frontend:

Contributing

Sure! Open a PR.

Acknowledgements

Thanks due to mrmcc3, whose blog post was a great push in the right direction for the file upload, and StefanoOrdine for their Rocket/React example.

attendance's People

Contributors

deciduously avatar

Watchers

 avatar  avatar

attendance's Issues

Save state

Either lean on localStorage or allow exporting and loading a dump of the RAtom to file

Write jar component

I need a server process that will expose a simple API for the individual class pages to talk to the database

Read Extra Hours

Process additional hours, respecting capacities, i addition to propagating absences to extended day

Add extended day

  • Component - can reuse, probably, just no buttons
  • Report - add to the end

Deprecate this project.

For learning/showcase purposes, build your back either with a good template it with Rocket, and decouple the frontend. At first you can keep the Reagent version, but either port it to reframe or redo it in good old JavaScript/React Native

Exports

  • Daily sheet to match handwritten record
  • Daily email text in HTML format

Proper config

Pilfer from deciduously-com, but in its own namespace now

Parse csv

Eventually xlsx.

Specter might be the right choice, but instead of bashing your heard against the wall on the deeply nested transformations, read the raw data into the data structure that you want.

Maybe read all the kids into a map with a unique I'd, and then populate a whole separate two tables with the schedules referring to the other map.

Split ratom map

:roster :core :extended - schedule maps just point to idx hash in :roster

Expand app scope

Now that you have a server, why not add more functionality? This could be used for the order aggregator too!

Fix style

Blocks aren't working - would rather they were responsive.

Implement csv stuff in Rust

That's what ya gotta do next.

On reading in the csv, insert all the kids in that module. Only expose GET endpoints for name and stuff. The only PUT for a kid will be to toggle a KidRecord.

Take is as a POST request from cljs-ajax tied to the same buttons you've already got. have it do both until you port the frontend.

Fix toggle-kid!

Something like (transform [:roster #(= idx (:idx %))] #(update-in % [:here] not (get-in @App-State [:data])

Assuming I've split app-state into something like {:data {:roster {} :core {} :extended {}}}

Make individual class pages

Use an individual url for each class to go for their own roster. Compojure can help with this? Load the roster from the server, and have a save feature to persist changes back

Upload csv

Instead of hardcording the string in-memory

Add extended day display

Should be able to largely re-use code - only difference is that these will NOT be buttons - just displaying the state

Alphabetize rooms

Stored as map keys, which do not guarantee an order - not ideal from a usability perspective. Alphabetical sounds better.

Fix class counts

Currently, the app includes trailing empty fields in the headcount, making it look like all classes are the same size as the largest class. Just lop off empty fields when reading the CSV

Automate bundle

Instead of pasting style/script in by hand, make it happen automagically

Better add hours

Have it check against the absences, and not add if the kid didn't come

Upload xlsx

Instead of a specially formatted single day CSV, take a raw Schedule By Week report

Handle name collisions

Instead of just hashing the name, assign some sort of other unique idx. This will require some thought as I'm currently relying on the deterministic nature of hash - it's called separately on strings and leverages the fact that it yields the same result to function properly.

Migrate to re-frame

Might be overkill for this project, but it's a good learning exercise - and as this thing grows it will only help.

You've already structured it somewhat in line with what you'll need

Fix key collisions

You're doing something silly somewhere.

pos-hash is silly, you should remove that to close this but I think it's not the culprit here.

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.