Flytbase is a backend server application developed using MongoDB, Express, and Node.js (MEN stack). It provides user authorization using cookies and JWT tokens. The application can be run in a Docker container using the provided Dockerfile and Docker image. Additionally, a collection of Postman APIs and .env file is included for testing purposes.
Flytbase revolves around five basic schemas:
-
User: Represents a user of the system. There are two types of users: admin and normal users.
-
Site: Represents a location or site associated with the system.
-
Mission: Represents a specific task or mission assigned to a user or a drone.
-
Drone: Represents a drone used within the system. Only the admin can create and allocate drones to other users.
-
Category: Represents a category of mission.
The application implements user authorization using cookies and JWT tokens. Admin users have additional privileges such as creating and allocating drones to other users. Drones can only be deleted by admin users.
Node version: 14
-
Clone the repo in your desired location using following command:
git clone https://github.com/ninad-0408/flytbase-assignment.git
-
Go to the dockerfile and change your working directory path.
-
Open the same folder in terminal and run
sudo docker build . -t flytbase:latest
. This will createflytbase
Docker image for you. -
Now run
sudo docker run -p 5000:5000/tcp flytbase
this will start the container in same terminal. -
Now without closing the terminal go to the postman and now you can hit post request on
http://localhost:5000/user/signup
withContent-Type: application/json
and provide name, email, password and confirmPassword to signup.
-
Clone the repo in your desired location using following command:
git clone https://github.com/ninad-0408/flytbase-assignment.git
-
Install 14th version of Node.
-
Open terminal in same folder and run
npm i
. This will install all the dependancies. -
Run
npm start
to run the application. -
Now without closing the terminal go to the postman and now you can hit post request on
http://localhost:5000/user/signup
withContent-Type: application/json
and provide name, email, password and confirmPassword to signup.