Run all sql queries in database/scripts/createTables.sql
to set up the database.
Insert the first admin into the users table. He can add more admins, superusers and users.
yarn workspace server createFirstAdmin --username admin --email [email protected]
Set DB_NAME, DB_HOST, DB_PASSWORD, DB_USER
in your ENV.
yarn workspace server build
yarn workspace scripts deploy-server
yarn
TODO UPDATE THIS INFORMATION ABOUT DATABASE
numerical_analysis
database:yarn db:setup
yarn db:start
Enter database cli with yarn db:interactive
and run packages/database/sql-scripts/createTables.sql
.
yarn workspaces server start
App will be served on locaholst:3000
.
The server requires following environment variables to connect to the database:
DB_NAME, DB_HOST, DB_PASSWORD, DB_USER
You can create server/.env
file for development.
DB_NAME=numerical
DB_HOST=localhost
DB_PASSWORD=haslo
DB_USER=root
JWT_SECRET=tajemnica
To speed up development process run service in watch mode:
yarn workspaces server dev
yarn worksapces client dev
App will be running at http://localhost:1234.
To run client and server concurrently:
yarn dev
In watch mode:
yarn start
Here's a list of VSCode extensions we've found useful while developing this project
VSCode TypeScript TSLint Plugin (link)
VSCode Styled Components (link)
Comment Tagged Templates (link)
Server lists available routes on GET /
.
We are using two levels of authorization. The first one is based on RBAC (Role Based Access Control). We have three roles defined:
students
and this user doesn't have access to any of the Admin and SuperUser endpoints.The second layer of the authorization is linked to the SuperUser role and groups management. Each SuperUser can have a different privileges in each group. For example in group with id 1
user can have all possible privileges, but in group with id 2
he can only perfom read operations.
Following the Attribute Based Access Control (ABAC) we define waht a SuperUser is allowed to do in a particular group:
The lecturer of the group has full access in it, but he can also share privileges to edit this group to the another user. So when a new group is created privilege edit
is granted to its lecturer
.
This model will allow us to extend it to a different attributes, for example: EditUsers
, ReadUsers
, EditMeetings
and so on. By default each SuperUser is granted with Read
attribute for each group.