Welcome to HackHeist. In this workshop, you will build a full-stack application using React, Express, and MongoDB while learning about RESTful APIs. This project simulates a heist planning system, where you can manage crew members, plan jobs, and track loot.
By the end of this workshop, you will:
- Understand full-stack development using MERN (MongoDB, Express, React, Node.js).
- Create a RESTful API using Express.
- Use MongoDB and Mongoose for database operations.
- Build a React frontend to interact with the backend.
- Implement CRUD operations (Create, Read, Update, Delete).
Ensure you have the following installed:
git clone https://github.com/yourusername/hack-heist.git
cd HackHeist
- Navigate to the backend folder:
cd server
- Install dependencies:
npm install
- Create a
.env
file and add your MongoDB URI:MONGO_URI=mongodb://localhost:27017/HackHeist # Can alternatively use Mongo Atlas
- Start the backend server:
The server should now be running at
npm run dev
http://localhost:4000
.
- Navigate to the frontend folder:
cd ../client
- Install dependencies:
npm install
- Start the frontend development server:
The frontend should now be running at
npm run dev
http://localhost:3000
.
This workshop is divided into sections where we progressively build upon HackHeist.
- Define a CrewMember model with fields like
location
,startDate
,endDate
andplanEntry
. - Create a Mongoose schema in
models/crewModel.js
.
- Implement CRUD routes for managing crew members.
- (Optional) Use Postman to test the API endpoints.
- Create a Crew Page in React.
- Use Axios to fetch and display crew member data.
- Define a Heist schema in MongoDB.
Method | Endpoint | Description |
---|---|---|
GET | /api/crew |
Get all crew members |
POST | /api/crew |
Add a new crew member |
GET | /api/heist |
Get all heist |
POST | /api/heist |
Add a new heist |
- Implement user authentication.
- Improve UI with Tailwind CSS or Material UI.
- Deploy the application using Vercel (frontend) and Render (backend).
If you have any issues, reach out on Discord!