You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,230 +8,188 @@ The main theme of the project is a social network similar to Twitter.
8
8
9
9
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.
10
10
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
+
11
21
## Technologies
12
22
13
23
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.
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
57
49
58
-
```
59
-
node -v // for checking Node.js version
60
-
npm -v // for checking npm version
61
-
```
50
+
2.4 hooks
62
51
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
64
53
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
66
55
67
-
4. Install Git.
56
+
3. modules - separate app features or functionalities
57
+
4. pages - app pages
68
58
69
-
**Note**: If you are using Windows, do these two additional steps before cloning the repo:
59
+
### Backend
70
60
71
-
- Change `eol` setting in your code editor to `lf`.
72
-
- Change the `autocrlf` setting to `input` in the Git settings:
61
+
#### Technologies
73
62
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
6. **Create a repo at [Bitbucket](https://bitbucket.org/) and carry out further development there.**
72
+
2.1 enums
85
73
86
-
### Root of project
74
+
2.2 exceptions
87
75
88
-
1. In the root of the project, install all the dependencies with command:
76
+
2.3 helpers
89
77
90
-
```
91
-
npm install
92
-
```
78
+
2.4 modules - separate features or functionalities
93
79
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
95
81
96
-
```
97
-
npx simple-git-hooks
98
-
```
82
+
3. modules - separate app features or functionalities
99
83
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
101
85
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
103
91
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):
105
93
106
94
```
107
-
cd /* path to server folder */
95
+
node -v // for checking Node.js version
96
+
npm -v // for checking npm version
108
97
```
109
98
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.
113
100
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.
116
102
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.
118
104
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:
123
106
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:
125
109
126
-
4. To start the server in the command line (terminal) in the server folder, run:
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.
141
119
142
-
### Frontend
120
+
6. **Create a repo at [Bitbucket](https://bitbucket.org/) and carry out further development there.**
143
121
144
-
1. In the command line (terminal) go to the `client` folder:
122
+
## How to Run
145
123
146
-
```
147
-
cd /* path to client folder */
148
-
```
124
+
### Manually
149
125
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:
151
127
152
-
**Note**: file **.env** contains real project keys and should not be saved to the repository.
128
+
- apps/frontend/.env
129
+
- apps/backend/.env
153
130
154
-
Replace in file **.env** key values to real.
131
+
You should use .env.example files as a reference.
155
132
156
-
3. To run the client from the command line (terminal) in the client folder, run:
133
+
1. Install dependencies: `npm install`.
157
134
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.
161
136
162
-
The app should automatically open in your default browser.
137
+
3. Run database. You can run it by installing postgres on your computer.
163
138
164
-
### 🥊 Code quality
139
+
4. Apply migrations: `npm run migrate:dev -w apps/backend`
165
140
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`
175
142
176
-
## 🧑💻 CI
143
+
6. Run frontend: `npm run start:dev -w apps/frontend`
For the full list of types check [Conventional Commits](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)
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.
228
187
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!!!
230
189
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...
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.
235
193
236
194
## FAQ:
237
195
@@ -242,7 +200,3 @@ Complete freedom of action, feel free, use whatever you want.
242
200
2. Is it possible to change the database (add columns, tables)?
243
201
244
202
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`
0 commit comments