Demo Application for tutors that need a system where they can manage their students
A combo of two npm projects, the backend server and the frontend UI. So there are two package.json
configs and thereforce two places to run npm
commands:
- Node/Express.js Backend:
backend/package.json
- deployed automatically via heroku/nodejs buildpack
- Next.js Client:
client/package.json
- generated by Next.js
- deployed via
build
script in the Node server's./package.json
- module cache configured by
cacheDirectories
Includes a minimal Node Cluster implementation to parallelize the single-threaded Node process across the available CPU cores.
Demo deployment: API calls from the Client app are fetched with a relative URL that is served by an Express handler in the Node server.
To immediately test the API, there are three (3) modes that are implemented: Query, Register, Notification
- Query
- In this mode, the user can enter in the input field provided one or more email addresses (separated with comma
,
) which identifies a tutor. - If there's only one (1) email address, the client shows the associated students with that tutor. If there are two or more email addresses, the client shows the students common to the tutors.
- Register
- In this mode, the user can immediately fill the provided JSON "template" which represents the request body structure (use
Shift+Enter
to insert newline). - The API needs a valid tutor and students to be registered for that tutor.
- With this, the user can "register" students to a specific tutor. The tutor will be automatically created if it's missing.
- Notification
- In this mode, the user can immediately fill the provided JSON "template" which represents the request body structure (use
Shift+Enter
to insert newline). - The API needs a valid tutor and a notification that is not empty.
- The client will show the students that will receive the notification:
- Students that are not suspended
- Students that are registered/associated with the tutor
- Students that have been mentioned in the notification
git clone https://github.com/drichardcarl/ts-system.git
cd ts-system/
heroku create
git push heroku master
This deployment will automatically:
- detect Node buildpack
- build the app
- launch the web process with
npm start
and servesclient/out/
as static files
More about deploying to Heroku.
Because this app is made of two npm projects, there are two places to run npm
/ yarn
commands:
- Node/Express.js API server in
backend
directory - Next.js Client in
client/
directory
In a terminal:
# npm
npm install && npm run dev
# yarn
yarn && yarn dev
In a separate terminal from the API server, start the UI:
# npm
npm install && npm run dev
# yarn
yarn && yarn dev