Skip to content

Commit 3852f1e

Browse files
authored
Merge pull request #5 from Atuldubey98/copilot/update-docs-index-html
2 parents d18429c + 598babb commit 3852f1e

File tree

1 file changed

+106
-31
lines changed

1 file changed

+106
-31
lines changed

docs/index.html

Lines changed: 106 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ <h1>
6666
<section id="features">
6767
<h2>About</h2>
6868
<p>
69-
Optimum ERP is a comprehensive enterprise resource planning (ERP)
70-
solution built using the MERN stack (MongoDB, Express.js, React.js,
71-
and Node.js). This project aims to streamline and automate various
72-
business processes, including expense management, product management,
73-
quotation handling, purchase and sales operations, GST management, and
74-
expense categorization. On top of it project is open source now.
69+
Optimum ERP is a full-stack ERP platform for managing business
70+
operations such as users, organizations, invoicing, purchases,
71+
expenses, reports, and settings. This project is open source.
7572
</p>
7673
<h2>Features</h2>
7774
<ul>
@@ -93,10 +90,11 @@ <h2>Features</h2>
9390
<h2>Technologies Used</h2>
9491
<p>Optimum ERP is built with:</p>
9592
<ul>
96-
<li>MongoDB</li>
97-
<li>Express.js</li>
98-
<li>React.js</li>
99-
<li>Node.js</li>
93+
<li>Frontend: React + Vite</li>
94+
<li>Backend: Node.js + Express</li>
95+
<li>Database: MongoDB</li>
96+
<li>Scheduler: Background cron service</li>
97+
<li>Deployment: Docker Compose</li>
10098
<li>Chakra UI</li>
10199
<li>Framer Motion</li>
102100
<li>
@@ -106,42 +104,119 @@ <h2>Technologies Used</h2>
106104
</ul>
107105
</section>
108106
<section id="deploy">
109-
<h2>Steps to start developing or deploy the server:</h2>
107+
<h2>Deployment Steps</h2>
110108
<ol>
111109
<li>
112-
Create a <code>.env.development</code> file for development or
113-
<code>.env</code> for production using the environment variables
114-
provided above.
110+
<strong>Prerequisites</strong>
111+
<ul>
112+
<li>Install Docker</li>
113+
<li>Install Docker Compose plugin</li>
114+
</ul>
115+
</li>
116+
<li>
117+
Clone the repository:
118+
<pre><code>git clone https://github.com/Atuldubey98/OptimumERP.git</code></pre>
115119
</li>
116120
<li>
117-
Install dependencies:
118-
<pre><code>npm install</code></pre>
121+
Open the project directory:
122+
<pre><code>cd OptimumERP</code></pre>
119123
</li>
120124
<li>
121-
Build the application:
122-
<pre><code>npm run build</code></pre>
125+
Create a <code>.env</code> file in the project root using
126+
<code>env.txt</code> as reference. Add the following keys:
127+
<pre><code>MONGO_URI=mongodb://mongo:27017/mernapp?replicaSet=rs0
128+
SESSION_SECRET=your-secure-random-string
129+
VITE_API_URL=http://localhost:3000
130+
IMPORT_CRON_SCHEDULE=*/5 * * * *
131+
LOG_FILE_PATH=./logs/app.log
132+
DEFAULT_USER_PLAN=platinum
133+
NETWORK_STORAGE_PATH=./uploads</code></pre>
123134
</li>
124135
<li>
125-
For development, run:
136+
Start all services:
137+
<pre><code>docker compose up -d --build</code></pre>
138+
</li>
139+
<li>
140+
Verify services:
141+
<pre><code>docker compose ps</code></pre>
142+
</li>
143+
<li>
144+
Verify backend health:
145+
<pre><code>curl http://localhost:3000/api/v1/health</code></pre>
146+
</li>
147+
<li>
148+
Access the application:
126149
<ul>
127-
<li>
128-
Backend server:
129-
<pre><code>npm run dev:backend</code></pre>
130-
</li>
131-
<li>
132-
Frontend server:
133-
<pre><code>npm run dev:frontend</code></pre>
134-
</li>
150+
<li>Frontend: <a href="http://localhost:5173" target="_blank" rel="noopener noreferrer">http://localhost:5173</a></li>
151+
<li>Backend API: <a href="http://localhost:3000/api/v1" target="_blank" rel="noopener noreferrer">http://localhost:3000/api/v1</a></li>
135152
</ul>
136153
</li>
154+
</ol>
155+
<h2>Common Commands</h2>
156+
<ul>
157+
<li>
158+
Restart services:
159+
<pre><code>docker compose restart</code></pre>
160+
</li>
161+
<li>
162+
Stop services:
163+
<pre><code>docker compose down</code></pre>
164+
</li>
137165
<li>
138-
For production, start the server:
139-
<pre><code>npm start</code></pre>
166+
View logs:
167+
<pre><code>docker compose logs -f</code></pre>
140168
</li>
169+
</ul>
170+
<h2>Production Notes</h2>
171+
<ul>
172+
<li>Keep <code>.env</code> secrets private.</li>
173+
<li>Use HTTPS with a reverse proxy for production.</li>
174+
<li>Back up MongoDB data volume regularly.</li>
175+
<li>Rotate credentials periodically.</li>
176+
</ul>
177+
</section>
178+
<section id="api">
179+
<h2>API Documentation</h2>
180+
<p>
181+
The backend exposes a REST API under the base path
182+
<code>/api/v1</code>. Authentication uses session-based cookies
183+
(<code>express-session</code>).
184+
</p>
185+
<h3>Authentication</h3>
186+
<ol>
187+
<li>Call the login endpoint to create a session.</li>
188+
<li>Store the session cookie returned by the server.</li>
189+
<li>Send that cookie on all protected API calls.</li>
141190
</ol>
191+
<pre><code># Login and store cookies
192+
curl -i -c cookies.txt \
193+
-X POST http://localhost:3000/api/v1/users/login \
194+
-H "Content-Type: application/json" \
195+
-d '{"email":"you@example.com","password":"your-password"}'
196+
197+
# Use stored cookies for protected endpoints
198+
curl -i -b cookies.txt \
199+
http://localhost:3000/api/v1/users</code></pre>
200+
<h3>Key Endpoints</h3>
201+
<ul>
202+
<li><code>GET /api/v1/health</code> — Service health check</li>
203+
<li><code>POST /api/v1/users/register</code> — Register a new user</li>
204+
<li><code>POST /api/v1/users/login</code> — Login and create session</li>
205+
<li><code>GET /api/v1/organizations</code> — List organizations for current user</li>
206+
<li><code>GET /api/v1/organizations/:orgId/invoices</code> — List invoices</li>
207+
<li><code>GET /api/v1/organizations/:orgId/purchases</code> — List purchases</li>
208+
<li><code>GET /api/v1/organizations/:orgId/expenses</code> — List expenses</li>
209+
<li><code>GET /api/v1/organizations/:orgId/dashboard</code> — Dashboard summary</li>
210+
<li><code>GET /api/v1/organizations/:orgId/reports/:reportType</code> — Reports</li>
211+
</ul>
142212
<p>
143-
These commands will spin up the backend and frontend servers, making
144-
the application fully functional.
213+
For the full API reference, see
214+
<a
215+
href="https://github.com/Atuldubey98/OptimumERP/blob/main/backend/README.md"
216+
target="_blank"
217+
rel="noopener noreferrer"
218+
>backend/README.md</a
219+
>.
145220
</p>
146221
</section>
147222
<section id="contribute">

0 commit comments

Comments
 (0)