Welcome to Hackwarts. In this workshop, you will build a full-stack application using React, Express, and MongoDB while learning about RESTful APIs. This project simulates a school 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/hackathon-workshop-solutions-2026.git
cd hackathon-workshop-solutions-2026- Navigate to the backend folder:
cd server - Install dependencies:
npm install
- Create a
.envfile and add your MongoDB URI:MONGO_URI=mongodb://localhost:27017/Hackwarts # 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 House model with fields like
houseName,startDate,endDateandcoreTrait. - Create a Mongoose schema in
models/houseModel.js.
- Implement CRUD routes for managing house members.
- (Optional) Use Postman to test the API endpoints.
- Create a Student Page in React.
- Use Axios to fetch and display student data.
- Define a House schema in MongoDB.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/student |
Get all students |
| POST | /api/student |
Add a new student |
| GET | /api/house |
Get all houses |
| POST | /api/house |
Add a new house |
- 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!