{"id":16588997,"url":"https://github.com/sorok-dva/sdr-backend","last_synced_at":"2026-02-02T17:12:54.601Z","repository":{"id":252963002,"uuid":"841883586","full_name":"Sorok-Dva/sdr-backend","owner":"Sorok-Dva","description":"Official backed app of Le Sentier des Rêves","archived":false,"fork":false,"pushed_at":"2024-11-25T15:38:47.000Z","size":1226,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T15:51:26.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sorok-Dva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-13T08:34:33.000Z","updated_at":"2024-09-05T15:15:01.000Z","dependencies_parsed_at":"2024-08-13T18:03:18.651Z","dependency_job_id":"f66df845-8ab9-4b1a-8440-15ed39aecfd8","html_url":"https://github.com/Sorok-Dva/sdr-backend","commit_stats":null,"previous_names":["sorok-dva/sdr-backend"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Sorok-Dva/sdr-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorok-Dva%2Fsdr-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorok-Dva%2Fsdr-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorok-Dva%2Fsdr-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorok-Dva%2Fsdr-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sorok-Dva","download_url":"https://codeload.github.com/Sorok-Dva/sdr-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorok-Dva%2Fsdr-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29015918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T16:17:30.374Z","status":"ssl_error","status_checked_at":"2026-02-02T15:58:50.469Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T23:07:22.988Z","updated_at":"2026-02-02T17:12:54.566Z","avatar_url":"https://github.com/Sorok-Dva.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Sorok-Dva","https://patreon.com/sorokdva"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/Sorok-Dva/sdr-frontend/main/public/img/logo.png\" alt=\"sdr-backend Logo\"\u003e\n  \u003ch1\u003eLe Sentier des Rêves\u003c/h1\u003e\n  \u003cblockquote\u003eRéveillez le rêveur en vous.\u003c/blockquote\u003e\n  \u003cimg src=\"https://hits.dwyl.com/Sorok-Dva/sdr-backend.svg?style=flat-square\" alt=\"Views\"\u003e\u003cbr /\u003e\n  \u003cimg src=\"https://img.shields.io/github/downloads/Sorok-Dva/sdr-backend/total.svg?style=for-the-badge\" alt=\"Total downloads\"\u003e\n  \u003c!--\u003ca href=\"https://shields.io/community#sponsors\" alt=\"Sponsors\"\u003e\n    \u003cimg src=\"https://img.shields.io/opencollective/sponsors/Sorok-Dva.svg?style=for-the-badge\" /\u003e\n  \u003c/a\u003e--\u003e\n  \u003ca href=\"https://github.com/Sorok-Dva/sdr-backend/pulse\" alt=\"Activity\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/commit-activity/m/Sorok-Dva/sdr-backend.svg?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://github.com/sponsors/Sorok-Dva\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA\" alt=\"Sponsor Me\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://patreon.com/sorokdva\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Patreon-F96854?style=for-the-badge\u0026logo=patreon\u0026logoColor=white\" alt=\"Support Me on Patreon\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# Le Sentier des Rêves - Backend app\n\nThis project is the backend of a dream journaling and tutorial platform called \"Le Sentier des Rêves\".\nIt is a RESTful API built using Node.js, Express, and Sequelize. \nIt provides functionalities to manage users, dream journals, tutorials, comments, and more. \nThis API is designed to serve as the backend for a dream journal application that allows users to record, share, and explore their dreams, \nas well as interact with tutorials and community content.\n\n## Table of Contents\n\n- [Features](#features)\n- [Technologies](#technologies)\n- [Installation](#installation)\n- [Environment Variables](#environment-variables)\n- [Database Setup](#database-setup)\n- [Seeding the Database](#seeding-the-database)\n- [Running the Application](#running-the-application)\n- [API Endpoints](#api-endpoints)\n- [Error Handling](#error-handling)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **User Management**: Register, login, role-based access control, and profile management.\n- **Dream Journal**: Create, update, delete, and fetch user dreams with privacy settings.\n- **Tutorials**: Manage tutorials with categories, content, and validation by admins.\n- **Comments**: Add, update, delete, and upvote comments on tutorials.\n- **Reporting**: Users can report inappropriate content.\n- **Authentication**: Secure token-based authentication (JWT).\n\n## Technologies Used\n\n![langs](https://skillicons.dev/icons?i=typescript,nodejs,express,ubuntu,linux,docker,sentry\u0026perline=)\n\n- **Node.js**: TypeScript runtime environment.\n- **Express**: Web framework for Node.js.\n- **Sequelize**: ORM for database management.\n- **MySQL**: Relational database management system.\n- **JWT**: JSON Web Tokens for secure authentication.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (version 14 or higher)\n- npm or yarn\n- MySQL database\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/Sorok-Dva/sdr-backend\n```\n\n2. Navigate to the project directory:\n\n```bash\ncd sdr-backend\n```\n\n3. Install the dependencies:\n\n```bash\nnpm install\n# or\nyarn install\n```\n\n4. Set up environment variables:\n\nCreate a `.env` file in the root directory and add the following:\n\n```env\n# APP\nNODE_ENV=development\nSERVICE_NAME=sdr-api\nWEBSITE_URL=https://sentier-des-reves.fr\nDEBUG=sdr-api:*\nDEBUG_COLORS=true\nDEBUG_DEPTH=10\n\nJWT_SECRET=your_jwt_secret\nCORS_ORIGIN=http://localhost:3011\nPORT=3010\n\n# DB\nDB_NAME=oldsdr\nDB_USER=root\nDB_PASS=root\nDB_HOST=localhost\n\n# Mailjet\nMJ_APIKEY_PUBLIC=xxxxxxxxxxx\nMJ_APIKEY_PRIVATE=xxxxxxxxxxx\n\n# Email options\nEMAIL_SENDER_ADDRESS=support@sentier-des-reves.fr\nEMAIL_SENDER_NAME=\"Lisa du Sentier des Rêves\"\n\nEMAIL_ERRORS_REPORT=errors-reporting@sentier-des-reves.fr\n\n# Sentry\nSENTRY_DSN=xxx\n```\n\n5. Create a database and Run the database migrations and seeders:\n\n```bash\n$mysql\u003e CREATE DATABASE sdr;\nnpx sequelize db:migrate\nnpx sequelize db:seed:all\n```\n\n6. Start the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\nThe server should now be running on `http://localhost:3000`.\n\n### Running Tests\n\nTo run tests, use the following command:\n\n```bash\nnpm run test\n# or\nyarn test\n```\n\n### Project Structure\n\n- `src/`: Contains the source code of the application.\n- `src/models/`: Sequelize models for the database entities.\n- `src/routes/`: Express routes for handling API requests.\n- `src/middlewares/`: Custom middlewares for handling authentication, validation, etc.\n- `config/`: Configuration files including database setup.\n\n### API Endpoints\n\n#### Authentication\n- POST /api/auth/register - Register a new user\n- POST /api/auth/login - Authenticate a user and return a JWT\n\n#### Users\n- GET /api/users/:id - Get user profile by ID\n- PUT /api/users/:id - Update user profile\n- DELETE /api/users/:id - Delete a user\n\n### Dreams\n- POST /api/dreams/ - Create a new dream\n- GET /api/dreams/my - Get user's dreams\n- PUT /api/dreams/:id - Update a dream\n- DELETE /api/dreams/:id - Delete a dream\n\n#### Tutorials\n- POST /api/tutorials - Create a new tutorial\n- GET /api/tutorials - Get all tutorials\n- GET /api/tutorials/:id - Get a tutorial by ID\n- PUT /api/tutorials/:id - Update a tutorial\n- DELETE /api/tutorials/:id - Delete a tutorial\n\n#### Comments\n- POST /api/comments/ - Add a comment\n- GET /api/comments/:tutorialId - Get comments by tutorial ID\n- PUT /api/comments/:id - Update a comment\n- DELETE /api/comments/:id - Delete a comment\n\n#### Reporting\n- POST /api/reports/ - Report content\n\n### Error Handling\n\nThe API uses standard HTTP status codes to indicate the success or failure of API requests:\n\n- `200 OK` - The request was successful.\n- `201 Created` - The resource was successfully created.\n- `400 Bad Request` - The request was invalid or cannot be served.\n- `401 Unauthorized` - Authentication failed.\n- `404 Not Found` - The requested resource was not found.\n- `500 Internal Server Error` - An error occurred on the server.\n\n### API Documentation\n\nThe API documentation is available at `http://localhost:3000/api-docs` once the server is running. It provides detailed information about each endpoint, including request parameters, responses, and examples.\n\n### Contributing\n\n1. Fork the repository.\n2. Create a new branch for your feature: `git checkout -b feature-name`.\n3. Commit your changes: `git commit -m 'Add some feature'`.\n4. Push to the branch: `git push origin feature-name`.\n5. Open a pull request.\n\n### Acknowledgments\n\n- Developed by [Сорок два](https://github.com/Sorok-Dva). All rights reserved.\n- Developed with love through ![langs](https://skillicons.dev/icons?i=webstorm\u0026perline=)\n\n### License\n\nThis project is licensed under the **Creative Commons Attribution-NonCommercial 4.0 International** - see the [LICENSE](LICENSE) file for details.\n\n## Contributors\n\n\u003ca href=\"https://github.com/sorok-dva/sdr-backend/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=sorok-dva/sdr-backend\" /\u003e\n\u003c/a\u003e\n\n## Contact\n\nFor any inquiries or feedback, please visit our [GitHub Repository](https://github.com/Sorok-Dva/sdr-backend) or contact the developers directly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorok-dva%2Fsdr-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorok-dva%2Fsdr-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorok-dva%2Fsdr-backend/lists"}