Thread - this is SPA with a ready-made architecture and structure, a connected basic technology stack and start-up functionality, designed for individual practice of students.
The main theme of the project is a social network similar to Twitter.
The main idea of the project is to onboard students with our vision of how a real project should look like from the inside, and give them the opportunity to individually explore how the architecture and structure of the project works, see its possible configurations, try to deeply understand someone else's code.
- Pay attention, that we have certain quality criteria, which we should follow during application development.
- NodeJS (20.11.x);
- npm (10.2.x);
- PostgreSQL (15.5)
The main frameworks and libraries used in the project are listed here. A complete list of technologies used for each part of the project is in the package.json
files in the client
and server
folders.
- React — a frontend library
- Redux + Redux Toolkit — a state manager
-
assets - static assets (images, global styles)
-
libs - shared libraries and utilities
2.1 components - plain react components
2.2 enums
2.3 helpers
2.4 hooks
2.5 modules - separate features or functionalities
2.6 types
-
modules - separate app features or functionalities
-
pages - app pages
-
db - database data (migrations, seeds)
-
libs - shared libraries and utilities
2.1 enums
2.2 exceptions
2.3 helpers
2.4 modules - separate features or functionalities
2.5 types
-
modules - separate app features or functionalities
As we are already using js on both frontend and backend it would be useful to share some contracts and code between them.
-
Get Node.js (LTS) the version included into .nvmrc file. Note: npm will be installed automatically. Check the correctness of the installation: to do this, run in the command line (terminal):
node -v // for checking Node.js version npm -v // for checking npm version
-
Get the latest stable version PostgreSQL for your OS. Check the correctness of the work - try to create a database, a table - for this you can use pgAdmin or any other convenient way you find.
-
Create in PostgreSQL 2 empty databases for the project. For example, thread and thread-test. The main idea is that you can check if code works properly in 2 ways: automated via backend tests and manually via interaction between frontend and backend. And these are independent processes.
-
Install Git.
Note: If you are using Windows, do these two additional steps before cloning the repo:
-
Change
eol
setting in your code editor tolf
. -
Change the
autocrlf
setting toinput
in the Git settings:git config --global core.autocrlf input
-
Clone project`s repo:
git clone [email protected]:BinaryStudioAcademy/thread-js.git
-
Create a repo at Bitbucket and carry out further development there.
- Create and fill all .env files. These files are:
- apps/frontend/.env
- apps/backend/.env
You should use .env.example files as a reference.
-
Install dependencies:
npm install
. -
Install pre-commit hooks:
npx simple-git-hooks
. This hook is used to verify code style on commit. -
Run database. You can run it by installing postgres on your computer.
-
Apply migrations:
npm run migrate:dev -w apps/backend
-
Run backend:
npm run start:dev -w apps/backend
-
Run frontend:
npm run start:dev -w apps/frontend
This project has a strong configuration with linters so to make sure that while are you using vs code as an editor you will have the ability to make is visible not only terminal just add this setting locally into repository:
Create a file .vscode/settings.json
{
"eslint.experimental.useFlatConfig": true,
"eslint.workingDirectories": [
"./",
{ "pattern": "./packages/**/" },
{ "pattern": "./apps/**/" }
],
"eslint.options": {
"overrideConfigFile": "eslint.config.js"
}
}
<type>: <ticket-title> <project-prefix>-<issue-number>
For the full list of types check Conventional Commits
Examples:
feat: add dashboard screen thjs-123
<issue-number>-<type>-<short-desc>
Examples:
123-feat-add-dashboard
12-feat-add-user-flow
34-fix-user-flow
We use Conventional Commits to handle commit messages
<type>: <description> <project-prefix>-<issue-number>
Examples:
feat: add dashboard component thjs-45
fix: update dashboard card size thjs-212
The entire list of tasks can also be found on the Issues You can sort only usefull ones by ready-for-student
label. These tasks are grouped with must-have(with current label) and optional.
The task will be considered completed if it is fully completed, the feature works, and whether exists the correct design following the Development Flow
from your side. So to pass criteria include The PullRequest with direction to the default branch, proper naming of the branch, commis, PR title, and filled description of what was done here. Let's look at its implementation and evaluate whether the logic was distributed correctly in the project. This will show how much you understand the architecture. We will also comment on the code...
The main result of the work can be determined by how deeply you were able to understand the project and understand it, and how far you have advanced in personal learning.
- What frameworks, libraries and their features can be used?
Complete freedom of action, feel free, use whatever you want.
- Is it possible to change the database (add columns, tables)?
It is possible, and in some tasks it is even necessary. To do this, you need to create new migrations. Existing migrations cannot be changed!!! Please do not forget it.