This project is a company manager API. Using this API, users can perform MongoDB CRUD operations on collections of employees, projects, and project tasks.
- Mongosh
- Redis (follow steps below)
- On Mac:
- Make sure you have Homebrew installed using
brew --version
- In your terminal, run
brew install redis
- Make sure you have Homebrew installed using
- On Windows/Linux:
- Enable WSL2 or Install using
wsl --install
in administrator mode on PS or CMD - Once you're running Ubuntu on windows, paste the following into the terminal:
- Enable WSL2 or Install using
- On Mac:
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
pip install -r requirements.txt
- Open a new terminal tab and enter the mongosh command given to you by Atlas
- Navigate to the mongodb-initialization.txt file.
- In the terminal, run
use company-manager
- Copy and paste each
insertMany
statement into the terminal as they appear in mongodb-initialization.txt. They look like this:
db.collection.insertMany([
{
"...": ...,
"...": ...
},
{
"...": ...,
"...": ...
},
])
- Start your Redis server at port 6379
- On Mac, run
redis-server
- On Windows, in WSL2, run
sudo service redis-server start
- On Mac, run
python3 account-manager.py
python3 employee-manager.py
python3 project-manager.py
python3 task-manager.py
- account-manager runs on port 31001
- employee-manager runs on port 31002
POST
http://127.0.0.1:31002/v1/employee-manager/employees
GET
http://127.0.0.1:31002/v1/employee-manager/employees
GET
http://127.0.0.1:31002/v1/employee-manager/employees/<int:emp_id>
PUT
http://127.0.0.1:31002/v1/employee-manager/employees/<int:emp_id>
DELETE
http://127.0.0.1:31002/v1/employee-manager/employees/<int:emp_id>
- project-manager runs on port 31003
POST
http://127.0.0.1:31003/v1/project-manager/projects
GET
http://127.0.0.1:31003/v1/project-manager/projects
GET
http://127.0.0.1:31003/v1/project-manager/projects/<int:pro_id>
PUT
http://127.0.0.1:31003/v1/project-manager/projects/<int:pro_id>
DELETE
http://127.0.0.1:31003/v1/project-manager/projects/<int:pro_id>
- task-manager runs on port 31004
POST
http://127.0.0.1:31004/v1/task-manager/tasks
GET
http://127.0.0.1:31004/v1/task-manager/tasks
GET
http://127.0.0.1:31004/v1/task-manager/projects/<int:pro_id>
GET
http://127.0.0.1:31004/v1/task-manager/employees/<int:emp_id>
PUT
http://127.0.0.1:31004/v1/task-manager/tasks/<id>
DELETE
http://127.0.0.1:31004/v1/task-manager/tasks/<id>
- note:
- For POST and PUT operations, you will need a raw JSON body
- For Authentication, you need to navigate to the
Headers
tab and inputKey= Authorization
andValue= Bearer <token-here>
Click here to view the github repository
- Pascual Gonzales
- Tarek Chaalan
- Bryan De Los Santos
-
- Planned microservices architecture
- Redis cache implementation
-
- JWT implementation
-
- bcrypt implementation
-
- API development
- API testing
-
- We implemented caching to store frequently accessed queries in memory.
- To implement the cache, we used Redis
-
- We broke down our application into four smaller, independently deployable services.
-
- Account Manager: Sign-Up/Log-In and JWT token creation
-
- Employee Manager: CRUD operations for the db.employees collection
-
- Project Manager: CRUD operations for the db.projects collection
-
- Task manager: CRUD operations for the db.tasks collection
-
- We broke down our application into four smaller, independently deployable services.
-
- In order to make our APIs secure, users are required to obtain a JWT token. This is done through the Account Manager service's Log-In feature.
-
- To store encrypted user passwords, we used the bcrypt library.