Skip to content

Commit 2c25736

Browse files
committed
feat: new readme content thjs-129
1 parent a5af7f3 commit 2c25736

File tree

2 files changed

+103
-145
lines changed

2 files changed

+103
-145
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ end_of_line = lf
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99
charset = utf-8
10+
11+
[*.md]
12+
indent_size = unset
13+
indent_style = space

readme.md

Lines changed: 99 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -8,230 +8,188 @@ The main theme of the project is a social network similar to Twitter.
88

99
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.
1010

11+
### Useful Links
12+
13+
- Pay attention, that we have certain [quality criteria](https://github.com/BinaryStudioAcademy/quality-criteria/blob/production/src/javascript.md), which we should follow during application development.
14+
15+
### Requirements
16+
17+
- [NodeJS](https://nodejs.org/en) (20.11.x);
18+
- [npm](https://www.npmjs.com/) (10.2.x);
19+
- [PostgreSQL](https://www.postgresql.org/) (15.5)
20+
1121
## Technologies
1222

1323
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.
1424

15-
### Common
25+
### Global
26+
27+
#### Technologies
1628

17-
1. ESLatest
18-
2. [Typescript](https://www.typescriptlang.org/)
19-
3. [Git](https://git-scm.com/doc)
20-
4. [REST API](https://www.restapitutorial.com/lessons/restquicktips.html)
21-
5. [JWT](https://en.wikipedia.org/wiki/JSON_Web_Token)
22-
6. [Socket.IO](https://socket.io/docs/)
23-
7. [npm](<https://en.wikipedia.org/wiki/Npm_(software)>)
24-
8. [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces)
25-
9. [ESLint](https://eslint.org/docs/user-guide/getting-started)
26-
10. [joi](https://www.npmjs.com/package/joi)
27-
11. [dayjs](https://day.js.org/)
29+
1. [Typescript](https://www.typescriptlang.org/)
30+
2. [npm workspaces](https://docs.npmjs.com/cli/v9/using-npm/workspaces)
2831

2932
### Frontend
3033

31-
1. [React](https://reactjs.org/docs/getting-started.html)
32-
2. [Vite](https://vitejs.dev/)
33-
3. [React Redux](https://redux.js.org/introduction/getting-started)
34-
4. [React Hook Form](https://react-hook-form.com/get-started)
35-
5. [history](https://www.npmjs.com/package/history)
34+
#### Technologies
3635

37-
### Backend
36+
1. [React](https://react.dev/) — a frontend library
37+
2. [Redux](https://redux.js.org/) + [Redux Toolkit](https://redux-toolkit.js.org/) — a state manager
3838

39-
1. [Node.js](https://nodejs.org/en/)
40-
2. [Fastify](https://www.fastify.io/docs/v3.24.x/)
41-
3. [Knex](https://knexjs.org/)
42-
4. [Objection](https://vincit.github.io/objection.js/)
43-
5. [axios](https://www.npmjs.com/package/axios)
44-
6. [bcrypt](https://www.npmjs.com/package/bcrypt)
45-
7. [nodemon](https://www.npmjs.com/package/nodemon)
46-
8. [dotenv](https://www.npmjs.com/package/dotenv)
47-
9. [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken)
48-
10. [jest](https://www.npmjs.com/package/jest)
39+
#### Folder Structure
4940

50-
### Database
41+
1. assets - static assets (images, global styles)
42+
2. libs - shared libraries and utilities
5143

52-
1. [PostgreSQL](https://www.postgresql.org/download/ 'PostgreSQL')
44+
2.1 components - plain react components
5345

54-
## Installation
46+
2.2 enums
5547

56-
1. Get [Node.js](https://nodejs.org/en/ 'Node.js') (LTS) the version included into [.nvmrc file](./.nvmrc). **Note:** npm will be installed automatically. Check the correctness of the installation: to do this, run in the command line (terminal):
48+
2.3 helpers
5749

58-
```
59-
node -v // for checking Node.js version
60-
npm -v // for checking npm version
61-
```
50+
2.4 hooks
6251

63-
2. Get the latest stable version [PostgreSQL](https://www.postgresql.org/download/ 'PostgreSQL') for your OS. Check the correctness of the work - try to create a database, a table - for this you can use [pgAdmin](https://www.pgadmin.org/ 'pgAdmin') or any other convenient way you find.
52+
2.5 modules - separate features or functionalities
6453

65-
3. 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.
54+
2.6 types
6655

67-
4. Install Git.
56+
3. modules - separate app features or functionalities
57+
4. pages - app pages
6858

69-
**Note**: If you are using Windows, do these two additional steps before cloning the repo:
59+
### Backend
7060

71-
- Change `eol` setting in your code editor to `lf`.
72-
- Change the `autocrlf` setting to `input` in the Git settings:
61+
#### Technologies
7362

74-
```
75-
git config --global core.autocrlf input
76-
```
63+
1. [Fastify](https://fastify.dev/) — a backend framework
64+
2. [Knex](https://knexjs.org/) — a query builder
65+
3. [Objection](https://vincit.github.io/objection.js/) — an ORM
7766

78-
5. Clone project`s [repo](https://github.com/BinaryStudioAcademy/thread-js):
67+
#### Folder Structure
7968

80-
```
81-
git clone [email protected]:BinaryStudioAcademy/thread-js.git
82-
```
69+
1. db - database data (migrations, seeds)
70+
2. libs - shared libraries and utilities
8371

84-
6. **Create a repo at [Bitbucket](https://bitbucket.org/) and carry out further development there.**
72+
2.1 enums
8573

86-
### Root of project
74+
2.2 exceptions
8775

88-
1. In the root of the project, install all the dependencies with command:
76+
2.3 helpers
8977

90-
```
91-
npm install
92-
```
78+
2.4 modules - separate features or functionalities
9379

94-
2. After installing the packages, in the root of the project, you need to run the command to [git-hooks](https://www.npmjs.com/package/simple-git-hooks):
80+
2.5 types
9581

96-
```
97-
npx simple-git-hooks
98-
```
82+
3. modules - separate app features or functionalities
9983

100-
**Now, for each of your commits, the linter will be launched and check your code. It's very important and must have thing, developer should follow linter instructions, without it the PR cannot be merged in real life(IN YOUR CASE, THE WORK MAY NOT BE PROPERLY EVALUATED)**
84+
### Shared Package
10185

102-
### Backend
86+
#### Reason
87+
88+
As we are already using js on both frontend and backend it would be useful to share some contracts and code between them.
89+
90+
## Installation
10391

104-
1. In the command line (terminal) go to the folder server:
92+
1. Get [Node.js](https://nodejs.org/en/ 'Node.js') (LTS) the version included into [.nvmrc file](./.nvmrc). **Note:** npm will be installed automatically. Check the correctness of the installation: to do this, run in the command line (terminal):
10593

10694
```
107-
cd /* path to server folder */
95+
node -v // for checking Node.js version
96+
npm -v // for checking npm version
10897
```
10998
110-
2. In the server folder create a file **.env** and copy the contents of the file **.env.example** into it.
111-
112-
**Note**: file **.env** contains real project keys and should not be saved to the repository.
99+
2. Get the latest stable version [PostgreSQL](https://www.postgresql.org/download/ 'PostgreSQL') for your OS. Check the correctness of the work - try to create a database, a table - for this you can use [pgAdmin](https://www.pgadmin.org/ 'pgAdmin') or any other convenient way you find.
113100
114-
Replace in file **.env** key values to real.
115-
In order to specify the keys for Gyazo Storage, you need to register on the site [Gyazo](https://gyazo.com/captures) and [register the app](https://gyazo.com/oauth/applications). Then, in **.env** use `access token` from the recently created application to Gyazo.
101+
3. 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.
116102
117-
3. Run [migrations](https://knexjs.org/#Migrations) and seeds to populate the database with demo data. To do this, in the command line (terminal) in the server folder, run:
103+
4. Install Git.
118104
119-
```
120-
npm run migrate:dev
121-
npm run seed:run
122-
```
105+
**Note**: If you are using Windows, do these two additional steps before cloning the repo:
123106
124-
Check the database for demo data.
107+
- Change `eol` setting in your code editor to `lf`.
108+
- Change the `autocrlf` setting to `input` in the Git settings:
125109
126-
4. To start the server in the command line (terminal) in the server folder, run:
110+
```
111+
git config --global core.autocrlf input
112+
```
127113
128-
```
129-
npm run start:dev
130-
```
114+
5. Clone project`s [repo](https://github.com/BinaryStudioAcademy/thread-js):
131115
132-
5. To test the correct completing the task in the command line (terminal) in the server folder, run:
133116
```
134-
npm run test:${task key}
135-
```
136-
For example: `dislike post` task
137-
```
138-
npm run test:dislike-post
117+
git clone [email protected]:BinaryStudioAcademy/thread-js.git
139118
```
140-
Pay attention! During development, tests from previous tasks may be failled, this is an expected behavior, focus on those that correspond to the current task.
141119
142-
### Frontend
120+
6. **Create a repo at [Bitbucket](https://bitbucket.org/) and carry out further development there.**
143121
144-
1. In the command line (terminal) go to the `client` folder:
122+
## How to Run
145123
146-
```
147-
cd /* path to client folder */
148-
```
124+
### Manually
149125
150-
2. In the `client` folder create a file **.env** and copy the contents of the file into it **.env.example**.
126+
1. Create and fill all .env files. These files are:
151127
152-
**Note**: file **.env** contains real project keys and should not be saved to the repository.
128+
- apps/frontend/.env
129+
- apps/backend/.env
153130
154-
Replace in file **.env** key values to real.
131+
You should use .env.example files as a reference.
155132
156-
3. To run the client from the command line (terminal) in the client folder, run:
133+
1. Install dependencies: `npm install`.
157134
158-
```
159-
npm run start:dev
160-
```
135+
2. Install pre-commit hooks: `npx simple-git-hooks`. This hook is used to verify code style on commit.
161136
162-
The app should automatically open in your default browser.
137+
3. Run database. You can run it by installing postgres on your computer.
163138
164-
### 🥊 Code quality
139+
4. Apply migrations: `npm run migrate:dev -w apps/backend`
165140
166-
- [simple-git-hooks](https://www.npmjs.com/package/simple-git-hooks) — a tool that lets you easily manage git hooks.
167-
- [lint-staged](https://www.npmjs.com/package/lint-staged) — run linters on git staged files.
168-
- [dangerjs](https://danger.systems/js/) — automate common code review chores.
169-
- [commitlint](https://commitlint.js.org/) — helps your team adhere to a commit convention.
170-
- [editorconfig](https://editorconfig.org/) — helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
171-
- [prettier](https://prettier.io/) — an opinionated code formatter.
172-
- [ls-lint](https://ls-lint.org/) — file and directory name linter.
173-
- [eslint](https://eslint.org/) — find problems in your JS code.
174-
- [stylelint](https://stylelint.io/) — find and fix problems in your CSS code.
141+
5. Run backend: `npm run start:dev -w apps/backend`
175142
176-
## 🧑‍💻 CI
143+
6. Run frontend: `npm run start:dev -w apps/frontend`
177144
178-
### 🗞 Git
145+
## Development Flow
179146
180-
#### 🏅 Pull Request flow
147+
### Pull Request Flow
181148
182149
```
183-
<project-prefix>-<issue-number>: <ticket-title>
150+
<type>: <ticket-title> <project-prefix>-<issue-number>
184151
```
185152
186-
##### Example
153+
For the full list of types check [Conventional Commits](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)
187154
188-
- `thjs-5: Add Clinician Dashboard`
155+
Examples:
189156
190-
#### 🌳 Branch flow
157+
- `feat: add dashboard screen tm-123`
158+
159+
### Branch Flow
191160
192161
```
193-
<type>/<project-prefix>-<issue-number>-<short-desc>
162+
<issue-number>-<type>-<short-desc>
194163
```
195164
196-
##### Types
197-
198-
- task
199-
- fix
165+
Examples:
200166
201-
##### Examples
167+
- `123-feat-add-dashboard`
168+
- `12-feat-add-user-flow`
169+
- `34-fix-user-flow`
202170
203-
- `task/thjs-5-add-clinician-dashboard`
204-
- `task/thjs-12-add-clinician-flow`
205-
- `fix/thjs-16-fix-clinician-flow`
171+
### Commit Flow
206172
207-
#### 🗂 Commit flow
173+
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) to handle commit messages
208174
209175
```
210-
<project-prefix>-<issue-number>: <modifier> <description>
176+
<type>: <description> <project-prefix>-<issue-number>
211177
```
212178
213-
##### Modifiers
214-
215-
- `+` (add)
216-
- `*` (edit)
217-
- `-` (remove)
218-
219-
##### Examples
179+
Examples:
220180
221-
- `thjs-5: + title for dashboard`
222-
- `thjs-12: * dashboard title`
223-
- `thjs-16: - dashboard title`
181+
- `feat: add dashboard component tm-45`
182+
- `fix: update dashboard card size tm-212`
224183
225184
## PS
226185
227-
The entire list of tasks can also be found on the board [**Trello**](https://trello.com/b/9Y9ZIr6j '**Trello**') in the column **To Do**. You need to copy the board for yourself and work on it. This will help you track the entire process of your work, and we will determine what is already ready. The task will be considered completed if it is fully completed and the feature works. 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..
186+
The entire list of tasks can also be found on the [**Issues**](https://github.com/BinaryStudioAcademy/thread-js/issues) You can sort only usefull ones by `ready-for-student` label. These tasks are grouped with must-have(with current label) and optional.
228187
229-
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.
188+
## PAY ATTENSION!!!
230189
231-
Links:
190+
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...
232191
233-
1. [Repo](https://github.com/BinaryStudioAcademy/thread-js).
234-
2. [Trello](https://trello.com/b/9Y9ZIr6j).
192+
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.
235193
236194
## FAQ:
237195
@@ -242,7 +200,3 @@ Complete freedom of action, feel free, use whatever you want.
242200
2. Is it possible to change the database (add columns, tables)?
243201
244202
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.
245-
246-
3. When registering an application on the Gyazo website, you must provide `Authorization callback URL`
247-
248-
Use https://www.google.com/.

0 commit comments

Comments
 (0)