This project was thought in order to facilitate the creation, management and formalization of university research projects. Both students and teachers will be able to organize their projects, which will be visible to other students who may want to join the research team. It mainly consists of a web application, the main page will contain all the projects in order to make them known for everyone, and they will be accepting requests for those who want to get in.
A user joins a project in one of two ways. Both end with an accepted enrollment, which makes the user a project member.
- Request: the user asks to join (
POST /projects/:id/enroll-request), and a project admin or leader approves or rejects it (PUT /projects/:id/enroll-requests/:userId/approve|reject). - Invitation: a project admin or leader invites the user (
POST /projects/:id/invitations/:userId), and can edit or cancel the invitation (PUTandDELETEon the same route). Admins and leaders list the project's pending and declined invitations withGET /projects/:id/invitations. The invited user accepts or declines it (PUT /projects/:id/invitation/accept|decline) and gets an email when invited.
Only admins and leaders whose enrollment is accepted can manage requests and invitations. Every route, with its body and responses, is in Swagger at http://api.localhost/docs.
Only in case you happen to use Windows install Chocolatey package manager Then install Make with the following command:
$ choco install makehttps://docs.docker.com/get-docker/
Just if you happen to use VSCode linter and formatter extensions Alternatively, using VSCode remote docker container extension might provide the same experience
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
Create docker.dev.env once by copying the example and replacing the change-me values:
$ cp docker.dev.env.example docker.dev.envPlaceholder values are enough to run the app locally; sending emails (verification, password reset) needs a real SENDINBLUE_API_KEY.
Alternatively, ./create-env-file.sh ENV=dev KEY=VALUE ... generates the file from arguments (see the script for the full list). Arguments end up in your shell history, so prefer copying the example for real secrets.
The login cookies follow SAME_SITE_POLICY (strict, lax or none) and SECURE_COOKIE (true or false); the API refuses to start on any other value. In dev the frontend proxies the API through its own server (http://localhost:3000/api, active when BACKEND_PROXY_TARGET is set in the frontend's .env.local, see the frontend README), so the cookies are first-party and dev uses lax + false. Safari drops Secure cookies on http://localhost. If your docker.dev.env predates this, set those two values and recreate the API container (docker compose -p dev -f docker-compose.dev.yml up -d --force-recreate app).
Docker Desktop (or another Docker Engine) must be running.
$ make devMigrations are executed by default when the app is bootstrapping
api.localhost (Swagger docs at api.localhost/docs)
Sessions live in two HttpOnly cookies set on login: accessToken (15 minutes) and refreshToken (7 days). When the access token has expired or its cookie is gone, GET /auth/me and every authenticated route renew the session with a valid refresh token and send fresh cookies in the response. Logging out revokes the refresh token.
db.localhost (pgAdmin; the dev login is set in docker-compose.dev.yml)
$ make down-dv$ make prod$ make down-pdTests run in Docker and need docker.test.env. Create it once with:
$ ./create-test-env-file.sh# unit tests
$ make test
# unit test [interactive debug mode]
$ make test-dg
# unit test coverage
$ make cov
# e2e tests
$ make e2e
# e2e tests [non-interactive debug mode]
$ make e2e-dg name="jest_test_partial_description"# fix
make lint
# check only (as CI does)
make lint-check# fix
make format
# check only (as CI does)
make format-check| Name | How it contributes to the project |
|---|---|
| 👔 TypeScript | Programming language that builds on JavaScript |
| 🚀 Next.js | Fullstack framework for React.js |
| 🧺 Mantine | Really cool component library |
| 🦴 HTML5 & CSS3 | The basics for the web! |
| 🎨 Sass CSS | Simple stylization |
| 🖼️ Tabler Icons | Icons Mantine-compatible |
| 📇 React-PDF | Make customizable PDF reports |
| 🖌️ Prettier | Nice code formatter |
| 📐 ESLint | Complete linter with strict rules |
| 🦮 Husky | Git hooks to assure quality commits |
| 🧪 Jest | Easy unit testing |
| 📦 TurboPack | JavaScript very fast bundler |
| 📃 GitHub Actions | CI/CD automation |
| 🔼 Deploy in Vercel | Deployment is very important! |
| Name | How it contributes to the project |
|---|---|
| 👔 TypeScript | Programming language that builds on JavaScript |
| 📗 Node.js | JavaScript runtime built on V8 JavaScript engine |
| 🐱 Nest.js | Framework for building efficient, scalable Node.js web apps |
| 🗺️ TypeORM | Object-relational mapping (ORM) tool for Node.js |
| 🗃️ PostgreSQL | Open-source relational database management system (RDBMS) |
| 💾 JSON Web Token (JWT) | Compact and self-contained way for securely transmitting info |
| 🖌️ Prettier | Nice code formatter |
| 📐 ESLint | Complete linter with strict rules |
| 🧪 Jest | Easy unit testing |
| ⚗️ Supertest | High-level HTTP abstraction for E2E integration testing |
| 📖 Swagger | Interactive, machine and human-readable API documentation |
| ⚙️ Traefik | HTTP reverse proxy and load balancer |
| 🐳 Docker | Separates the app from the infrastructure with containers |
| ☁️ Terraform | Infrastructure as code tool to manage the infra in any cloud |
| Monitor and analyze deployments | |
| 💧 DigitalOcean Droplet | Deploy in scalable cloud virtual machines |
| Name | GitHub Account |
|---|---|
| 🔗 https://github.com/alereca | |
| 🔗 https://github.com/NicoAntonelli | |
| 🔗 https://github.com/JAcciarri |