csc302-spring-2021 / proj-dateam Goto Github PK
View Code? Open in Web Editor NEWCSC302 course project for DaTeam
Home Page: https://dateam-frontend.herokuapp.com/
CSC302 course project for DaTeam
Home Page: https://dateam-frontend.herokuapp.com/
Depends on #16
Take the mock data created in the issue linked above and update the express route to return the mock data as JSON.
Using the openapi docs, I should be able to request that mock data as if I was a frontend client
This renders a list field form node
This component renders a text field form node
This renders a titled section with children nodes rendered inside it
Send an email to the professor to give @umar-ahmed admin permissions on this repository
At the moment, we have finalized domain object definitions in shared/ClassDef.ts
and created shared/ClassMeta.ts
for validation and serialization. However, shared/ClassMeta.ts
is incomplete.
Task:
classMeta
for each domain objectThis is a core change. No reasonable testing framework can be applied.
Create a folder at docs/phase1
with the following files:
scope.md
: triage the use cases to identify an area of focus for your team.arch.md
: Slice the app. Describe the main client and server components and identify the middleware you intend to use to build each.test.md
: Describe the approach you intend to take for testing your implementation.api.md
: Design the APIs supported by the SDC services.model.md
: Describe the model object behind your API in one or more UML diagrams.vertical.md
: Describe your vertical slicecollab.md
: Establish how your team is going to work together. How you will manage your sources. How you will contribute to your sources. When you will meet, how you will communicate, who will scribe, how you will maintain your backlog, etc.Set up a GitHub actions workflow to build the frontend and backend packages on every push/pull request open.
Design domain objects that suits the need of the project
Create/update a heroku.yml
file and set up a project on Heroku to deploy the frontend and backend containers.
https://devcenter.heroku.com/articles/build-docker-images-heroku-yml
Create database instance that can be used by the application
Complete domain object validator that can validate the object structure of any domain objects
This is needed by #51
In order to hit the ground running, we want to have a solid foundation to build off of, and that means setting up:
So far we've agreed on using the following stack:
We still need to figure out the following:
Complete domain object JSON serializer that serializes domain objects into pure json object
This is needed by #23
Normally in a env file, a #
would denote the start of a comment
NODE_ENV=development # development, production
It turns out some env parsers will treat the #
, if placed on the same line as the =
, as part of the value.
We need to move all comments to a separate line, and ask everyone to update their .env locally
Extend ClassMeta to include DB schema information
The extended info should remain exclusively in backend
The extended info should contain the exact mapping from fields in typescript objects to columns in the database
It should also contain information of how objects are linked in the database
Create database manager that preforms database CRUD
Research and create testing framework for backend/
and share/
module
This task may be broken down into multiple pull requests
Before the P1 deadline, we ran into a bug with webpack. Webpack minifies and obfuscates code for production builds, and part of this process is renaming variables, functions, classes to make their names shorter. This is good for bundle size, but it introduced a subtle bug with our model deserialization logic in @dateam/shared
.
In particular, we rely on .constructor.name
to introspect the class definition.
.constructor === SomeClass
or use instanceof
.constructor.name
with static variable on objectclass Person {
static id = "person";
...
}
The frontend teams needs some mock data to get started building out the UI. We'd like the backend team to come up with a sample JSON response object for the GET /form/{formId}
endpoint.
Return dummy data
Implement form response validation that takes a SDCForm and a SDCFormResponse and verify that the form response is valid against the given form.
Prerequisite:
textFieldTypeMeta.processor
to format the field before calling the validatorRequirements:
textFieldTypeMeta.parser
maxSelections
and minSelections
selectionDeselectsSiblings
is true, there is only one selectionselectionDisablesChildren
is true, set flag to bypass children
validation of that itemtextResponse
validation of that itemGeneral guideline for error type:
Create a database schema (SQL) based on the domain object definition.
From the sample JSON structure, we want to render labelled form inputs based on this mockup: https://www.figma.com/file/AkEpl4urre2SXIPiAfKulQ/SDC-Form-App?node-id=25%3A524
None of the objects generated by share/MockData has the correct constructor info. Checking obj.constructor always returns Objects, similarly instanceof
type checking will also fails
import * as mocks from "./MockData"
let f = mocks.buildFormComplete()
log(f instanceof Model.SDCForm) # expecting true found false
log(f.constructor.name == "SDCForm") # expecting true found false
Implement DataServer
(There already exists a file called DataLoader, rename it to DataServer)
Cache: contains a map from UID to any domain object
genericRead(obj: any, objClass: Function): any
genericDelete(obj any, objClass: Function): bool
genericCreate(obj any, objClass: Function): Error | null
Update all backend controllers to call DataServer if possible
Update will be done with delete then create
Create XML parse
Set up Dockerfiles for frontend and backend, and update docker-compose.yml (local)
https://devcenter.heroku.com/articles/local-development-with-docker-compose
Create express handlers for all the methods that are described in the openapi spec. For example, if we have a method GET /form/{formId}
, then create an express handler like:
app.get('/form/:formId', (req, res) => {
res.sendStatus(501);
});
HTTP 501 Not Implemented
Docker-compose for node and postgres.
Postgres file is in DBInitSQL folder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.