Skip to content

surajsinh111/Crate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Notes App

A full-stack web app to create, view, edit, and delete notes — built with React on the frontend and Spring Boot + MongoDB on the backend.


🛠️ Tech Stack

Layer Technology
Frontend React 19, Vite, Tailwind CSS, Axios
Backend Spring Boot 3.5, Java 17, Spring Web, Spring Data MongoDB
Database MongoDB

📌 Features

  • User authentication (login / forgot password)
  • Create, view, edit, and delete notes
  • Modal-based note editor
  • Persistent storage with MongoDB

📂 Project Structure

Crate/
├── frontend/        # React + Vite app
└── test/            # Spring Boot backend

⚙️ Prerequisites

Make sure you have these installed before starting:

  • Node.js v18 or higher — node -v
  • Java 17java -version
  • Mavenmvn -v (or use the included mvnw wrapper)
  • MongoDB running locally on port 27017

🚀 Setup & Running Locally

1. Clone the repository

git clone https://github.com/<your-username>/crate.git
cd crate/Crate

2. Start MongoDB

Make sure MongoDB is running locally:

# Linux / macOS
sudo systemctl start mongod

# macOS with Homebrew
brew services start mongodb-community

# Windows
net start MongoDB

Verify it's running:

mongosh

The backend connects to mongodb://localhost:27017/userdatabase by default.


3. Start the Backend

Navigate to the test/ folder — this is the Spring Boot project:

cd test

Option A — Maven wrapper (recommended, no Maven install needed):

# Linux / macOS
./mvnw spring-boot:run

# Windows
mvnw.cmd spring-boot:run

Option B — System Maven (if you have mvn installed):

mvn spring-boot:run

Option C — IntelliJ IDEA:

  1. Open the test/ folder as a project in IntelliJ
  2. Let it import the Maven dependencies (bottom progress bar)
  3. Open TestApplication.java → click the green ▶ button next to the class

Option D — VS Code:

  1. Install the Spring Boot Extension Pack
  2. Open test/ folder
  3. Click Run above the main method in TestApplication.java

✅ Backend is ready when you see this in the terminal:

Started TestApplication in X.XXX seconds (process running for X.XXX)

The backend runs on http://localhost:8080

Quick verify in a new terminal:

curl http://localhost:8080

Note on CORS: The backend is already configured to accept requests from http://localhost:5173 (the Vite dev server). If you change the frontend port, update the @CrossOrigin annotation in TestApplication.java.


4. Start the Frontend

Open a new terminal:

cd frontend
npm install
npm run dev

The frontend starts on http://localhost:5173

Open that URL in your browser — you'll land on the login page.


🔧 Configuration

Backend config is in test/src/main/resources/application.properties:

spring.application.name=test
spring.data.mongodb.uri=mongodb://localhost:27017/userdatabase

Change the MongoDB URI here if your setup is different (e.g. a remote Atlas cluster).


🧭 App Routes

Route Page
/ Login
/notes Notes dashboard

❗ Common Issues

Problem Fix
CORS error in browser Make sure the backend is running on port 8080
npm ERR! missing script: dev You're in the wrong folder — cd frontend first
MongoServerError: connect ECONNREFUSED MongoDB isn't running — start it with the commands above
Port 8080 already in use Run lsof -ti:8080 | xargs kill then retry
java: command not found Java 17 is not installed or not on your PATH
White screen on /notes Backend is down — check the Spring Boot terminal for errors

🤝 Contributing

See CONTRIBUTING.md for contribution levels (Easy → Very Hard), setup tips, and PR guidelines.

Open issues are listed in ISSUES.md — pick one and get started!

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 72.6%
  • Java 19.9%
  • CSS 6.9%
  • HTML 0.6%