Product owner: Justyna, Tech lead: Mateusz, Development Manager: Kinga,
Funkcjonalność
- Ogloszenia dla wszytskich, -> Justyna
- Taski, ograniczone czasowo, zadania do wykonania, mogą być przypisne do proejktu, do osoby -> Marta
- Zarządzanie grupą, dodawanie userów, usuwanie, przydatne linki, dodawanie linków, plik z ocenami z projektów -> Mateusz
- Projekty, dodawanie nowego projektu, zmianaie jego statusu, Kinga
- Autoryzacja, rejstreowanie, token -> Wiktoria
The project has installed many dependencies, but the most important one are:
- express as a web framework
- nodemon for creating server and automatically restarting it when change occurs
- mongoose for easier interacting with MongoDB
- morgan for logging HTTP request
- dotenv for storing environment variables
- body-parser for parsing request's bodies
- jest for testing
- prettier for code formatting
- tslint for code analyzing
- bcrypt for encrypting passwords
- jsonwebtoken for sending tokens
For starting the server:
npm run dev
Keep in mind that in order to connect to the database you need to create file with the name '.env' in the root of the project, with text that I sent you. That file should be excluded from committing, thanks to the .gitignore. However, please watch out for not releasing it for public.
For testing:
npm run test
For code formatting:
npm run format
All of the application's code should be stored in 'src' folder and tests should be in 'spec/tests'. Server is created in 'index.ts'. In the 'app.ts' there is the heart of the app with some previously written middlewares. You should link your routes below the CORS handler middleware and above the middlewares that handle errors.
- In the 'routes' folder you should store your routers
- In the 'models' folder you should store your mongoDB schema
- In the 'middlewares' folder you should store your custom reusable middleware (especially authentication middleware should be stored here)
- In the 'controllers' folder you should store your controllers
The sample .ts files in the following folders are temporary, just to help you with getting the idea of the arrangement.
The docs for group management were build with swagger ui and can be found at adress https://eduplatformapi.herokuapp.com/doc
The docs for announcements were build with swagger ui and can be found at adress https://eduplatformapi.herokuapp.com/doc
The docs for authorization were build with swagger ui and can be found at adress https://eduplatformapi.herokuapp.com/doc
Get all projects.
Get single project informations using project id.
GET /projects/60428ed89187ba2c9807e148
Status: 200 OK
{
"_id": "60428ed89187ba2c9807e148",
"title": "Pro to delete",
"description": "This is our first project",
"group": "604e2b5a9b420353ec922c4c",
"linkToDemo": "www.project.asdpl",
"linkToGitHub": "www.github.pl/project20",
"timestamp": 1614974680847,
"__v": 0
}
Create new project.
Name | Type |
---|---|
Title | String |
Description | String |
Group | String |
Link to demo | String |
Link to GitHub | String |
POST /projects
{
"title": "First project",
"description": "This is our first project",
"group": "604e2b5a9b420353ec922c4c",
"linkToDemo": "www.project.pl",
"linkToGitHub": "www.github.pl/project"
}
Status: 201 Created
{
"message": "Project added successfully!"
}
Update informations about project using project id.
Name | Type |
---|---|
ProjectId | String |
Name | Type |
---|---|
Title | String |
Description | String |
Group | String |
Link to demo | String |
Link to GitHub | String |
PUT /projects/60428ed89187ba2c9807e148
{
"title": "Pro to delete",
"description": "This is our first project",
"group": "604e2b5a9b420353ec922c4c",
"linkToDemo": "www.project.asdpl",
"linkToGitHub": "www.github.pl/project20",
}
Status: 200 OK
{
"message": "Updated successfully!"
}
Delete single project using project id.
Name | Type |
---|---|
ProjectId | String |
DELETE /projects/60428ed89187ba2c9807e148
Status: 200 OK
{
"message": "Deleted successfully"
}
Get all tasks
Get single task using it ID.
GET /tasks/603962e3f87efb51b0907762
Status: 200 OK
{
"_id": "603962e3f87efb51b0907762",
"name": "Lorem lorem lorem lorem",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": false,
"__v": 0
},
Get tasks connected with project (by using this project ID).
GET /tasks/project/603509b488103d2df0106cbb
Status: 200 OK
[
{
"_id": "603a99506195bd2ccc8e8db6",
"name": "Lorem lorem lorem lorem",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": false,
"project": "603509b488103d2df0106cbb"
"__v": 0
},
{
"_id": "603a9fc68302362c083c62b8",
"name": "testWithProject",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": false,
"project": "603509b488103d2df0106cbb",
"__v": 0
}
]
Create new task. It is possible to add information to task for project by adding it ID to body request.
Name | Type |
---|---|
Name | String |
Description | String |
Deadline | Number |
Done | Boolean |
ProjectId | String |
UserId | String |
POST /tasks
Status: 200 OK
{
"_id": "604d158772b2ac47d8ab6831",
"name": "testTask",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": false,
"project": {
"_id": "604cb10425a8d00a9870cd80",
"title": "Third project",
"description": "This is first project",
"mentor": "604a7b12d610101287aa2955",
"authors": [
{
"_id": "604cb136f37f141378db09e7"
}
],
"linkToDemo": "www.demo.pl",
"linkToGitHub": "www.link.pl",
"timestamp": 1615638838149,
"__v": 0
},
"__v": 0
}
Update task information using it ID.
Name | Type |
---|---|
TaskId | String |
PUT /tasks/604d158772b2ac47d8ab6831
Status: 200 OK
{
"message": "Updated successfully!"
}
Delete single project using project id.
Name | Type |
---|---|
ProjectId | String |
DELETE /projects/60428ed89187ba2c9807e148
Status: 200 OK
{
"message": "Deleted successfully"
"_id": "604d158772b2ac47d8ab6831",
"name": "UpdatedTask",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": null,
"__v": 0
}
Delete task using it ID.
Name | Type |
---|---|
TaskId | String |
DELETE /tasks/603957ee18a8ef14bc439b33
Status: 200 OK
{
"_id": "603957ee18a8ef14bc439b33",
"name": "Lorem lorem lorem lorem",
"description": "Lorem lorem lorem lorem",
"deadline": 1614366265,
"done": false,
"__v": 0
}