Skip to content

Commit faeced5

Browse files
committed
chore: update README and remediate dependency vulnerabilities
1 parent df33b74 commit faeced5

4 files changed

Lines changed: 1999 additions & 2128 deletions

File tree

‎README.md‎

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ A full-stack CRUD application built with MongoDB, Express, React, and Node.js (M
55
Companion code for the [MERN Stack Tutorial](https://www.mongodb.com/languages/mern-stack-tutorial?utm_campaign=devrel&utm_medium=github&utm_content=mern.stack.example&utm_term=learning.fuel) and [video walkthrough](https://www.youtube.com/watch?v=4nKWREmCvsE).
66

77
[![CI](https://github.com/mongodb-developer/mern-stack-example/actions/workflows/main.yaml/badge.svg)](https://github.com/mongodb-developer/mern-stack-example/actions/workflows/main.yaml)
8+
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
9+
[![GitHub stars](https://img.shields.io/github/stars/mongodb-developer/mern-stack-example?style=social)](https://github.com/mongodb-developer/mern-stack-example/stargazers)
10+
[![GitHub issues](https://img.shields.io/github/issues/mongodb-developer/mern-stack-example)](https://github.com/mongodb-developer/mern-stack-example/issues)
811

9-
## MERN Stack Architecture
12+
## Project Overview
1013

1114
This project demonstrates an employee record tracker:
1215

@@ -17,6 +20,8 @@ This project demonstrates an employee record tracker:
1720

1821
The React app in `mern/client` calls an Express API in `mern/server`, and data is stored in MongoDB Atlas.
1922

23+
## MERN Stack Architecture
24+
2025
```
2126
┌─────────────────────┐ REST (JSON) ┌──────────────────────────┐
2227
│ React (Vite) │ ─────────────────────► │ Express API │
@@ -38,74 +43,66 @@ Stack:
3843
- Backend: Node.js, Express 4, MongoDB Node.js Driver 6
3944
- Database: MongoDB Atlas (`employees.records` collection)
4045

46+
## Project Structure
47+
48+
```text
49+
mern/
50+
client/ # React + Vite frontend
51+
server/ # Express API + MongoDB integration
52+
```
53+
4154
## Prerequisites
4255

4356
- Node.js 20+
4457
- npm 9+
4558
- A free [MongoDB Atlas](https://www.mongodb.com/atlas?utm_campaign=devrel&utm_medium=github&utm_content=mern.stack.example&utm_term=learning.fuel) cluster
4659

47-
## Quick Start
60+
## Quick Start and MongoDB Setup
4861

4962
```bash
5063
# 1) Clone
5164
git clone https://github.com/mongodb-developer/mern-stack-example.git
5265
cd mern-stack-example
5366

54-
# 2) Configure environment
67+
# 2) Create server environment file
5568
cp mern/server/config.env.example mern/server/config.env
56-
57-
# 3) Start API server
58-
cd mern/server
59-
npm install
60-
npm start
61-
62-
# 4) Start frontend (new terminal)
63-
cd ../client
64-
npm install
65-
npm run dev
6669
```
6770

68-
Open `http://localhost:5173`.
69-
70-
## MongoDB Atlas Setup
71+
Update `mern/server/config.env` with one of the following `ATLAS_URI` values:
7172

72-
### Configure server environment
73-
74-
Update `mern/server/config.env`:
73+
Atlas cluster:
7574

7675
```env
77-
ATLAS_URI=mongodb://admin:mongodb@mongodb:27017/
76+
ATLAS_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/
7877
PORT=5050
7978
```
8079

81-
If you're running the database locally in the devcontainer, keep the configured connection string.
82-
83-
You may also connect to an Atlas cluster. If you're new to Atlas, follow the [quick start guide](https://www.mongodb.com/docs/atlas/getting-started/?utm_campaign=devrel&utm_medium=github&utm_content=mern.stack.example&utm_term=learning.fuel) and then update `ATLAS_URI` with your connection string.
80+
If you are new to Atlas, use the [Atlas quick start guide](https://www.mongodb.com/docs/atlas/getting-started/?utm_campaign=devrel&utm_medium=github&utm_content=mern.stack.example&utm_term=learning.fuel) and then paste your connection string into `ATLAS_URI`.
8481

85-
### Seed sample data (optional)
82+
Optional: seed sample data:
8683

8784
```bash
88-
cd mern/server
89-
node seed.js
85+
cd mern/server && node seed.js
9086
```
9187

92-
### Run services
93-
94-
Backend:
88+
Start the backend API:
9589

9690
```bash
9791
cd mern/server
9892
npm install
9993
npm start
10094
```
10195

102-
Frontend:
96+
Start the frontend in a second terminal:
10397

10498
```bash
10599
cd mern/client
100+
npm install
106101
npm run dev
107102
```
108103

104+
Open `http://localhost:5173`.
105+
109106
## GitHub Codespaces and Dev Containers
110107

111108
GitHub Codespaces is an easy and fast way to get this project running without installing anything locally. It uses a dev container, which is a Docker environment configured for development.
@@ -167,6 +164,11 @@ Example request body for create or update:
167164

168165
- Change `PORT` in `mern/server/config.env`, or stop the process using `:5050`
169166

167+
## Community and Support
168+
169+
- Use [GitHub Issues](https://github.com/mongodb-developer/mern-stack-example/issues) for bugs and feature requests
170+
- Use [MongoDB Community Forums](https://www.mongodb.com/community/forums/) for general MongoDB questions
171+
170172
## Additional Resources
171173

172174
- [MERN Stack Tutorial](https://www.mongodb.com/languages/mern-stack-tutorial?utm_campaign=devrel&utm_medium=github&utm_content=mern.stack.example&utm_term=learning.fuel)

0 commit comments

Comments
 (0)