Table of Contents
This is an assignment from Fergus - A Job Portal where tradies can keep track of their jobs. Requirements are:
- Unique job identifier.
- Status: one of "scheduled", "active", "invoicing", “to priced” or “completed”.
- Creation date and time.
- General information like name and contact details of the client.
- The tradie can also make notes for each job. -A job can have any number of notes associated with them.
The tradie should be able to:
- Filter and sort the list of jobs.
- Click on a job in the list to view their details and add/edit notes for that job.
- Change the status of a job.
This application is built with:
- React/JavaScript
- NodeJS (logic written by JavaScript)
- Express
- MongoDB ( NoSQL database)
- React-router
- Material UI
- redux-toolkit
Endpoints | Method | Usage |
---|---|---|
/jobs | GET | Show all the jobs available |
/jobs/:id | GET | Get each job using an id specified |
/jobs | POST | Create a job |
/jobs/:id | DELETE | Delete a job |
/jobs/:id | PATCH | Edit a job |
/jobs/:id/comments | POST | Create a comment for each job |
/jobs/:id/comments | PATCH | Update a comment |
I use MongoDB as the database and AWS cloud services (provided by MongoDB) for this project.
MongoDB offers:
- Flexibility
- Scalability (horizontal scaling)
- High Performance
The reason is that MongoDB is performance, scalability, flexibility and an accessible environment. MongoDB is almost 100 times faster than a traditional database; hence the user is more likely to receive the content/data faster. MongoDB can perform well with a large data volume, allowing users to insert thousands of records in a second. Also, MongoDB has a feature called horizontal scaling. This feature will enable unlimited comments to be added to each post with easy management. SQL database is way more difficult when you have to add each column for each comment, which can end up being hundreds of columns for 1 job (1 row) and making data management very difficult.
For a professionally built application, the ability to store a large amount of data and easy management are essential. For example, you can easily add more features (show how many jobs a tradie has done, offer financial management, suggestions...). For the back-end, you can easily add more fields on top of the document, more collections to the database (finance management, etc), and users can make any number of notes associated with each job. I also use React (JavaScript framework) for the front end, which pairs up nicely with MongoDB and makes it very easy to scale up this project in the future.
- The logic of back-end is written in JavaScript, with back-end JavScript environment (NodeJS), and data is stored in MongoDB.
This is the instruction on how to run this project locally:
- Clone the project
git clone https://github.com/memopussle/job_tracker.git
- Install npm package on client folder
cd client
npm install
- Install npm package on server folder
cd server
npm install
- In server folder, add your own MongoDB Atlas link in .env file (example for env setup can be found in .env.example):
PORT = YOUR_PORT
CONNECTION_URL = MONGODB_ATLAS_URL
- Open http://localhost:3000 to see the project.
You can test endpoints in Insomnia or other testing and validating alternatives (Postman, Swagger UI, Paw etc). Here are screenshots of how endpoins results look like:
- Use this base URL: https://job-idenitifier.herokuapp.com and add either one of the endpoints below:
Endpoints | Method | Usage |
---|---|---|
/jobs | GET | Show all the jobs available |
/jobs/:id | GET | Get each job using an id specified |
/jobs | POST | Create a job |
/jobs/:id | DELETE | Delete a job |
/jobs/:id | PATCH | Edit a job |
/jobs/:id/comments | POST | Create a comment for each job |
/jobs/:id/comments | PATCH | Update a comment |
Thu Giang - [email protected]
Project Link: Tradify