To learn more about the overall project, please visit the repos listed below.
- MongoDB / Mongoose
- Node / Express / REST API
- JSON Web Tokens (JWT)
| Data | Type | Required |
|---|---|---|
| _id | number | generated |
| string | yes | |
| password | string | yes |
| user_lessons | [String] | no |
| available_lesson | number | no |
| user_vocab | [Vocab Set] | no |
| Data | Type | Required |
|---|---|---|
| string | yes | |
| pin | string | yes |
| expireAt | date | generated |
| Data | Type | Required |
|---|---|---|
| vocab_id | ObjectId | yes |
| next_review | date | no |
| lesson_number | number | no |
| rank | number | no |
| Data | Type | Required |
|---|---|---|
| _id | number | generated |
| hebrew | string | no |
| hebrew_with_nikkud | string | no |
| reading | string | no |
| meaning | string | no |
| lesson | number | no |
| gender | string | no |
| Method | Endpoint | Token | Description |
|---|---|---|---|
| POST | /auth/signup |
no | Registers new user and returns token |
| POST | /auth/signin |
no | Signs in registered user and returns token |
| PUT | /auth/password-reset |
no | Verifies email and pin then updates user password |
| Method | Endpoint | Token | Description |
|---|---|---|---|
| GET | /profile |
yes | Returns the current user's profile |
| PUT | /profile |
yes | Updates the user's profile |
| DELETE | /profile |
yes | Deletes the user's profile |
| Method | Endpoint | Token | Description |
|---|---|---|---|
| POST | /vocab |
no | Creates new vocab word |
| GET | /vocab |
no | Returns all vocabulary |
| GET | /vocab/:id |
no | Returns single vocab word by id |
| PUT | /vocab/:id |
no | Updates vocab word by id |
| DELETE | /vocab/:id |
no | Deletes vocab word by id |
| Method | Endpoint | Token | Description |
|---|---|---|---|
| POST | /email |
no | Creates random pin, saves to userPins, sends email to user |
npm install # Install dependencies
npm start # Run app with Node
npm run server # Run app with nodemon
npm run test # Run tests with Mocha (coming soon)Create your own .env file in the root directory with the following keys:
MONGODB_URL={your_key_here}
JWT_SECRET={your_secret_here}
EMAIL={your_email_here}
PASSWORD={your_password_here}