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
For a more detailed how to guide on setting them up [go to the Environment Variables section](#environment-variables).
44
+
For a more detailed guide on setting them up [go to the Environment Variables section](#environment-variables).
45
45
46
46
**NOTE:** Before proceeding, [make sure your database is running](#database_url).
47
47
48
-
6.Setup the tables in the database with Drizzle by running:
48
+
6. Setup the tables in the database with Drizzle by running:
49
49
50
50
```bash
51
51
npm run db:migrate
52
52
```
53
53
54
-
The full command can be seen in our [package.json](/package.json#16) file
54
+
The full command can be seen in our [package.json](/package.json#16) file.
55
55
56
56
7. Seed the database with some mock data by running:
57
57
58
58
```bash
59
59
npm run db:seed
60
60
```
61
61
62
-
The full command can be seen in our [package.json](/package.json#19) file
62
+
The full command can be seen in our [package.json](/package.json#19) file.
63
63
64
64
8. Finally, run the development server:
65
65
66
66
```bash
67
67
npm run dev
68
68
```
69
69
70
-
After completion of above commands, now -
70
+
After completion of the above commands, navigate to [http://localhost:3000](http://localhost:3000) in your browser to see the result.
71
71
72
-
Navigate to [http://localhost:3000](http://localhost:3000) in your browser to see the result.
73
-
74
-
You can start your journey by modifying `pages/index.tsx`. With Auto-update feature, pages updates as you edit the file.
72
+
You can start your journey by modifying `pages/index.tsx`. With the auto-update feature, pages update as you edit the file.
75
73
76
74
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
77
75
@@ -89,49 +87,39 @@ To run this file, make sure you have [Docker installed](https://docs.docker.com/
89
87
90
88
Run the command `docker compose up`.
91
89
92
-
Alternatively, if you have PostgreSQL running locally then you can use your local connection string or grab one from a free service like [Supabase](https://supabase.com/docs/guides/database/connecting-to-postgres#finding-your-connection-string).
90
+
Alternatively, if you have PostgreSQL running locally, you can use your local connection string or grab one from a free service like [Supabase](https://supabase.com/docs/guides/database/connecting-to-postgres#finding-your-connection-string).
93
91
94
92
### GITHUB_ID and GITHUB_SECRET
95
93
96
-
Currently, we only allow authentication via GitHub. To enable this you need to have a `GITHUB_ID` and `GITHUB_SECRET` value.
94
+
Currently, we only allow authentication via GitHub. To enable this, you need to have a `GITHUB_ID` and `GITHUB_SECRET` value.
97
95
98
-
Setup your GitHub ID & Secret on GitHub:
96
+
Set up your GitHub ID & Secret on GitHub:
99
97
100
-
-[Click here](https://github.com/settings/applications/new) to setup New OAuth App and fill in the details as shown below.
98
+
-[Click here](https://github.com/settings/applications/new) to set up a New OAuth App and fill in the details as shown below.
101
99
102
-
For development, make sure you setup this with a **Homepage URL** of
100
+
For development, make sure you set this up with a **Homepage URL** of
103
101
104
102
```
105
103
http://localhost:3000/
106
104
```
107
105
108
-
and **Authorization callback URL** of
106
+
and an **Authorization callback URL** of
109
107
110
108
```
111
109
http://localhost:3000/api/auth
112
110
```
113
111
114
-
as shown in the image below:
115
-
116
-

117
-
118
-
After you click the "Register application" button you should see the `GITHUB_ID` and be able to generate a new client secret. You can see this in the screenshot below. 👇
119
-

120
-
After generating the secret, make sure you copy this value to your `.env` file as this value can not be seen again once you refresh the page. 👇
121
-

112
+
After you click the "Register application" button, you should see the `GITHUB_ID` and be able to generate a new client secret. After generating the secret, make sure you copy this value to your `.env` file as this value cannot be seen again once you refresh the page.
122
113
123
-
More info on Authorizing OAuth in the GitHub documentation
More info on Authorizing OAuth in the GitHub documentation [here](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps).
125
115
126
-
### Setting up Passwordless auth locally
116
+
### Setting up Passwordless Auth Locally
127
117
128
-
In order to use Passwordless login locally you need to have a`ACCESS_KEY` and `SECRET_KEY` value.
118
+
In order to use Passwordless login locally, you need to have an`ACCESS_KEY` and `SECRET_KEY` value.
129
119
130
-
Niall has written a [tutorial](https://www.codu.co/articles/sending-emails-with-aws-ses-and-nodemailer-in-node-js-xfuucrri) on how to send emails with AWS SES and shows how to get these values.
120
+
Check out the example `.env` file [here](./sample.env)to see how to populate these values.
131
121
132
-
Check out the example .env file [here](./sample.env) to see how to populate these values
133
-
134
-
**Note: Currenly the AWS region of the SNS service is hardcoded to "eu-west-1" it may be necessary to change this if your SNS service is in a different region**
122
+
**Note:** Currently, the AWS region of the SNS service is hardcoded to "eu-west-1"; it may be necessary to change this if your SNS service is in a different region.
135
123
136
124
### NEXTAUTH_URL
137
125
@@ -141,85 +129,16 @@ You shouldn't need to change the default value here. This is a variable used by
141
129
NEXTAUTH_URL=http://localhost:3000/api/auth
142
130
```
143
131
144
-
### E2E_USER_ONE_SESSION_ID
145
-
146
-
This is the sessionToken uuid that is used to identify a users current active session.
147
-
This is currently hardcoded and their is no reason to change this value.
148
-
**Note: This value must be different to E2E_USER_TWO_SESSION_ID**
149
-
150
-
151
-
### E2E_USER_TWO_SESSION_ID
152
-
153
-
This is the sessionToken uuid that is used to identify a users current active session.
154
-
This is currently hardcoded and their is no reason to change this value.
155
-
**Note: This value must be different to E2E_USER_ONE_SESSION_ID**
156
-
157
-
158
-
### E2E_USER_ONE_ID
159
-
160
-
This is the userId of one of our E2E users and is used for testing.
161
-
This is currently hardcoded and there is no reason to change this value.
162
-
**Note: This value must be different from E2E_USER_TWO_ID**
163
-
164
-
165
-
### E2E_USER_TWO_ID
166
-
167
-
This is the userId of one of our E2E users and is used for testing.
168
-
This is currently hardcoded and there is no reason to change this value.
169
-
**Note: This value must be different from E2E_USER_ONE_ID**
170
-
171
-
For more information, you can read the documentation [here](https://next-auth.js.org/configuration/options).
172
-
**Example .env file can be found [here](./sample.env). You can rename this to .env to get started**
132
+
**Example .env file can be found [here](./sample.env). You can rename this to `.env` to get started.**
173
133
174
134
## 👨💻 Contribution Guidelines
175
135
176
136
- Contributions are **greatly appreciated**. Contributions make the open-source community an amazing place to learn, inspire, and create.
177
-
- Check out our [contribution guidelines](/CONTRIBUTING.md) for contributiong to our repo. It includes
137
+
- Check out our [contribution guidelines](/CONTRIBUTING.md) for contributing to our repo. It includes
178
138
- How to Contribute
179
139
- How to create a Pull Request
180
140
- Run Tests
181
-
- Also, Style Guide for Commit Messages
182
-
183
-
## End-to-End Testing with Playwright
184
-
185
-
To run the end-to-end tests using Playwright, you need to configure your environment and follow these steps:
186
-
187
-
### Environment Variables
188
-
189
-
Please ensure you have the following variables set in your `.env` file:
190
-
191
-
-`E2E_USER_ID`: The id of the E2E user for testing.
192
-
-`E2E_USER_EMAIL`: The email of the E2E user for testing.
193
-
-`E2E_USER_ONE_SESSION_ID`: The session id that the user will use to authenticate.
194
-
195
-
196
-
Note the sample .env [here](./sample.env) is fine to use.
197
-
198
-
### Session and User setup
199
-
200
-
First you need to add your E2E test user to your locally running database. Do this by running the following script if you havent already
201
-
202
-
```
203
-
npm run db:seed
204
-
```
205
-
206
-
This will create a user and session for your E2E tests. Details of the E2E user created can be seen [here](./drizzle/seedE2E.ts)
207
-
208
-
### Running the Tests
209
-
210
-
You can run the end-to-end tests using one of the following commands:
211
-
212
-
For headless mode:
213
-
214
-
```zsh
215
-
npx playwright test
216
-
```
217
-
218
-
For UI mode:
219
-
220
-
```zsh
221
-
npx playwright test --ui
222
-
```
141
+
- Style Guide for Commit Messages
223
142
224
143
## 📙 Prerequisite Skills to Contribute
225
144
@@ -246,10 +165,14 @@ To learn more about Next.js, take a look at the following resources:
246
165
247
166
### Editor Doc
248
167
249
-
To learn about the editor shortcuts and hotkeys you can check out this document
168
+
To learn about the editor shortcuts and hotkeys, you can check out this document:
169
+
170
+
-[Markdoc Editor Hotkeys and Shortcuts](/EDITOR_SHORTCUTS.MD)
171
+
172
+
## 🧪 E2E Testing
250
173
251
-
-[Markdoc Editor Hotkeys and Shortcus](/EDITOR_SHORTCUTS.MD)
174
+
For information on E2E testing, please refer to our dedicated documentation [here](./E2E%20Overview.md).
252
175
253
176
## 💥 Issues
254
177
255
-
You are welcome to [open issues](https://github.com/codu-code/codu/issues/new/choose) to discuss ideas about improving our Codú. Enhancements are encouraged and appreciated.
178
+
You are welcome to [open issues](https://github.com/codu-code/codu/issues/new/choose) to discuss ideas about improving Codú. Enhancements are encouraged and appreciated.
0 commit comments