@@ -15,71 +15,81 @@ cd urBackend
1515```
1616
1717### 2. Project Structure
18- The repository is organized into two main directories:
19- - ** ` backend/ ` ** : Node.js & Express application handling the API, database, and authentication.
20- - ** ` frontend/ ` ** : React.js (Vite) application for the user dashboard.
18+ The repository is organized into a monorepo-style structure:
19+
20+ #### Applications (` apps/ ` )
21+ - ** ` apps/dashboard-api ` ** : The internal API handling dashboard operations, project management, and user authentication for the urBackend platform.
22+ - ** ` apps/public-api ` ** : The public-facing API that users' applications interact with to store data, manage users, and handle storage.
23+ - ** ` apps/web-dashboard ` ** : The React-based frontend dashboard where users manage their projects and keys.
24+
25+ #### Packages (` packages/ ` )
26+ - ** ` packages/common ` ** : Shared logic, MongoDB models, and utility functions used by both APIs.
27+
28+ #### Examples (` examples/ ` )
29+ - ** ` examples/social-demo ` ** : A full-featured X.com clone demonstrating the capabilities of urBackend.
2130
2231### 3. Setup and Installation
2332
24- #### Backend
25- 1 . Navigate to the backend directory: ` cd backend `
26- 2 . Install dependencies: ` npm install `
27- 3 . Create a ` .env ` file (refer to ` README.md ` for required variables).
28- 4 . Start the server:
29- ``` bash
30- npm start
31- ```
32-
33- #### Frontend
34- 1 . Navigate to the frontend directory: ` cd frontend `
35- 2 . Install dependencies: ` npm install `
36- 3 . Start the development server:
37- ``` bash
38- npm run dev
39- ```
33+ #### Prerequisites
34+ - ** Node.js** : v18 or later.
35+ - ** MongoDB** : A running instance (local or Atlas).
36+ - ** Redis** : Required for API key caching in ` public-api ` .
37+
38+ #### Installation
39+ 1 . From the root directory, install all dependencies for the entire monorepo:
40+ ``` bash
41+ npm install
42+ ```
43+ This will automatically link all packages and install dependencies for all apps.
44+
45+ # ### Running Locally
46+
47+ You can start all main applications at once (useful for testing end-to-end):
48+ ` ` ` bash
49+ npm run dev
50+ ` ` `
51+
52+ If you only want to work on a specific application:
53+ - ** Dashboard API** : ` npm run dev --workspace=dashboard-api`
54+ - ** Public API** : ` npm run dev --workspace=public-api`
55+ - ** Web Dashboard** : ` npm run dev --workspace=web-dashboard`
4056
4157# # 🛠️ Development Workflow
4258
43- 1 . ** Create a Branch** : Always create a new branch for your work. Use descriptive names like ` feature/new-login-ui ` or ` fix/database-connection ` .
44- ``` bash
45- git checkout -b feature/your-feature-name
46- ```
47-
48- 2 . ** Make Changes** : Implement your feature or fix.
49-
50- 3 . ** Test Your Changes** :
51- - ** Backend** : Run tests using Jest.
52- ``` bash
53- cd backend
54- npm test
55- ```
56- - ** Frontend** : Ensure there are no linting errors.
57- ` ` ` bash
58- cd frontend
59- npm run lint
60- ` ` `
61-
62- 4. ** Commit** : Use clear and concise commit messages.
63- ` ` ` bash
64- git commit -m " Add feature X"
65- ` ` `
66-
67- 5. ** Push** : Push your branch to your forked repository.
68- ` ` ` bash
69- git push origin feature/your-feature-name
70- ` ` `
59+ 1. ** Create a Branch** : Always create a new branch for your work. Use descriptive names like ` feature/new-login-ui` or ` fix/database-connection` .
60+ ` ` ` bash
61+ git checkout -b feature/your-feature-name
62+ ` ` `
63+
64+ 2. ** Make Changes** : Implement your feature or fix. Follow the existing coding style and ensure your code is well-documented.
65+
66+ 3. ** Test Your Changes** :
67+ - Ensure there are no linting errors across the project:
68+ ` ` ` bash
69+ npm run lint --workspaces --if-present
70+ ` ` `
71+
72+ 4. ** Commit** : Use clear and concise commit messages following conventional commits standard if possible.
73+ ` ` ` bash
74+ git commit -m " feat: add social auth support"
75+ ` ` `
76+
77+ 5. ** Push** : Push your branch to your forked repository.
78+ ` ` ` bash
79+ git push origin feature/your-feature-name
80+ ` ` `
7181
7282# # 📬 Submitting a Pull Request (PR)
7383
74- 1. Go to the original repository and click " Compare & pull request" .
75- 2. Provide a clear title and description of your changes.
76- 3. Link any related issues (e.g., " Fixes #123" ).
77- 4. Wait for review and address any feedback.
84+ 1. Go to the original repository and click " Compare & pull request" .
85+ 2. Provide a clear title and description of your changes.
86+ 3. Link any related issues (e.g., " Fixes #123" ).
87+ 4. Wait for review and address any feedback.
7888
7989# # 🐛 Reporting Bugs & Feature Requests
8090
81- - ** Bugs** : If you find a bug, please create an issue describing the problem, steps to reproduce, and expected behavior.
82- - ** Features** : If you have an idea for a new feature, feel free to open an issue to discuss it before starting implementation.
91+ - ** Bugs** : If you find a bug, please create an issue describing the problem, steps to reproduce, and expected behavior.
92+ - ** Features** : If you have an idea for a new feature, feel free to open an issue to discuss it before starting implementation.
8393
8494# # 🤝 Code of Conduct
8595
0 commit comments